Text Classification
Transformers
PyTorch
TensorFlow
JAX
Safetensors
English
roberta
emotion
Eval Results (legacy)
text-embeddings-inference
Instructions to use bhadresh-savani/roberta-base-emotion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bhadresh-savani/roberta-base-emotion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="bhadresh-savani/roberta-base-emotion")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/roberta-base-emotion") model = AutoModelForSequenceClassification.from_pretrained("bhadresh-savani/roberta-base-emotion") - Notebooks
- Google Colab
- Kaggle
Commit ·
fd6ebe3
1
Parent(s): 4c4becf
Update README.md
Browse files
README.md
CHANGED
|
@@ -25,8 +25,21 @@ metrics:
|
|
| 25 |
## How to Use the model:
|
| 26 |
```python
|
| 27 |
from transformers import pipeline
|
| 28 |
-
classifier = pipeline("
|
| 29 |
-
prediction = classifier("I love using transformers. The best part is wide range of support and its easy to use")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
## Dataset:
|
|
|
|
| 25 |
## How to Use the model:
|
| 26 |
```python
|
| 27 |
from transformers import pipeline
|
| 28 |
+
classifier = pipeline("text-classification",model='bhadresh-savani/roberta-base-emotion', return_all_scores=True)
|
| 29 |
+
prediction = classifier("I love using transformers. The best part is wide range of support and its easy to use", )
|
| 30 |
+
print(prediction)
|
| 31 |
+
|
| 32 |
+
"""
|
| 33 |
+
Output:
|
| 34 |
+
[[
|
| 35 |
+
{'label': 'sadness', 'score': 0.002281982684507966},
|
| 36 |
+
{'label': 'joy', 'score': 0.9726489186286926},
|
| 37 |
+
{'label': 'love', 'score': 0.021365027874708176},
|
| 38 |
+
{'label': 'anger', 'score': 0.0026395076420158148},
|
| 39 |
+
{'label': 'fear', 'score': 0.0007162453257478774},
|
| 40 |
+
{'label': 'surprise', 'score': 0.0003483477921690792}
|
| 41 |
+
]]
|
| 42 |
+
"""
|
| 43 |
```
|
| 44 |
|
| 45 |
## Dataset:
|