AdamCodd commited on
Commit
ad447c1
1 Parent(s): ab1db4a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -1
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
- More information needed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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