Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
|
|
4 |
pipe = pipeline(model="delarosajav95/tw-roberta-base-sentiment-FT-v2")
|
5 |
#function that Gradio will use to classify
|
6 |
def classify_text(inputs):
|
7 |
-
result = pipe(inputs,
|
8 |
output = []
|
9 |
label_mapping = {"LABEL_0": "Negative", "LABEL_1": "Neutral", "LABEL_2": "Positive"}
|
10 |
for i, predictions in enumerate(result):
|
@@ -26,7 +26,7 @@ iface = gr.Interface(
|
|
26 |
outputs=output_box,
|
27 |
live=True,
|
28 |
title="Sentiment Analysis for User Opinions & Feedback",
|
29 |
-
|
30 |
)
|
31 |
|
32 |
# Launch the interface
|
|
|
4 |
pipe = pipeline(model="delarosajav95/tw-roberta-base-sentiment-FT-v2")
|
5 |
#function that Gradio will use to classify
|
6 |
def classify_text(inputs):
|
7 |
+
result = pipe(inputs, return_all_scores=True)
|
8 |
output = []
|
9 |
label_mapping = {"LABEL_0": "Negative", "LABEL_1": "Neutral", "LABEL_2": "Positive"}
|
10 |
for i, predictions in enumerate(result):
|
|
|
26 |
outputs=output_box,
|
27 |
live=True,
|
28 |
title="Sentiment Analysis for User Opinions & Feedback",
|
29 |
+
allow_flagging="never",
|
30 |
)
|
31 |
|
32 |
# Launch the interface
|