Social media sentiment analysis using Logistic Regression, Naive Bayes, and ANN — served via FastAPI + Next.js.
- Frontend — Next.js 14, Tailwind CSS
- Backend — FastAPI, scikit-learn, TensorFlow
- Models — versioned via
registry.json, hot-swappable
social-sentiment/
├── frontend/ # Next.js app
├── backend/ # FastAPI + ML layer
│ └── ml/
│ ├── registry.json # model registry
│ ├── models/ # .pkl / .h5 files (not in git)
│ └── preprocessors/ # vectorizers (not in git)
└── docker-compose.yml
cd backend
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
python -c "import nltk; nltk.download('stopwords')"
uvicorn app.main:app --reloadcd frontend
npm install
npm run devBackend → http://localhost:8000
Frontend → http://localhost:3000
API docs → http://localhost:8000/docs
Models are declared in backend/ml/registry.json.
To add a new model: drop the file in ml/models/, add an entry to the registry, restart the server.
| ID | Name | Type | Enabled |
|---|---|---|---|
| log_reg_v1 | Logistic Regression | sklearn | ✅ |
| bayes_v1 | Naive Bayes | sklearn | ✅ |
| ann_baseline_v1 | ANN Baseline | keras | ✅ |
| ann_improved_v1 | ANN Improved | keras | ✅ |
Upcoming model -> ann_WE+LSTM
| Notebook | View |
|---|---|
| Model Development | |
| Model Playground | |
| Model Improved |
- Docker ≥ 24.0
- Docker Compose ≥ 2.0
git clone https://github.com/David27322/SentimentLens.git
cd SentimentLenscp .env.example .envdocker compose up --buildThe app will be available at http://localhost:3000
| Command | Description |
|---|---|
docker compose up -d |
Run in detached (background) mode |
docker compose down |
Stop and remove containers |
docker compose logs -f |
Tail logs from all services |
docker compose ps |
List running services |
The
docker-compose.ymlandDockerfileare already in the repo root.

