Created by Réka Gábosi
- Description
- Course
- Project Overview
- Features
- Technologies Used
- Project Structure
- How to Run
- Example
- Final Notes
- Acknowledgements
This is a web-based emotion detection application created as the final project for the IBM course: Developing AI Applications with Python and Flask.
IBM: Developing AI Applications with Python and Flask
The goal of this project is to build an emotion detection system that can:
- Analyze a given English sentence.
- Return emotion scores (anger, disgust, fear, joy, sadness).
- Identify and display the dominant emotion.
- Deploy the system as a web application using Flask.
The application uses Watson NLP (via HTTP POST to Watson’s EmotionPredict endpoint) to classify emotions.
- Emotion detection via Watson NLP.
- Web interface using Flask.
- Error handling for invalid or blank inputs.
- Packaged as a Python module.
- Unit tested and PyLint-compliant (10/10 score).
- Static frontend files provided (
index.html,mywebscript.js).
- Python 3.11
- Flask
- Requests
- Watson NLP API
- HTML + JavaScript (for frontend)
- PyLint / Black (code quality & formatting)
│
├── EmotionDetection/
│ ├── init.py
│ └── emotion_detection.py
│
├── static/
│ └── mywebscript.js
│
├── templates/
│ └── index.html
│
├── tests/
│ └── test_emotion_detection.py
│
├── server.py
├── LICENSE
├── .gitignore
├── requirements.txt
└── README.md - Python 3.7+
- IBM Cloud account with a Natural Language Understanding service instance
(Get API key and URL from your IBM Cloud dashboard)
git clone https://github.com/Afhrodite/AI-Based-Web-Application-Development-and-Deployment.git
cd AI-Based-Web-Application-Development-and-Deployment
pip install -r requirements.txtCreate a .env file in the project root with the following content:
API_KEY=your_ibm_nlu_api_key_here
API_URL=your_ibm_nlu_instance_url_hereRun the Flask server with:
python server.pyBy default, the Flask server runs on http://localhost:5000.
I love this new technology.{
'anger': 0.002,
'disgust': 0.001,
'fear': 0.004,
'joy': 0.985,
'sadness': 0.008,
'dominant_emotion': 'joy'
}- Error handling is implemented for blank or invalid input.
- Emotion detection logic is modular and reusable.
- Code was cleaned and formatted with Black.
- Project passed static analysis with PyLint score: 10/10.
This project was developed as part of the IBM course: Developing AI Applications with Python and Flask, provided on Coursera.
Special thanks to:
- IBM Skills Network for the project framework and Watson NLU access.