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):
|
@@ -30,4 +30,4 @@ iface = gr.Interface(
|
|
30 |
)
|
31 |
|
32 |
# Launch the interface
|
33 |
-
iface.launch(
|
|
|
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, top_k=None)
|
8 |
output = []
|
9 |
label_mapping = {"LABEL_0": "Negative", "LABEL_1": "Neutral", "LABEL_2": "Positive"}
|
10 |
for i, predictions in enumerate(result):
|
|
|
30 |
)
|
31 |
|
32 |
# Launch the interface
|
33 |
+
iface.launch()
|