Text Classification
Transformers
PyTorch
TensorFlow
JAX
Safetensors
English
bert
emotion
Eval Results (legacy)
text-embeddings-inference
Instructions to use bhadresh-savani/bert-base-uncased-emotion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bhadresh-savani/bert-base-uncased-emotion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="bhadresh-savani/bert-base-uncased-emotion")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/bert-base-uncased-emotion") model = AutoModelForSequenceClassification.from_pretrained("bhadresh-savani/bert-base-uncased-emotion", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Commit ·
fd52bbd
1
Parent(s): 0e4cf73
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/bert-base-uncased-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.0005138228880241513},
|
| 36 |
+
{'label': 'joy', 'score': 0.9972520470619202},
|
| 37 |
+
{'label': 'love', 'score': 0.0007443308713845909},
|
| 38 |
+
{'label': 'anger', 'score': 0.0007404946954920888},
|
| 39 |
+
{'label': 'fear', 'score': 0.00032938539516180754},
|
| 40 |
+
{'label': 'surprise', 'score': 0.0004197491507511586}
|
| 41 |
+
]]
|
| 42 |
+
"""
|
| 43 |
```
|
| 44 |
|
| 45 |
## Dataset:
|