AI-powered sentiment analysis web application for life coaching professionals
Feelingz is a full-stack emotion detection platform designed for life coaches to track and analyze their clients' emotional journeys. Built with microservices architecture using FastAPI backend and Streamlit frontend, the application leverages deep learning (Conv1D neural networks) trained on sentiment datasets to predict emotions from daily journal entries.
- NLP Emotion Detection: CNN-based sentiment analysis trained on Kaggle + Twitter datasets
- Daily Journal Tracking: Clients submit daily text entries with automatic emotion classification
- Analytics Dashboard: Visual insights and trends for coaching professionals
- Client Management: CRUD operations for coach-client relationships
- Docker Deployment: Fully containerized with docker-compose for easy setup
- Database Persistence: SQLite backend for data storage
- Interactive UI: Clean Streamlit interface for users and coaches
- RESTful API: FastAPI backend with automatic OpenAPI documentation
Docker Compose Orchestration
├── Streamlit Frontend (Port: 8501)
│ ├── Client views
│ ├── Coach dashboard
│ └── Data input
│
├── FastAPI Backend (Port: 8000)
│ ├── CRUD API
│ ├── ML inference
│ └── SQLite DB
│
└── Conv1D NLP Model
└── Keras Architecture
| Component | Technologies |
|---|---|
| Backend | FastAPI, SQLAlchemy, Uvicorn |
| Frontend | Streamlit, Requests |
| ML/NLP | TensorFlow/Keras, Conv1D, Word2Vec, texthero |
| Database | SQLite |
| Deployment | Docker, Docker Compose |
| Python | 3.9.7+ |
feelingz/
├── docker-compose.yml
├── README.md
├── FastAPI_Backend/
│ ├── main.py
│ ├── models.py
│ ├── database.py
│ ├── cruds.py
│ ├── requirements.txt
│ ├── Dockerfile
│ ├── sql_app.db
│ └── Conv1d/
│ ├── saved_model.pb
│ ├── keras_metadata.pb
│ └── variables/
├── Streamlit_Frontend/
│ ├── app.py
│ ├── requirements.txt
│ └── Dockerfile
├── flo/
│ ├── eda.ipynb
│ ├── mod_keras.ipynb
│ └── mod_hugging.ipynb
├── arnold/
│ └── texthero_partage_2.ipynb
├── theophile/
│ ├── Projet_wordvectgo.ipynb
│ └── Projet_wordvectJournal.ipynb
└── mlruns/
- Python >= 3.9.7
- Docker Desktop (for containerized deployment)
- Git
- Clone the repository
git clone https://github.com/Flockyy/feelingz.git
cd feelingz
- Launch with Docker Compose
docker-compose up --build
This will start:
- FastAPI Backend: http://localhost:8000
- Streamlit Frontend: http://localhost:8501
- Access the application
- Open browser at http://localhost:8501 for the Streamlit UI
- API docs available at http://localhost:8000/docs
Backend Setup (Click to expand)
cd FastAPI_Backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Frontend Setup (Click to expand)
cd Streamlit_Frontend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
streamlit run app.py --server.port 8501
-
Submit Daily Entry
- Navigate to "Daily Journal" section
- Write today's thoughts and feelings
- Click "Submit" - AI automatically detects emotion
-
View History
- Browse past journal entries
- See predicted emotions for each day
- Edit or delete previous entries
-
Emotion Tracking
- View emotion trends over time
- Identify patterns in mood changes
-
Client Management
- Add new clients with contact info
- Update client details
- Remove inactive clients
-
Analytics Dashboard
- View aggregated emotion data per client
- Generate reports for coaching sessions
- Track client progress over time
-
Data Insights
- Identify emotional patterns
- Correlate emotions with life events
- Make data-driven coaching decisions
Conv1D Neural Network for Text Classification:
Model: Sequential
- Embedding Layer (Word2Vec pre-trained)
- Conv1D (128 filters, kernel size 5, ReLU)
- GlobalMaxPooling1D
- Dense (64 units, ReLU)
- Dropout (0.5)
- Dense (6 units, Softmax) # 6 emotion classes- Kaggle Sentiment Analysis Dataset: 1M+ labeled tweets
- Data.world Twitter Dataset: Domain-specific emotion labels
- Combined preprocessing with texthero library
| Class | Description |
|---|---|
| Joy | Positive, happy, excited |
| Sadness | Depressed, melancholic |
| Anger | Frustrated, annoyed |
| Fear | Anxious, worried |
| Surprise | Astonished, shocked |
| Neutral | Balanced, calm |
- Accuracy: ~85% on validation set
- F1-Score: 0.82 (macro-averaged)
- Inference Time: <50ms per prediction
# Explore training notebooks in flo/ directory
jupyter notebook flo/mod_keras.ipynb
# Run MLflow tracking
mlflow ui --backend-store-uri mlruns/
| Method | Endpoint | Description |
|---|---|---|
POST |
/clients/` | Create new client |
GET |
/clients/` | List all clients |
GET |
/clients/{id}` | Get client details |
PUT |
/clients/{id}` | Update client info |
DELETE |
/clients/{id}` | Delete client |
| Method | Endpoint | Description |
|---|---|---|
POST |
/entries/` | Submit journal entry + predict emotion |
GET |
/entries/{client_id}` | Get all entries for client |
PUT |
/entries/{id}` | Edit entry text |
DELETE |
/entries/{id}` | Delete entry |
| Method | Endpoint | Description |
|---|---|---|
POST |
/predict/` | Get emotion prediction for text |
# Predict emotion from text
curl -X POST http://localhost:8000/predict/ \\
-H "Content-Type: application/json" \\
-d '{"text": "I feel amazing today! Everything is going perfectly."}'
# Response:
# {"emotion": "joy", "confidence": 0.92, "probabilities": {...}}
version: '3.8'
services:
backend:
build: ./FastAPI_Backend
ports:
- "8000:8000"
volumes:
- ./FastAPI_Backend:/app
environment:
- DATABASE_URL=sqlite:///./sql_app.db
frontend:
build: ./Streamlit_Frontend
ports:
- "8501:8501"
depends_on:
- backend
environment:
- BACKEND_URL=http://backend:8000# Backend tests
cd FastAPI_Backend
pytest tests/ -v
# Model evaluation
python -m notebooks.flo.mod_keras
# Reset database
rm FastAPI_Backend/sql_app.db
python FastAPI_Backend/database.py
Contributions are welcome!
- Fork the repository
- Create feature branch (
git checkout -b feature/new-feature) - Test locally with
docker-compose up - Commit changes (
git commit -m 'Add feature') - Push to branch (
git push origin feature/new-feature) - Open Pull Request
This project is a training application for educational purposes.
- Kaggle for sentiment analysis datasets
- Data.world for Twitter emotion corpus
- FastAPI framework by Sebastián Ramírez
- Streamlit team for the frontend framework
- TensorFlow/Keras for deep learning tools
- Course instructors and fellow students
Feel free to try this app and send feedback! We appreciate your input for improving the platform.