Commit
·
9a811e6
1
Parent(s):
fe90914
fn 4
Browse files
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.
|
| 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()
|