In this project, I have tried to solve Tweet Sentiment Extraction Kaggle Problem.
In notebooks/01-DataPrep-and-training.ipynb
, I have used Amazon Sagemaker to train and deploy a roberta
model on Tweet Sentiment Extraction dataset dataset from kaggle.
Then in the notebook 02-Create-Lambda.pynb
I have showed how to create AWS Lambda required to host the Sagemaker Endpoint via API Gateway .
Pytorch and hugging face is used for the modeling purpose.
- Create a Sagemaker notebook instance with the instance type as
ml.t2.medium
- Once the Notebook instance is
In Service
, clone this git repo in the Jupyter environment - Run
notebooks/01-DataPrep-and-training.ipynb
notebook to train and deploy the model with Amazon Sagemaker followed by Inference - Refer to
src/train.py
script used for training the model - Run notebook
notebooks/02-Create-Lambda
to create AWS Lambda required to host the Sagemaker Endpoint via API Gateway - Follow this detailed AWS tutorial to invoke lambda function via Amazon API gateway
- Download
app
folder in your local and runapp/app.py
and change the variableurl = "<<Amazon API Gateway url link>>"
with your Amazon API Gateway url link to create a flask API. - (Optional) You can follow this medium article to run your Flask API on AWS EC2 instance.
This library is licensed under the Apahce License 2.0. See the LICENSE file.