Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,9 +24,16 @@ def analyze_sentence(index):
|
|
24 |
plt.ylabel('TARGET')
|
25 |
plt.xlabel('SOURCE')
|
26 |
plt.grid()
|
27 |
-
return
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
24 |
plt.ylabel('TARGET')
|
25 |
plt.xlabel('SOURCE')
|
26 |
plt.grid()
|
27 |
+
return fig
|
28 |
|
29 |
+
demo = gr.Blocks()
|
30 |
+
with demo:
|
31 |
+
with gr.Row():
|
32 |
+
dropdown = gr.Dropdown(choices=dataset['text'], value=0, type='index')
|
33 |
+
btn = gr.Button("Run")
|
34 |
+
output = gr.Plot(label="Plot")
|
35 |
+
btn.click(fn=analyze_sentence, [dropdown], [output])
|
36 |
|
37 |
+
|
38 |
+
if __name__ == "__main__":
|
39 |
+
demo.launch()
|