Spaces:
Runtime error
Runtime error
Commit
·
fe08354
1
Parent(s):
a3d5133
Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,11 @@ predictions_df = pd.DataFrame(dataset)
|
|
13 |
predictions_df_url0 = predictions_df['Url'].iloc[0]
|
14 |
predictions_df_url1 = predictions_df['Url'].iloc[1]
|
15 |
predictions_df_url2 = predictions_df['Url'].iloc[2]
|
|
|
16 |
|
17 |
def article_selection(sentiment):
|
18 |
if sentiment == "Positive":
|
19 |
-
return
|
20 |
elif sentiment == "Negative":
|
21 |
return f"""The sentence you requested is Negative!"""
|
22 |
else:
|
@@ -27,7 +28,7 @@ def article_selection(sentiment):
|
|
27 |
demo = gr.Interface(
|
28 |
fn=article_selection,
|
29 |
inputs = gr.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
|
30 |
-
outputs =
|
31 |
)
|
32 |
|
33 |
|
|
|
13 |
predictions_df_url0 = predictions_df['Url'].iloc[0]
|
14 |
predictions_df_url1 = predictions_df['Url'].iloc[1]
|
15 |
predictions_df_url2 = predictions_df['Url'].iloc[2]
|
16 |
+
predictions_df_urls = [[predictions_df_url0],[predictions_df_url1],[predictions_df_url2]]
|
17 |
|
18 |
def article_selection(sentiment):
|
19 |
if sentiment == "Positive":
|
20 |
+
return predictions_df_urls #f"""The sentence you requested is Positive!"""
|
21 |
elif sentiment == "Negative":
|
22 |
return f"""The sentence you requested is Negative!"""
|
23 |
else:
|
|
|
28 |
demo = gr.Interface(
|
29 |
fn=article_selection,
|
30 |
inputs = gr.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
|
31 |
+
outputs = "Recommended News Articles",
|
32 |
)
|
33 |
|
34 |
|