MikeJeong commited on
Commit
7874721
1 Parent(s): 24cb2ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,7 +21,7 @@ def predict(model, txt):
21
  pipe_roberta = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment-latest", tokenizer="cardiffnlp/twitter-roberta-base-sentiment-latest")
22
 
23
  #pipeline for finbert
24
- tokenizer = BertTokenizer.from_pretrained('yiyanghkust/finbert-tone')
25
  pipe_finbert = pipeline("sentiment-analysis", model="yiyanghkust/finbert-tone", tokenizer=tokenizer_f)
26
  pipe_bart = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
27
  res = pipe_bart(txt, labels)['scores']
@@ -52,7 +52,7 @@ def predict(model, txt):
52
  score = fin_res['score']
53
  fin_res = []
54
  for sc in res:
55
- fin_res.append(sc + (0.7421 * (label + 0.05) * random.random() * sc) )
56
 
57
  return fin_res
58
 
 
21
  pipe_roberta = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment-latest", tokenizer="cardiffnlp/twitter-roberta-base-sentiment-latest")
22
 
23
  #pipeline for finbert
24
+ tokenizer_f = BertTokenizer.from_pretrained('yiyanghkust/finbert-tone')
25
  pipe_finbert = pipeline("sentiment-analysis", model="yiyanghkust/finbert-tone", tokenizer=tokenizer_f)
26
  pipe_bart = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
27
  res = pipe_bart(txt, labels)['scores']
 
52
  score = fin_res['score']
53
  fin_res = []
54
  for sc in res:
55
+ fin_res.append(sc + (0.4429 * (label + 0.05) * random.random() * sc) )
56
 
57
  return fin_res
58