Git Product home page Git Product logo

movie-review-sentiment-analysis-using-sagemaker's Introduction

Movie-review-sentiment-analysis-using-Sagemaker

A simple web app which interacts with a deployed recurrent neural network performing sentiment analysis on movie reviews.

Project Outline

  1. Download the imdb dataset.

  2. Prepare and Process the data by shuffling positive and negative reviews together. Make a vocabulary dictionary and tokenize the reviews to int words.

  3. Upload data to Amazon S3.

  4. Build and train LSTM Classifier in Pytorch.

  5. Test the train method with some data.

  6. Use Sagemaker's Pytorch facility by making a python script for train method and set that script as parameter "entry point" for the estimator.

  7. Deploy the model by creating an endpoint.

    TESTING

    • Use deployed endpoint predictions to test the model.
    • Testing by writing your own review.
  8. Write inference code as a python script 'predict.py' in the serve directory. This directory also contains model.py, utils.py & requirement.txt which tells sagemaker what python libraries are required.

  9. Delete previous test endpoints and deploy a new one that directs sagemaker to 'serve' directory and 'predict.py' script. Test the accuracy again with some data.

  10. Working on the AWS Console :

    • Setting up Lambda function which is used to send preprocessed data to the endpoints.
    • Setting up API Gateway and adding that to the web app file.
  11. Hosting your web app with S3

    • Firstly, create a S3 bucket with a name same as you want your domain name to be.

    • Configure your S3 Bucket for static website hosting by going to properties. Select "Static website hosting" >> "use this bucket to host a website".

    • Enter your web app document as "Index Document".

    • Go to "Permissions" & unblock all the Public Access Policies in the Public Access Settings. Update your bucket policy so as to share with anyone in the world.

    • (Optional) You can map your desired domain name to the S3 website URL.

    • Navigate to your S3 Bucket and upload your entire static website directory in our case just the web app document. Keep every other thing as default.

  12. You can share the url with your friends and family to play with your web app.

Caution

  • Never forget to delete the endpoints, if you are not using it as it incurs cost for running your endpoints.
predictor.delete_endpoint()
  • Using S3 storage also incurs cost but it's relatively very less and depends on amount of files you have there.

  • Don't put your private files in buckets with public access.

Result

Hosted web app on a smartphone

Sentiment Analysis Web App is a notebook and collection of Python files taken from the udacity . The result is a deployed RNN performing sentiment analysis on movie reviews complete with publicly accessible API and a simple web page which interacts with the deployed endpoint.

movie-review-sentiment-analysis-using-sagemaker's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.