Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.1.0
metadata
title: Emotion Analysis App
emoji: π
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 6.0.2
app_file: app.py
pinned: false
Emotion Analysis App
A sophisticated web application for analyzing emotions in text using zero-shot classification. Built with Gradio and powered by Facebook's BART-Large-MNLI model.
Setup
Clone or download this repository
Install dependencies:
pip install -r requirements.txtRun the app:
python app.pyThe first run will download the model from Hugging Face Hub (about 1.5GB).
Open your browser and navigate to
http://localhost:7860
How It Works
Enter text and the model will:
- Perform zero-shot classification across 27 emotion categories
- Display the dominant emotion with confidence percentage
- Show a complete breakdown table of all emotions
- Provide visual comparisons (radar chart and bar chart)
Emotions Detected
Admiration, Adoration, Aesthetic Appreciation, Amusement, Anger, Anxiety, Awe, Awkwardness, Boredom, Calmness, Confusion, Craving, Disgust, Empathic Pain, Entrancement, Excitement, Fear, Horror, Interest, Joy, Nostalgia, Relief, Romance, Sadness, Satisfaction, Sexual Desire, Surprise
Model Information
- Model:
facebook/bart-large-mnli(BART Large trained on MNLI) - Task: Zero-shot classification
- Input Size: Supports up to 512 tokens (text automatically truncated)
Files
app.py- Main applicationrequirements.txt- Dependencies
Notes
- Model: Automatically downloads from Hugging Face Hub on first run
- Best Results: Works best with English text
- GPU Support: Automatically detects and uses GPU if available for faster inference
- Performance: With GPU, processing is near-instant; on CPU, may take a few seconds
Developed by
SUDIPTA ROY