Spaces:
Running
Running
Commit
·
b8e2fdf
1
Parent(s):
ed6c508
refactor app.py and requirements.txt to specify gradio version
Browse files
app.py
CHANGED
@@ -35,22 +35,23 @@ def predict_sentiment(text):
|
|
35 |
interpretation = "neutral"
|
36 |
return round(score, 4), interpretation
|
37 |
|
38 |
-
iface = gr.Interface(
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
48 |
|
49 |
#iface.launch()
|
50 |
iface.launch(
|
51 |
-
server_name="0.0.0.0",
|
52 |
-
share=True,
|
53 |
-
#enable_queue=False
|
54 |
-
max_threads=40,
|
55 |
-
show_api=True
|
56 |
)
|
|
|
35 |
interpretation = "neutral"
|
36 |
return round(score, 4), interpretation
|
37 |
|
38 |
+
iface = gr.Interface(
|
39 |
+
fn=predict_sentiment,
|
40 |
+
inputs=gr.Textbox(label="Enter financial sentence"),
|
41 |
+
outputs=[
|
42 |
+
gr.Number(label="Sentiment Score"),
|
43 |
+
gr.Textbox(label="Interpretation")
|
44 |
+
],
|
45 |
+
title="TinyFinBERT Sentiment Analysis",
|
46 |
+
allow_api=True,
|
47 |
+
api_name="predict"
|
48 |
+
)
|
49 |
|
50 |
#iface.launch()
|
51 |
iface.launch(
|
52 |
+
# server_name="0.0.0.0",
|
53 |
+
# share=True,
|
54 |
+
# #enable_queue=False
|
55 |
+
# max_threads=40,
|
56 |
+
# show_api=True
|
57 |
)
|