Update README.md
Browse files
README.md
CHANGED
@@ -65,7 +65,21 @@ This emotion classifier has been trained on 89_754 examples split into train, va
|
|
65 |
|
66 |
## Intended uses & limitations
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
## Training and evaluation data
|
71 |
|
|
|
65 |
|
66 |
## Intended uses & limitations
|
67 |
|
68 |
+
Usage:
|
69 |
+
```python
|
70 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
|
71 |
+
|
72 |
+
tokenizer = AutoTokenizer.from_pretrained('AdamCodd/distilbert-base-uncased-finetuned-emotion-balanced')
|
73 |
+
model = AutoModelForSequenceClassification.from_pretrained('AdamCodd/distilbert-base-uncased-finetuned-emotion-balanced')
|
74 |
+
|
75 |
+
# Create the pipeline
|
76 |
+
emotion_classifier = pipeline('text-classification', model=model, tokenizer=tokenizer)
|
77 |
+
|
78 |
+
# Now you can use the pipeline to classify emotions
|
79 |
+
result = emotion_classifier("We are delighted that you will be coming to visit us. It will be so nice to have you here.")
|
80 |
+
print(result)
|
81 |
+
#[{'label': 'joy', 'score': 0.9983291029930115}]
|
82 |
+
```
|
83 |
|
84 |
## Training and evaluation data
|
85 |
|