maininbook
add curi model
3ca75da
|
Raw History Blame Contribute Delete
2.9 kB
---
title: Emotion Analysis
emoji: 🎭
colorFrom: purple
colorTo: yellow
sdk: gradio
sdk_version: "5.42.0"
app_file: app.py
pinned: false
---
# 🎭 Multimodal Emotion Analyzer
AI model that analyzes 26 different emotions, designed to run on Hugging Face Spaces with Gradio interface.
## πŸš€ Hugging Face Spaces Deployment
### 1. Clone Repository
```bash
git clone https://huggingface.co/spaces/CURI-AI/sentiment-analysis-en
cd sentiment-analysis
```
### 2. Copy Files
Copy the following files from the current project to the Spaces repository:
- `app.py` - Main application
- `requirements.txt` - Python dependencies
- `README.md` - This file
### 3. Set Environment Variables
Set Hugging Face token to access organization models:
```bash
export HF_TOKEN="your-huggingface-token"
```
### 4. Commit and Push
```bash
git add .
git commit -m "Add emotion analysis app"
git push
```
## πŸ”§ Key Features
- **26 Emotion Categories**: admiration, aesthetic appreciation, awe, anxiety, fear, horror, disgust, calmness, romantic love, sexual desire, nostalgia, interest, surprise, excitement, anger, pride, triumph, contempt, disappointment, empathic pain, sadness, guilt, envy, amusement, awkwardness, adoration
- **Real-time Analysis**: Instant emotion analysis from text input
- **Visualization**: Top emotions chart and overall emotion distribution heatmap
- **English Support**: Optimized for English text input
## πŸ“Š Usage
1. Enter English text in the input field
2. Click "Submit" button
3. View emotion analysis results and visualizations
## πŸ—οΈ Technology Stack
- **Frontend**: Gradio
- **AI Model**: Hugging Face Transformers
- **Visualization**: Plotly
- **Backend**: Python
## πŸ”‘ Environment Variables
- `HF_TOKEN`: Hugging Face access token (for organization model access)
## πŸ“ Example Texts
- "Today was such a happy day! I spent time with friends and had delicious food together."
- "This movie was so scary that I don't think I can sleep tonight. It was truly terrifying."
- "I'm so proud and happy that I got a good grade on the exam. All my hard work paid off."
## πŸ› Troubleshooting
### Model Loading Failure
- Check if `HF_TOKEN` environment variable is set
- Verify organization model name (`CURI-AI/sentiment-analysis-en-v1`)
- Check internet connection
### Dependency Errors
```bash
pip install -r requirements.txt
```
## πŸ“ž Support
If you encounter issues, check:
1. Hugging Face token is properly configured
2. Access permissions to organization models
3. All dependencies are installed
## 🌟 Features
- **Real Model Integration**: Uses CURI-AI organization's trained emotion analysis model
- **Fallback Mode**: Automatically switches to simulation mode if model loading fails
- **Interactive Charts**: Beautiful Plotly visualizations for emotion analysis
- **Responsive Design**: Modern Gradio interface optimized for various screen sizes