Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudacademy/sentiment-analysis-aws-lambda
How to deploy a Machine Learning model for sentiment analysis in the Cloud with AWS Lambda.
https://github.com/cloudacademy/sentiment-analysis-aws-lambda
Last synced: 14 days ago
JSON representation
How to deploy a Machine Learning model for sentiment analysis in the Cloud with AWS Lambda.
- Host: GitHub
- URL: https://github.com/cloudacademy/sentiment-analysis-aws-lambda
- Owner: cloudacademy
- Created: 2016-04-22T11:00:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-22T10:15:09.000Z (about 4 years ago)
- Last Synced: 2024-08-01T06:21:42.637Z (3 months ago)
- Language: Python
- Size: 37.3 MB
- Stars: 106
- Watchers: 21
- Forks: 31
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sentiment analysis in the Cloud with AWS Lambda.
The Cloud Academy team shows how to build a sentiment analysis machine learning model by using a pubic dataset and how to deploy it to production with AWS Lambda and API Gateway.
![Frontend Screenshot](frontend/screenshot.png?raw=true)
## How to install requirements
OS libraries can be installed as follows (Linux):
$ sudo yum install -y atlas-devel atlas-sse3-devel blas-devel gcc gcc-c++ lapack-devel python27-devel
Python requirements can be installed with pip.
$ pip install -r requirements.txt
## Training phaseYou can train and persist the model into file by executing:
$ python main.py
## Test the model locally
You can run the model via CLI as follows:
$ python predict.py "This function is awesome"
> positive
## How to deploy the Lambda functionSimply execute the following deployment script:
$ ./deploy.sh
It will automatically create a new deployment package containing every Python dependency and the OS libraries required by scikit-learn and numpy, together with the "lambda" folder.
[Here](https://github.com/ryansb/sklearn-build-lambda) you can find the whole stack ready to be uploaded ([reference](https://serverlesscode.com/post/deploy-scikitlearn-on-lamba/)).
Once the deployment package is ready, you can create a new AWS Lambda function and bind it to a new Amazon API Gateway endpoint.
### References
* [Cloud Academy & AWS: how we use Amazon Web Services for machine learning and data collection](https://cloudacademy.com/webinars/cloud-academy-and-aws-how-we-use-aws-machine-learning-and-data-collection-10/) (webinar)
* [Using Scikit-Learn In AWS Lambda](https://serverlesscode.com/post/deploy-scikitlearn-on-lamba/) (article by [Ryan Brown](https://github.com/ryansb))
* [Sentiment Analysis dataset](http://cs.stanford.edu/people/alecmgo/trainingandtestdata.zip) (by cs.stanford.edu)
* [Amazon Serverless Architecture](http://cloudacademy.com/blog/amazon-serverless-api-gateway-lambda-cloudfront-s3/) (Cloud Academy blog)
* [Google Cloud Functions VS AWS Lambda](http://cloudacademy.com/blog/google-cloud-functions-serverless/) (Cloud Academy blog)