File size: 1,432 Bytes
7fa65ca
 
 
 
 
 
943a477
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1700a7a
943a477
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eaa852b
 
 
 
 
 
943a477
 
 
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
49
50
51
52
53
---
license: apache-2.0
datasets:
- dair-ai/emotion
language:
- en
pipeline_tag: text-classification
---
## Sentiment Classifier: Emotion Detection with Sentence Transformer

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:

* Sadness
* Joy
* Love
* Anger
* Fear
* Surprise

**Developed by:** shhossain: [https://github.com/shhossain](https://github.com/shhossain)

**Model type:** [Custom](https://huggingface.co/shhossain/all-MiniLM-L6-v2-sentiment-classifier/blob/main/model.py)

**Language(s):** English

**License:** Same as all-MiniLM-L6-v2

**Finetuned from:** all-MiniLM-L6-v2 ([https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2))

## Usage Example

```python
from transformers import pipeline

pipe = pipeline("text-classification", model="shhossain/all-MiniLM-L6-v2-sentiment-classifier", trust_remote_code=True)

result = pipe("This product is excellent!")
result
```

**Output:**

```json
[{'label': 'sad', 'score': 0.006396006792783737},
 {'label': 'joy', 'score': 0.7897642254829407},
 {'label': 'love', 'score': 0.17318710684776306},
 {'label': 'anger', 'score': 0.008878232911229134},
 {'label': 'fear', 'score': 0.010075093246996403},
 {'label': 'surprise', 'score': 0.011699344962835312}]
```