You may choose to reproduce the results, however, you may also pull the Docker image!
- The requirements.txt contains the required libraries + more
- Git clone my repository and run all the cells in the ipynb file - '/workspace/workspace.ipynb'
Marvin works at the last Blockbusta Videoz (a fictional video rental shop) where his task is to classify movie and TV show reviews to help curate a special section of the store.
One day while perusing his favorite website, Marvin came upon a post about someone who secretly automated their job and then quietly took off on a long (paid) vacation. Inspired, Marvin set aside a portion of his salary to hire a developer to write a few scripts to scrape movie reviews from various sources. It's a bit noisy, but aggregating many reviews has cut the time he previously spent on his job by half.
Now, after reading an article about AI, Marvin wants to take things a step further: he is searching for a program that can determine a) whether or not a piece of text is a movie/TV show review and b) whether or not each review is positive (the movie/TV show is recommended) or negative (the movie/TV show should be avoided).
Marvin has put together a competition and advertised it on Fraggle (a fictional platform for competitive data science).
See https://uazhlt-ms-program.github.io/ling-539-course-blog/assignments/class-competition
Competition: https://www.kaggle.com/competitions/ling-539-sp-2024-class-competition
Invitation URL: https://www.kaggle.com/t/33320feca02e42bd924c3473e3a8c2fd
This Sentiment Analyisis was a part of a class competition to predict whether or not a piece of text is a movie/TV show review and b) whether or not each review is positive or negative. The project was also an exercise to deploy the final model by using FastAPI, Docker and cloud provider Render to host the site (the free version of Render ran out of memory (used over 512MB) while running my code). We will instead recommend using Docker to pull the image to run the move in your local server.
Below are a fews commands to pull the image from DockerHub and test the model in your machine. The FastAPI Documentation details the available endpoints, JSON request and response formats, and information specified in my mlapi.py
file. You can access this documentation by adding the /docs to the server (http://localhost:8000/docs). Additionally, you can simply clone my repository to reproduce the results.
- Pull the Image.
docker pull weezygeezer/reviews-api:latest
- Run a Container.
docker run -d -p 8080:80 weezygeezer/reviews-api:latest
- Visit the LocalHost server. (http://localhost:8000/docs)
The FastAPI documentation sends a JSON request to the model. Below is an example of how the API will look on your machine:
![SA-rev](https://private-user-images.githubusercontent.com/85853890/326155605-15189fe7-01c7-419b-bab5-499f31f65e23.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMyNjU0MTcsIm5iZiI6MTcyMzI2NTExNywicGF0aCI6Ii84NTg1Mzg5MC8zMjYxNTU2MDUtMTUxODlmZTctMDFjNy00MTliLWJhYjUtNDk5ZjMxZjY1ZTIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEwVDA0NDUxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk4NWY5MzllNDM3YmI3Y2VjOGI3MWYzYjliNGI0OWE4OWVjNmRmNDIxMGM3NDRjOTRmZTc5NGE1ZGFiMGRmZWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xvA-aPNeQCMBntNGC7cWklwZe1TC8YldeWYoFDp7VHc)
![SA-example](https://private-user-images.githubusercontent.com/85853890/326155637-05af8189-b3bb-4f9e-8736-8e99c4a1d860.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMyNjU0MTcsIm5iZiI6MTcyMzI2NTExNywicGF0aCI6Ii84NTg1Mzg5MC8zMjYxNTU2MzctMDVhZjgxODktYjNiYi00ZjllLTg3MzYtOGU5OWM0YTFkODYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEwVDA0NDUxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIwZTMxZGFhNjJiZDU0NTk2NDU3YjQwNjJiZTkzZjRjZDlkYTk0NjVmYTYwMzg5MTU5ZmEwN2NmODY4YTQ3NmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.NxGy-IQrxlVIo20WfM0EX8FUcke5AuE4lqXMYJS9jdQ)
I lied. There's nothing more to see but thanks for reading!