IBM
Flask + Watson NLP emotion-detection capstone — classifies anger, disgust, fear, joy, and sadness from customer feedback text.
Completed 2025-09-16
An AI-powered web app that detects emotions — anger, disgust, fear, joy, sadness — from customer feedback text.
Developed with Flask and Watson NLP (Embeddable Libraries) as the final project of the IBM Developing AI Applications with Python and Flask course.
This project extends sentiment analysis into fine-grained emotion detection.
Instead of just positive/negative polarity, it identifies which emotion dominates a piece of text.
✔️ Input: Free-form text from the user
✔️ Processing: Watson NLP EmotionPredict model
✔️ Output: JSON with emotion scores + a formatted natural language response
Input:
I love my life.
JSON Output:
{
"anger": 0.0062,
"disgust": 0.0026,
"fear": 0.0093,
"joy": 0.9680,
"sadness": 0.0497,
"dominant_emotion": "joy"
}
Browser Display:
For the given statement, the system response is
'anger': 0.0062, 'disgust': 0.0026, 'fear': 0.0093,
'joy': 0.9680 and 'sadness': 0.0497.
The dominant emotion is joy.
EmotionDetection/ # Packaged emotion detection module
__init__.py
emotion_detection.py
static/ # Provided JavaScript file
templates/ # Provided index.html
server.py # Flask web server
test_emotion_detection.py
requirements.txt
README.md
Clone the repository
git clone https://github.com/<your-username>/emotion-detector-app.git
cd emotion-detector-app
Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # Mac/Linux
.venv\Scripts\activate # Windows
Install dependencies
pip install -r requirements.txt
Run the Flask server
python server.py
Access the app
http://127.0.0.1:5000
This project was developed as part of the IBM Developing AI Applications with Python and Flask course.
📜 Certificate: Verify on Coursera
Ahmad Tawil
Software Engineering Student @ Braude College
Passionate about AI, Machine Learning, and Full-Stack Development