GET /
Returns the home page of the microservice with a simple web interface.Response
Returns an HTML template (home.html) that provides a user-friendly interface for accessing the emotion prediction service.
Request Example
This endpoint is defined in microservice.py:193-195 and returns a basic landing page for the web interface.
GET /textbased_emotion
Analyzes text content for toxicity, emotion, and extracts entities like countries, people, and dates.Parameters
The text content to analyze. Should be URL-encoded when passed as a query parameter.Example:
Write your text hereRequest Example
Toxicity Classification
The API uses a threshold of 0.29 to classify text across six toxicity categories:- toxic - General toxic language
- severe_toxic - Severely toxic or hateful language
- obscene - Obscene or vulgar content
- threat - Threatening language
- insult - Insulting content
- identity_hate - Identity-based hate speech
Emotion Classification
The emotion classifier determines if the text represents:- Positive emotion
- Negative emotion
Entity Extraction
The API automatically extracts:- Countries: Geographic locations mentioned in the text
- People: Person names identified using NER patterns
- Dates: Date references in the text
- Hours: Time ranges in the format “HH:MM - HH:MM”