Instructions to use harshith20/Emotion_predictor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harshith20/Emotion_predictor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="harshith20/Emotion_predictor")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("harshith20/Emotion_predictor") model = AutoModelForSequenceClassification.from_pretrained("harshith20/Emotion_predictor") - Notebooks
- Google Colab
- Kaggle
Commit ·
c8709eb
1
Parent(s): 769cc58
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
---
|
| 2 |
license: openrail
|
| 3 |
---
|
|
|
|
| 4 |
import torch
|
| 5 |
from transformers import AutoTokenizer, MobileBertForSequenceClassification
|
| 6 |
|
|
@@ -28,4 +29,5 @@ with torch.no_grad():
|
|
| 28 |
predicted_emotion_label = emotion_labels[predicted_emotion]
|
| 29 |
|
| 30 |
print(f"Input text: {input_text}")
|
| 31 |
-
print(f"Predicted emotion: {predicted_emotion_label}")
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: openrail
|
| 3 |
---
|
| 4 |
+
```
|
| 5 |
import torch
|
| 6 |
from transformers import AutoTokenizer, MobileBertForSequenceClassification
|
| 7 |
|
|
|
|
| 29 |
predicted_emotion_label = emotion_labels[predicted_emotion]
|
| 30 |
|
| 31 |
print(f"Input text: {input_text}")
|
| 32 |
+
print(f"Predicted emotion: {predicted_emotion_label}")```
|
| 33 |
+
|