Skip to content

alaison-benny/sentiments-api-project

Repository files navigation

Sentiment Analysis API Platform


1. Introduction

Hi Recruiter, let me walk you through This sample projects called Sentiment Analysis API Platform.

The goal of this project is to analyze customer text and determine whether the sentiment is:

  • Positive
  • Negative
  • Neutral

The solution is exposed as a REST API and can be integrated with applications such as:

  • Customer feedback systems
  • Product review platforms
  • Social media monitoring tools
  • Customer support analytics

2. Business Problem

Organizations receive large amounts of customer feedback every day.

Manually analyzing this feedback is:

  • Time-consuming
  • Expensive
  • Not scalable

The objective of this solution is to automate sentiment classification and provide quick insights for business teams.


3. My Role

Although this is a technical project, I would approach it as a Technical Project Manager by:

  • Managing project delivery
  • Coordinating development and deployment activities
  • Tracking sprint progress
  • Managing stakeholders
  • Coordinating releases
  • Monitoring production health
  • Managing risks and dependencies

4. High Level Architecture

The overall flow is:

Client Application

FastAPI REST API

Machine Learning Model

Sentiment Prediction

JSON Response

The API receives text input.

The machine learning model processes the text and predicts sentiment.

The result is returned back as a JSON response.


5. Technology Stack

Backend:

  • Python
  • FastAPI

Machine Learning:

  • Sentiment Analysis Model

Containerization:

  • Docker

Cloud:

  • AWS EC2

Monitoring:

  • Prometheus
  • Grafana

Project Management Tools:

  • Jira
  • Confluence

6. API Demonstration

Sample Input:

"I really love this product. The experience was amazing."

Expected Output:

{ "sentiment": "Positive" }

Another Example:

"The service was terrible and very disappointing."

Expected Output:

{ "sentiment": "Negative" }

This demonstrates how the API can analyze customer feedback in real time.


7. Containerization Using Docker

To ensure consistency across environments:

  • The application is packaged inside Docker containers.
  • Developers can run the same application locally.
  • QA can validate the same build.
  • Production runs the same image.

Benefits:

  • Faster deployment
  • Environment consistency
  • Easier scaling

8. Deployment Approach

The application can be deployed on AWS EC2.

Deployment Flow:

Developer Code

Git Repository

Build Process

Docker Image

AWS EC2 Deployment

Production Environment

Benefits:

  • Faster releases
  • Repeatable deployments
  • Reduced deployment issues

9. Monitoring and Observability

Monitoring is critical in production systems.

This project uses:

Prometheus

Used for:

  • Collecting metrics
  • Monitoring API performance
  • Tracking request counts
  • Tracking error rates

Grafana

Used for:

  • Dashboards
  • Visualization
  • Performance monitoring
  • Operational reporting

Key Metrics:

  • API response time
  • Request volume
  • Error percentage
  • System health

10. Risks I Would Manage as a TPM

Some common risks include:

  • Infrastructure failures
  • Model accuracy degradation
  • Deployment failures
  • Unexpected traffic spikes
  • Production incidents

Mitigation:

  • Monitoring alerts
  • Rollback strategy
  • Release validation
  • Performance testing
  • Regular health checks

11. Agile Delivery Approach

If this were delivered in a Scrum model:

Sprint 1:

  • Requirement gathering
  • Architecture design

Sprint 2:

  • API development

Sprint 3:

  • Dockerization

Sprint 4:

  • AWS deployment

Sprint 5:

  • Monitoring setup

Sprint 6:

  • UAT and production release

Throughout the project:

  • Daily standups
  • Sprint planning
  • Sprint reviews
  • Retrospectives
  • Stakeholder demos

12. Scalability Discussion

If usage grows:

I would consider:

  • Load balancing
  • Multiple API instances
  • Container orchestration using Kubernetes
  • Auto-scaling
  • Centralized monitoring

This ensures the platform can support increasing traffic and business growth.


13. Project Outcome

The final solution provides:

  • Automated sentiment analysis
  • REST API integration capability
  • Cloud deployment readiness
  • Monitoring and observability
  • Scalable architecture

From a Technical Project Manager perspective, this project demonstrates:

  • Technical understanding
  • Cloud deployment knowledge
  • DevOps awareness
  • Monitoring strategy
  • Agile delivery management
  • End-to-end ownership

=======================================

Sentiments API Project

Production-ready Sentiment Analysis API with FastAPI, Docker, AWS, Prometheus & Grafana — showcasing end-to-end MLOps deployment and monitoring.

📌 What is this project?

This project demonstrates a production-ready Sentiment Analysis API built with FastAPI, containerized using Docker, deployed on AWS EC2, and monitored using Prometheus and Grafana. It showcases real-world MLOps practices including model serving, cloud deployment, and observability.


🛠️ Technologies Used

  • Python (FastAPI, scikit-learn)
  • Docker (Dockerfile, docker-compose)
  • AWS EC2 (Ubuntu instance)
  • Prometheus (metrics scraping)
  • Grafana (dashboard visualization)
  • GitHub (version control)

🧭 Architecture Diagram

Architecture


🚀 Steps Done

  1. Developed a simple ML model (sentiment analysis).
  2. Built API layer using FastAPI.
  3. Containerized the application with Docker.
  4. Deployed the containerized app on AWS EC2.
  5. Configured Security Groups for API access.
  6. Integrated Prometheus for metrics collection.
  7. Set up Grafana dashboards for visualization.
  8. Tested API endpoints with curl/Postman.
  9. Documented architecture and deployment steps.

✅ Why this project?

This project highlights end-to-end skills in:

  • Machine Learning model serving
  • API development
  • Containerization
  • Cloud deployment
  • Monitoring & observability

It is designed to showcase MLOps and DevOps capabilities in real-world scenarios.


📊 Monitoring Dashboards

🔹 Dashboard 1: API Metrics Overview

Dashboard 1

Shows request rate, error rate, response time, and status codes.


🔹 Dashboard 2: Latency & Performance

Dashboard 2

Highlights 95th percentile latency, top endpoints, and request types.


🔹 Dashboard 3: Health & Uptime

Dashboard 3

Displays error rate over time, uptime, and CPU usage.


📂 How to Run

git clone https://github.com/<your-username>/sentiments-api-project.git
cd sentiments-api-project
docker-compose up -d

---
Access:

API → http://<EC2-IP>:8000

Prometheus → http://<EC2-IP>:9090

Grafana → http://<EC2-IP>:3000

About

Production-ready Sentiment Analysis API with FastAPI, Docker, AWS EC2, Prometheus, and Grafana. End-to-end MLOps deployment with monitoring dashboards.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors