File size: 1,902 Bytes
89b78d4
9d3f6cb
06b9afb
 
9d3f6cb
 
 
7a79852
197add4
7a79852
e6be4c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
title: E-motionAssistant API
emoji: 🌍
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
---

# Multilingual Text Emotion Recognition App  
**English • සිංහල • தமிழ்**

This is a simple web app that detects emotions from text in three languages:

- **English** → Logistic Regression + TF-IDF (classical ML model)  
- **Sinhala** → Finetuned transformer model  
- **Tamil** → Finetuned transformer model  

### Supported Languages & Models
| Language   | Model Type              | Repository on Hugging Face                                      |
|------------|-------------------------|------------------------------------------------------------------|
| English    | TF-IDF + Logistic Regression | E-motionAssistant/Englsih_Trained_Model_LR                      |
| Sinhala    | Finetuned Transformer   | E-motionAssistant/SInhala_Text_Emotion_Recognition_Model        |
| Tamil      | Finetuned Transformer   | E-motionAssistant/Tamil_Emotion_Recognition_Model               |

### How to Use
1. Go to one of the tabs (English / සිංහල / தமிழ்)
2. Type or paste your text/message/tweet
3. The app will show the predicted emotion + confidence score

### Examples
- English: "I hate mondays so much" → likely **sadness** or **anger**
- Sinhala: "මම ගොඩක් දුකින් ඉන්නවා" → likely **sadness**
- Tamil: "எனக்கு ரொம்ப கோபமா இருக்கு" → likely **anger**

### Technical Notes
- Built with **Gradio** (v4.44.0)
- Models are downloaded from Hugging Face at startup (using `hf_hub_download` and `pipeline`)
- Uses **Python 3.11** to avoid compatibility issues
- No GPU required — runs on CPU

### Want to run locally?
```bash
git clone https://huggingface.co/spaces/YOUR_USERNAME/Space4
cd Space4
pip install -r requirements.txt
python app.py