Sambhavnoobcoder commited on
Commit
9a811e6
·
1 Parent(s): fe90914
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -28,8 +28,14 @@ def predict_sentiment(text):
28
  iface = gr.Interface(
29
  fn=predict_sentiment,
30
  inputs=gr.inputs.Textbox(label="Enter text here"),
31
- outputs=gr.outputs.Bar(label="Sentiment Distribution", num_top_classes=3)
32
  )
33
 
 
 
 
 
 
 
34
  # Launch the interface
35
  iface.launch()
 
28
  iface = gr.Interface(
29
  fn=predict_sentiment,
30
  inputs=gr.inputs.Textbox(label="Enter text here"),
31
+ outputs=gr.outputs.Plotly(title="Sentiment Distribution", x="Sentiment", y="Probability")
32
  )
33
 
34
+ # Define the possible classes
35
+ classes = ["Positive", "Negative", "Neutral"]
36
+
37
+ # Add the possible classes to the output plot
38
+ iface.outputs[0].type.bar.labels = classes
39
+
40
  # Launch the interface
41
  iface.launch()