Spaces:
Runtime error
Runtime error
Commit
·
adec7fa
1
Parent(s):
8942d1e
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,27 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def article_selection(sentiment):
|
4 |
if sentiment == "Positive":
|
5 |
-
return f"""The sentence you requested is Positive!"""
|
6 |
elif sentiment == "Negative":
|
7 |
return f"""The sentence you requested is Negative!"""
|
8 |
else:
|
9 |
return f"""The sentence you requested is Neutral!"""
|
10 |
-
|
|
|
|
|
11 |
demo = gr.Interface(
|
12 |
fn=article_selection,
|
13 |
inputs = gr.inputs.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
|
14 |
-
outputs = [gr.outputs.
|
15 |
)
|
16 |
|
17 |
|
|
|
1 |
import gradio as gr
|
2 |
+
import hopsworks
|
3 |
+
|
4 |
+
project = hopsworks.login()
|
5 |
+
fs = project.get_feature_store()
|
6 |
+
|
7 |
+
dataset_api = project.get_dataset_api()
|
8 |
+
|
9 |
+
dataset_api.download("Resources/images/latest_passenger_prediction.png")
|
10 |
|
11 |
def article_selection(sentiment):
|
12 |
if sentiment == "Positive":
|
13 |
+
return gr.image('latest_passenger_prediction.png')#f"""The sentence you requested is Positive!"""
|
14 |
elif sentiment == "Negative":
|
15 |
return f"""The sentence you requested is Negative!"""
|
16 |
else:
|
17 |
return f"""The sentence you requested is Neutral!"""
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
demo = gr.Interface(
|
22 |
fn=article_selection,
|
23 |
inputs = gr.inputs.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
|
24 |
+
outputs = [gr.outputs.Image(label="Sentiment of News Articles")],
|
25 |
)
|
26 |
|
27 |
|