The goal is to understand the scalable machine learning tasks using AWS sagemaker. The model uses LSTM network.
For the web app to work we require AWS SageMaker, AWS S3 Bucket, AWS Lambda, AWS API Gateway. I have used AWS Sagemaker the ml.t2.medium instance to run notebook. Inside the notebook ml.p2.xlarge is used for training a model and ml.m4.xlarge is used for deployment.
The IMDb dataset, which contains 25,000 highly polar movie reviews for training, and 25,000 for testing is used. An example of a postive review is given below
The violent and rebel twenty-five years old sailor Antwone Fisher (Derek Luke) is sent to three sessions for evaluation with the navy psychiatrist Dr. Jerome Davenport (Denzel Washington), after another outburst and aggression against a superior ranked navy man. Reluctant in the beginning of the treatment, he gets confidence in Dr. Davenport and discloses his childhood, revealing painful traumas generated in his foster house. Meanwhile, he meets Cheryl Smolley (Joy Briant), and they fall in love for each other. Resolving his personal problems, Antwone becomes a new man. This true familial drama is a touching and positive story of a man who finds a friend and is sent back to a regular life. The direction of Denzel Washington is excellent, making sensitive, attractive and with good taste, a story about child abuse. In the hands of another director, it might be a very heavy story. My vote is eight.
Title (Brazil): 'Voltando a Viver' ('Returning to Live')
The libraries required to install for sentimental anlaysis and deployment of web app.
torch
pandas
numpy
nltk
beautifulsoup4
html5lib
- Initialize AWS instance and the jupyter notebook then run SageMaker Project.ipynb
ipython SageMaker-Project.ipynb
-
Then create Lambda function and API Gateway for the web app, as shown in notebook.
-
Edit the html with API link from AWS API Gateway
-
Run the html file
-
Type the sentiment and click submit
- PyTorch - An open source machine learning framework that accelerates the path from research prototyping to production deployment.
- AWS Sagemaker Python SDK - Amazon SageMaker Python SDK is an open source library for training and deploying machine-learned models on Amazon SageMaker.
- Credits to Udacity community and instructors.