Spaces:
Runtime error
Runtime error
torileatherman
commited on
Commit
•
11dc9a8
1
Parent(s):
ff9d011
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
project = hopsworks.login()
|
4 |
+
fs = project.get_feature_store()
|
5 |
+
dataset_api = project.get_dataset_api()
|
6 |
+
|
7 |
+
def article_selection(sentiment):
|
8 |
+
if sentiment == "Positive":
|
9 |
+
return f"""The sentence you requested is Positive!"""
|
10 |
+
else sentiment == "Negative":
|
11 |
+
return f"""The sentence you requested is Positive!"""
|
12 |
+
else sentiment == "Neutral":
|
13 |
+
return f"""The sentence you requested is Positive!"""
|
14 |
+
|
15 |
+
demo = gr.Interface(
|
16 |
+
fn=article_selection,
|
17 |
+
inputs = gr.inputs.Dropdown(["Positive","Negative","Neutral"])
|
18 |
+
#outputs = [gr.outputs.Textbox(label="Sentiment Prediction")],
|
19 |
+
)
|
20 |
+
|
21 |
+
|
22 |
+
#TODO
|
23 |
+
#demo = gr.TabbedInterface([url_demo, voice_demo], ["Swedish YouTube Video to English Text", "Swedish Audio to English Text"])
|
24 |
+
|
25 |
+
|
26 |
+
demo.launch()
|