Spaces:
Runtime error
Runtime error
torileatherman
commited on
Commit
•
7485bd9
1
Parent(s):
6311754
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,18 @@
|
|
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/
|
|
|
10 |
|
11 |
def article_selection(sentiment):
|
12 |
if sentiment == "Positive":
|
13 |
-
return
|
14 |
#elif sentiment == "Negative":
|
15 |
# return f"""The sentence you requested is Negative!"""
|
16 |
#else:
|
@@ -21,7 +23,7 @@ def article_selection(sentiment):
|
|
21 |
demo = gr.Interface(
|
22 |
fn=article_selection,
|
23 |
inputs = gr.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
|
24 |
-
outputs = [gr.
|
25 |
)
|
26 |
|
27 |
|
|
|
1 |
import gradio as gr
|
2 |
import hopsworks
|
3 |
+
from datasets import load_dataset
|
4 |
|
5 |
project = hopsworks.login()
|
6 |
fs = project.get_feature_store()
|
7 |
|
8 |
dataset_api = project.get_dataset_api()
|
9 |
|
10 |
+
batch_data_predictions.csv = dataset_api.download("Resources/batch_data_predictions.csv")
|
11 |
+
dataset = load_dataset("csv", data_files="batch_data_predictions.csv")
|
12 |
|
13 |
def article_selection(sentiment):
|
14 |
if sentiment == "Positive":
|
15 |
+
return dataset #f"""The sentence you requested is Positive!"""
|
16 |
#elif sentiment == "Negative":
|
17 |
# return f"""The sentence you requested is Negative!"""
|
18 |
#else:
|
|
|
23 |
demo = gr.Interface(
|
24 |
fn=article_selection,
|
25 |
inputs = gr.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
|
26 |
+
outputs = [gr.Textbox(label="Sentiment of News Articles")],
|
27 |
)
|
28 |
|
29 |
|