Skip to content

Afhrodite/AI-Based-Web-Application-Development-and-Deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Based-Web-Application-Development-and-Deployment

Python Flask IBM Watson License Pylint Project Status

Created by Réka Gábosi

Table of Contents

Description

This is a web-based emotion detection application created as the final project for the IBM course: Developing AI Applications with Python and Flask.

Course

IBM: Developing AI Applications with Python and Flask

Project Overview

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.

Features

  • 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).

Technologies Used

  • Python 3.11
  • Flask
  • Requests
  • Watson NLP API
  • HTML + JavaScript (for frontend)
  • PyLint / Black (code quality & formatting)

Project Structure

│
├── 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 

How to Run

Prerequisites

  • Python 3.7+
  • IBM Cloud account with a Natural Language Understanding service instance
    (Get API key and URL from your IBM Cloud dashboard)

Installation

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.txt

Configuration

Create 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_here

Running the App

Run the Flask server with:

python server.py

By default, the Flask server runs on http://localhost:5000.

Example

Input

I love this new technology.

Output

{
  'anger': 0.002,
  'disgust': 0.001,
  'fear': 0.004,
  'joy': 0.985,
  'sadness': 0.008,
  'dominant_emotion': 'joy'
}

Final Notes

  • 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.

Acknowledgements

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.

About

AI-powered emotion detection web app using IBM Watson Natural Language Understanding and Flask. Built as a final project for an IBM professional course.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors