Skip to content

Welcome! This project demonstrates the deployment of a ML-based API. Below is a link to DockerHub for the image.

Notifications You must be signed in to change notification settings

uazhlt-ms-program/grad-level-term-project-kaggle-competition-weezymatt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment-Analysis-with-Movie-Reviews

Review Assignment Due Date

Table of Contents

Reproducibility

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'

Fictional Background

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).

Task

ticket-2974645_1280

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

MLOps — Where does my model go from here?

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.

Containerized Deployment

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.

  1. Pull the Image.
docker pull weezygeezer/reviews-api:latest     
  1. Run a Container.
docker run -d -p 8080:80 weezygeezer/reviews-api:latest
  1. Visit the LocalHost server. (http://localhost:8000/docs)

LocalHost Server

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 SA-example

See more

I lied. There's nothing more to see but thanks for reading!

About

Welcome! This project demonstrates the deployment of a ML-based API. Below is a link to DockerHub for the image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages