Sadman4701 commited on
Commit
a4d8d5c
·
verified ·
1 Parent(s): c676860

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -3
README.md CHANGED
@@ -76,8 +76,18 @@ It is **not** intended for clinical diagnosis or professional mental health deci
76
  from transformers import pipeline
77
 
78
  classifier = pipeline(
79
- "text-classification",
80
- model="Sadman4701/Deberta-v3-base-for-apricity"
 
81
  )
82
 
83
- classifier("I feel empty and tired all the time.")
 
 
 
 
 
 
 
 
 
 
76
  from transformers import pipeline
77
 
78
  classifier = pipeline(
79
+ task="text-classification",
80
+ model="your-username/deberta-emotion-multilabel",
81
+ return_all_scores=True
82
  )
83
 
84
+ text = "I feel scared but also strangely hopeful about the future."
85
+
86
+ outputs = classifier(text)
87
+
88
+ THRESHOLD = "According to your preferences"
89
+ predicted_emotions = [
90
+ o["label"] for o in outputs[0] if o["score"] >= THRESHOLD
91
+ ]
92
+
93
+ print(predicted_emotions)