mohd43 commited on
Commit
069556a
1 Parent(s): 10d3d01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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=gr.Label(label="Predicted Sentiment Probabilities"),
 
 
 
 
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