How anirudh42/sentimentpredictionapp works
Project type and purpose
• This is a full-stack microservice style application whose primary purpose is to serve a pre-trained sentiment analysis model over HTTP.
• It uses Flask as the web framework, Docker to containerize the app, and AWS Elastic Beanstalk to host and run the container in production.
• The project provides a template for packaging any ML model into a REST API and deploying it to the cloud.
File structure
Top-level:
• .gitignore, README.md, Docker_Flask_AWS_App.pdf – documentation and ignore rules
• Dockerfile – instructions to build a container image
• requirements.txt – Python dependencies (Flask, scikit-learn, etc.)
• app.py – the Flask application with two endpoints (“/” and “/train_predict”)
Directories:
• data/ – sample CSV files used for training or testing
• ml_model/ – persisted artifacts: featurizer.pk (vectorizer) and sentiment_model.pk (trained classifier)
README for additional insights
• Confirms it’s a template for deploying ML models with Flask and Docker.
• Describes endpoints, step-by-step Docker build/run, and AWS Elastic Beanstalk commands.
• No separate front-end – clients simply hit HTTP endpoints.
Elements
• Clear labels for each component: Client, AWS EB, Docker Container, Flask App, Featurizer, Sentiment Model, Data.
– Client → Flask endpoint
– Flask → Featurizer → Model → Flask
– Dockerfile → Container build
– AWS EB → Docker Container
– Another for ML artifacts (Featurizer, Model)
– Another for infrastructure (AWS EB)