Cachoups commited on
Commit
4166ff1
·
verified ·
1 Parent(s): c648c86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -38,6 +38,7 @@ def text_to_sentiment(text, all_score=False, label = True):
38
  return fin_model(text, return_all_scores=all_score)
39
  def fin_ext(text):
40
  results = fin_model(split_in_sentences(text))
 
41
  return make_spans(text, results)
42
  def fin_ext_bis(text):
43
  results = fin_model_bis(split_in_sentences(text))
@@ -85,6 +86,7 @@ def process_paragraph_1_sent(paragraph):
85
  if isinstance(results, list) and isinstance(results[0], list):
86
  # We unpack the list of dictionaries to get all labels
87
  output = {result['label']: result['score'] for result in results[0]}
 
88
  else:
89
  output = {"Error": "Unexpected output format"}
90
  return output
@@ -95,7 +97,6 @@ def process_paragraph_1_sent_tone(paragraph):
95
  paragraph_index = int(paragraph.split(':')[0].replace('Paragraph ', '')) - 1
96
  selected_paragraph = stored_paragraphs_1[paragraph_index]
97
  fin_spans = fin_ext(selected_paragraph)
98
- print(fin_ext)
99
  return fin_spans
100
  except (IndexError, ValueError):
101
  return []
 
38
  return fin_model(text, return_all_scores=all_score)
39
  def fin_ext(text):
40
  results = fin_model(split_in_sentences(text))
41
+ print(make_spans(text, results))
42
  return make_spans(text, results)
43
  def fin_ext_bis(text):
44
  results = fin_model_bis(split_in_sentences(text))
 
86
  if isinstance(results, list) and isinstance(results[0], list):
87
  # We unpack the list of dictionaries to get all labels
88
  output = {result['label']: result['score'] for result in results[0]}
89
+ print(output)
90
  else:
91
  output = {"Error": "Unexpected output format"}
92
  return output
 
97
  paragraph_index = int(paragraph.split(':')[0].replace('Paragraph ', '')) - 1
98
  selected_paragraph = stored_paragraphs_1[paragraph_index]
99
  fin_spans = fin_ext(selected_paragraph)
 
100
  return fin_spans
101
  except (IndexError, ValueError):
102
  return []