Sign inSign up

tomsriddle/sentiment-analysis

By tomsriddle

•Updated over 2 years ago

Perform sentiment analysis for movies and television reviews

Image
Machine learning & AI
0

89

tomsriddle/sentiment-analysis repository overview

⁠Sentiment Analysis

⁠Overview

This repository provides a prototype implementation of an end to end service that provide sentiment analysis on movie & TV show reviews. We have used a dataset from Amazon

⁠Local Development Environment used for running image

  • Apple Mac M1 chip
  • Sonoma 14.1.2
  • Docker Desktop for Mac 4.26.1 (131620)

⁠Docker

⁠Pull Image

To pull an image use the following

docker pull tomsriddle/sentiment-analysis:1.0

After pulling the image check that it is present using following

docker image ls

⁠Run Image

To run the image use following

docker run -p <host port>:8786 -v <host path>:/workspace/shared-data -e data-folder=/workspace/shared-data/ -e training-data-file=amazon_movie_reviews.csv "tomsriddle/sentiment-analysis:1.0" 

Note: See the volume mapping - this is needed for the data-folder where things like transformed_reviews.csv is stored. Similarly see the use of the 2 environment variables

⁠Docker Run Example

Image Not Showing

⁠API Usage

Following APIs exposed

⁠Sentiment

This provides sentiments on an array of reviews sent

POST http://localhost:8788/get-sentiment

Request Body (all attributes are mandatory)
--------------------------------------------------------
{
    "reviews": [
        "The movie was awesome",
        "I got bored",
        "I hated it"
    ]
}

Response Body
--------------------------------------------------------

[
    2,
    1,
    0
]

Image Not Showing

⁠Model Evaluation

We have tried the following models

  • cardiffnlp/twitter-roberta-base-sentiment-latest:

⁠Troubleshooting

  • As a part of running from local or through docker image, we have to pass arguments for the folder where the training data is.

Tag summary

Content type

Image

Digest

sha256:2320547a3…

Size

5.9 GB

Last updated

over 2 years ago

docker pull tomsriddle/sentiment-analysis:1.0