Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -80,7 +80,7 @@ def process_paragraph_1_sent(paragraph):
|
|
| 80 |
try:
|
| 81 |
paragraph_index = int(paragraph.split(':')[0].replace('Paragraph ', '')) - 1
|
| 82 |
selected_paragraph = stored_paragraphs_1[paragraph_index]
|
| 83 |
-
|
| 84 |
formatted_results = "\n".join([f"{result['label']}: {result['score']:.2f}" for result in results])
|
| 85 |
return formatted_results
|
| 86 |
except (IndexError, ValueError):
|
|
@@ -113,7 +113,7 @@ def process_paragraph_2_sent(paragraph):
|
|
| 113 |
try:
|
| 114 |
paragraph_index = int(paragraph.split(':')[0].replace('Paragraph ', '')) - 1
|
| 115 |
selected_paragraph = stored_paragraphs_2[paragraph_index]
|
| 116 |
-
|
| 117 |
formatted_results = "\n".join([f"{result['label']}: {result['score']:.2f}" for result in results])
|
| 118 |
return formatted_results
|
| 119 |
except (IndexError, ValueError):
|
|
|
|
| 80 |
try:
|
| 81 |
paragraph_index = int(paragraph.split(':')[0].replace('Paragraph ', '')) - 1
|
| 82 |
selected_paragraph = stored_paragraphs_1[paragraph_index]
|
| 83 |
+
results = text_to_sentiment(selected_paragraph)
|
| 84 |
formatted_results = "\n".join([f"{result['label']}: {result['score']:.2f}" for result in results])
|
| 85 |
return formatted_results
|
| 86 |
except (IndexError, ValueError):
|
|
|
|
| 113 |
try:
|
| 114 |
paragraph_index = int(paragraph.split(':')[0].replace('Paragraph ', '')) - 1
|
| 115 |
selected_paragraph = stored_paragraphs_2[paragraph_index]
|
| 116 |
+
results = text_to_sentiment(selected_paragraph)
|
| 117 |
formatted_results = "\n".join([f"{result['label']}: {result['score']:.2f}" for result in results])
|
| 118 |
return formatted_results
|
| 119 |
except (IndexError, ValueError):
|