pentarosarium commited on
Commit
3949ea1
·
1 Parent(s): 68cd5a6

progress more (back to 3.20+)

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -98,6 +98,14 @@ roberta = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-
98
  finbert_tone = pipeline("sentiment-analysis", model="yiyanghkust/finbert-tone")
99
 
100
 
 
 
 
 
 
 
 
 
101
 
102
 
103
  def analyze_sentiment(text):
 
98
  finbert_tone = pipeline("sentiment-analysis", model="yiyanghkust/finbert-tone")
99
 
100
 
101
+ def get_mapped_sentiment(result):
102
+ label = result['label'].lower()
103
+ if label in ["positive", "label_2", "pos", "pos_label"]:
104
+ return "Positive"
105
+ elif label in ["negative", "label_0", "neg", "neg_label"]:
106
+ return "Negative"
107
+ return "Neutral"
108
+
109
 
110
 
111
  def analyze_sentiment(text):