Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,11 +8,14 @@ def predict(input_text):
|
|
8 |
predictions = pipeline(input_text, threshold=0.5, return_scores=True)
|
9 |
return predictions[0]
|
10 |
|
11 |
-
# Define the Gradio interface
|
12 |
gradio_app = gr.Interface(
|
13 |
predict,
|
14 |
inputs=gr.Textbox(label="Write a text"),
|
15 |
-
outputs=
|
|
|
|
|
|
|
|
|
16 |
title="Financial Sentiment Analysis",
|
17 |
)
|
18 |
|
|
|
8 |
predictions = pipeline(input_text, threshold=0.5, return_scores=True)
|
9 |
return predictions[0]
|
10 |
|
|
|
11 |
gradio_app = gr.Interface(
|
12 |
predict,
|
13 |
inputs=gr.Textbox(label="Write a text"),
|
14 |
+
outputs=None,
|
15 |
+
components=[
|
16 |
+
gr.Label(label="Label: {}".format(predictions[0]["label"])),
|
17 |
+
gr.Label(label="Score: {:.2f}".format(predictions[0]["score"][0])),
|
18 |
+
],
|
19 |
title="Financial Sentiment Analysis",
|
20 |
)
|
21 |
|