Shredder commited on
Commit
22a8fb2
1 Parent(s): 4390c00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -84,6 +84,13 @@ def summarize_text(text):
84
  def split_in_sentences(text):
85
  doc = nlp(text)
86
  return [str(sent).strip() for sent in doc.sents]
 
 
 
 
 
 
 
87
  ##Forward Looking Statement
88
  fls_model = pipeline("text-classification", model="yiyanghkust/finbert-fls", tokenizer="yiyanghkust/finbert-fls")
89
  def fls(text):
 
84
  def split_in_sentences(text):
85
  doc = nlp(text)
86
  return [str(sent).strip() for sent in doc.sents]
87
+ def make_spans(text,results):
88
+ results_list = []
89
+ for i in range(len(results)):
90
+ results_list.append(results[i]['label'])
91
+ facts_spans = []
92
+ facts_spans = list(zip(split_in_sentences(text),results_list))
93
+ return facts_spans
94
  ##Forward Looking Statement
95
  fls_model = pipeline("text-classification", model="yiyanghkust/finbert-fls", tokenizer="yiyanghkust/finbert-fls")
96
  def fls(text):