aadhi3 commited on
Commit
237a0f4
·
verified ·
1 Parent(s): 0eaafff

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +42 -32
README.md CHANGED
@@ -1,33 +1,43 @@
1
- # 🎭 Emotion Classifier — RoBERTa Based
2
- A deep-learning model that classifies text into **five emotion categories**:
3
- **anger, fear, joy, sadness, surprise**.
4
-
5
- Built with **PyTorch, RoBERTa transformer, Streamlit UI** and deployed on **Hugging Face Spaces**.
6
-
7
- ---
8
-
9
- ## 🧠 Model Details
10
- | Component | Description |
11
- |-----------|-------------|
12
- | Base model | `roberta-base` |
13
- | Task | Single-label Emotion Classification |
14
- | Input | Raw text |
15
- | Output | Softmax probability distribution (5 emotions) |
16
- | Framework | PyTorch + Transformers |
17
-
18
- ### Load Model from Hugging Face
19
- ```python
20
- from huggingface_hub import hf_hub_download
21
- import torch
22
- from BertEmotionClassifier import BertEmotionClassifier
23
-
24
- model_path = hf_hub_download(repo_id="aadhi3/RoBert_Model", filename="model.pth")
25
-
26
- from transformers import AutoTokenizer
27
- tokenizer = AutoTokenizer.from_pretrained("roberta-base")
28
-
29
- model = BertEmotionClassifier(model_name="roberta-base", num_labels=5)
30
- state_dict = torch.load(model_path, map_location="cpu")
31
- model.load_state_dict(state_dict)
32
- model.eval()
 
 
 
 
 
 
 
 
 
 
33
  ```
 
1
+ ---
2
+ title: Emotion Classifier
3
+ emoji: 🎭
4
+ colorFrom: indigo
5
+ colorTo: blue
6
+ sdk: streamlit
7
+ sdk_version: "1.32.0"
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+ # 🎭 Emotion Classifier — RoBERTa Based
12
+ A deep-learning model that classifies text into **five emotion categories**:
13
+ **anger, fear, joy, sadness, surprise**.
14
+
15
+ Built with **PyTorch, RoBERTa transformer, Streamlit UI** and deployed on **Hugging Face Spaces**.
16
+
17
+ ---
18
+
19
+ ## 🧠 Model Details
20
+ | Component | Description |
21
+ |-----------|-------------|
22
+ | Base model | `roberta-base` |
23
+ | Task | Single-label Emotion Classification |
24
+ | Input | Raw text |
25
+ | Output | Softmax probability distribution (5 emotions) |
26
+ | Framework | PyTorch + Transformers |
27
+
28
+ ### Load Model from Hugging Face
29
+ ```python
30
+ from huggingface_hub import hf_hub_download
31
+ import torch
32
+ from BertEmotionClassifier import BertEmotionClassifier
33
+
34
+ model_path = hf_hub_download(repo_id="aadhi3/RoBert_Model", filename="model.pth")
35
+
36
+ from transformers import AutoTokenizer
37
+ tokenizer = AutoTokenizer.from_pretrained("roberta-base")
38
+
39
+ model = BertEmotionClassifier(model_name="roberta-base", num_labels=5)
40
+ state_dict = torch.load(model_path, map_location="cpu")
41
+ model.load_state_dict(state_dict)
42
+ model.eval()
43
  ```