Skip to content
This project allows a user to provide their review regarding a movie and using Sentimental Analysis, the underlying model predicts whether the review is positive or negative. The training model is trained using Pytorch NN and training data used is IMDB review dataset available at https://www.kaggle.com/utathya/imdb-review-dataset.
Python HTML
Branch: master
Clone or download
Latest commit c1dcc0b Dec 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__pycache__
cache/sentiment_analysis
data/pytorch
serve
train
website
.gitignore
LICENSE
README.md
__init__.py
main.py
requirements.txt
review.pdf

README.md

Sentimental-Analysis-using-PyTorch

This project allows a user to provide their review regarding a movie and using Sentimental Analysis, the underlying model predicts whether the review is positive or negative. The training model is trained using Pytorch NN and training data used is IMDB review dataset available at https://www.kaggle.com/utathya/imdb-review-dataset.

Getting Started

Clone

  • Clone this repo to your local machine by typing the following command :

    $ git clone `https://github.com/mehtajinesh/Sentimental-Analysis-using-NN.git`
    

Prerequisites

Things to install before starting :

Deployment Steps

  1. First step is to install all the modules required to run the python code into your local system. Use the following command:
$ pip install -r requirements.txt
  1. Once all the modules are installed, then download the IMDB dataset and extract folders for training the model.
%mkdir ../data
!wget -O ../data/aclImdb_v1.tar.gz http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz
!tar -zxf ../data/aclImdb_v1.tar.gz -C ../data
  1. Next, we combine the training and deployment (elaborated below) inside the main.py file :
  • preprocessing data

  • training model by fitting the data to pytorch model

  • deploy the trained model on sagemaker which will constantly interact with the AWS Lambda function

    So for training the model, we execute the main.py file like this :

$python main.py
  1. Once the execution is done, it will print out the deployed model name, which is provided to the AWS Lambda function.

  2. Next, we create a AWS API Gateway which will communicate to the AWS Lambda function whenever a submit request comes.

  3. Once the API is ready, we update the URL inside the index.html file and voila! We are good to go!!

Built With

  • Python - The web framework used
  • AWS SageMaker - where the trained model are deployed
  • AWS Lambda - where the prediction is done using trained model
  • AWS S3 - where the model artifacts are stored
  • AWS API Gateway - where the url hits on click of submit

Authors

  • Jinesh Mehta

License

License

Reviews & Validations

You can’t perform that action at this time.