alex-shvets commited on
Commit
b98ebcc
·
verified ·
1 Parent(s): 0121cef

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -7
README.md CHANGED
@@ -27,10 +27,12 @@ Here is how to use this model:
27
  >>> from transformers import pipeline
28
  >>> model_name = "roberta-large-emopillars-contextless-isear"
29
  >>> threshold = 0.5
30
- >>> emotions = ["admiration", "amusement", "anger", "annoyance", "approval", "caring", "confusion",
31
- >>> "curiosity", "desire", "disappointment", "disapproval", "disgust", "embarrassment",
32
- >>> "excitement", "fear", "gratitude", "grief", "joy", "love", "nervousness", "optimism",
33
- >>> "pride", "realization", "relief", "remorse", "sadness", "surprise", "neutral"]
 
 
34
  >>> label_to_emotion = dict(zip(list(range(len(emotions))), emotions))
35
  >>> emotion_to_isear = {
36
  >>> "anger": "anger",
@@ -45,9 +47,11 @@ Here is how to use this model:
45
  >>> pipe = pipeline("text-classification", model=model_name, truncation=True,
46
  >>> return_all_scores=True, device=-1 if device.type=="cpu" else 0)
47
  >>> # input in a format f"{text}"
48
- >>> utterances = ["Ok is it just me or is anyone else getting goosebumps too???",
49
- >>> "Don’t know what to do",
50
- >>> "When a car is overtaking another and I am forced to drive off the road."]
 
 
51
  >>> outcome = pipe(utterances)
52
  >>> dominant_classes = [
53
  >>> [prediction for prediction in example if prediction['score'] >= threshold and
 
27
  >>> from transformers import pipeline
28
  >>> model_name = "roberta-large-emopillars-contextless-isear"
29
  >>> threshold = 0.5
30
+ >>> emotions = [
31
+ >>> "admiration", "amusement", "anger", "annoyance", "approval", "caring", "confusion",
32
+ >>> "curiosity", "desire", "disappointment", "disapproval", "disgust", "embarrassment",
33
+ >>> "excitement", "fear", "gratitude", "grief", "joy", "love", "nervousness", "optimism",
34
+ >>> "pride", "realization", "relief", "remorse", "sadness", "surprise", "neutral"
35
+ >>> ]
36
  >>> label_to_emotion = dict(zip(list(range(len(emotions))), emotions))
37
  >>> emotion_to_isear = {
38
  >>> "anger": "anger",
 
47
  >>> pipe = pipeline("text-classification", model=model_name, truncation=True,
48
  >>> return_all_scores=True, device=-1 if device.type=="cpu" else 0)
49
  >>> # input in a format f"{text}"
50
+ >>> utterances = [
51
+ >>> "Ok is it just me or is anyone else getting goosebumps too???",
52
+ >>> "Don’t know what to do",
53
+ >>> "When a car is overtaking another and I am forced to drive off the road."
54
+ >>> ]
55
  >>> outcome = pipe(utterances)
56
  >>> dominant_classes = [
57
  >>> [prediction for prediction in example if prediction['score'] >= threshold and