Update README.md
Browse files
README.md
CHANGED
@@ -4,4 +4,51 @@ datasets:
|
|
4 |
- dair-ai/emotion
|
5 |
language:
|
6 |
- en
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
- dair-ai/emotion
|
5 |
language:
|
6 |
- en
|
7 |
+
pipeline_tag: text-classification
|
8 |
+
---
|
9 |
+
## Sentiment Classifier: Emotion Detection with Sentence Transformer
|
10 |
+
|
11 |
+
This model classifies sentiments using the Sentence Transformer, specifically the `all-MiniLM-L6-v2` architecture. It's trained on the `dair-ai/emotion` dataset to identify six basic emotions:
|
12 |
+
|
13 |
+
* Sadness
|
14 |
+
* Joy
|
15 |
+
* Love
|
16 |
+
* Anger
|
17 |
+
* Fear
|
18 |
+
* Surprise
|
19 |
+
|
20 |
+
**Developed by:** shhossain: [https://github.com/shhossain](https://github.com/shhossain)
|
21 |
+
|
22 |
+
**Model type:** Custom ([https://huggingface.co/shhossain/all-MiniLM-L6-v2-sentiment-classifier/blob/main/model.py](https://huggingface.co/shhossain/all-MiniLM-L6-v2-sentiment-classifier/blob/main/model.py))
|
23 |
+
|
24 |
+
**Language(s):** English
|
25 |
+
|
26 |
+
**License:** Same as all-MiniLM-L6-v2
|
27 |
+
|
28 |
+
**Finetuned from:** all-MiniLM-L6-v2 ([https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2))
|
29 |
+
|
30 |
+
## Usage Example
|
31 |
+
|
32 |
+
```python
|
33 |
+
from transformers import pipeline
|
34 |
+
|
35 |
+
pipe = pipeline("text-classification", model="shhossain/all-MiniLM-L6-v2-sentiment-classifier", trust_remote_code=True)
|
36 |
+
|
37 |
+
result = pipe("This product is excellent!")
|
38 |
+
result
|
39 |
+
```
|
40 |
+
|
41 |
+
**Output:**
|
42 |
+
|
43 |
+
```json
|
44 |
+
[
|
45 |
+
{"label": "joy", "score": 0.8},
|
46 |
+
{"label": "love", "score": 0.1},
|
47 |
+
{"label": "anger", "score": 0.05},
|
48 |
+
{"label": "sadness", "score": 0.03},
|
49 |
+
{"label": "surprise", "score": 0.02},
|
50 |
+
{"label": "fear", "score": 0.01}
|
51 |
+
]
|
52 |
+
```
|
53 |
+
|
54 |
+
|