Spaces:
Runtime error
Runtime error
Commit
·
040c0c0
1
Parent(s):
ab2c9b6
Update app.py
Browse files
app.py
CHANGED
@@ -11,14 +11,14 @@ dataset_api = project.get_dataset_api()
|
|
11 |
dataset = load_dataset("torileatherman/sentiment_analysis_batch_predictions", split='train')
|
12 |
predictions_df = pd.DataFrame(dataset)
|
13 |
grouped_predictions = predictions_df.groupby(predictions_df.Sentiment)
|
14 |
-
positive_preds = grouped_predictions.get_group(2)
|
15 |
-
neutral_preds = grouped_predictions.get_group(1)
|
16 |
negative_preds = grouped_predictions.get_group(0)
|
17 |
|
18 |
|
19 |
def article_selection(sentiment):
|
20 |
if sentiment == "Positive":
|
21 |
-
predictions =
|
22 |
predictions_urls = predictions['Url'][0:3]
|
23 |
return predictions_urls
|
24 |
elif sentiment == "Negative":
|
@@ -26,7 +26,7 @@ def article_selection(sentiment):
|
|
26 |
predictions_urls = predictions['Url'][0:3]
|
27 |
return predictions_urls
|
28 |
else:
|
29 |
-
predictions =
|
30 |
predictions_urls = predictions['Url'][0:3]
|
31 |
return predictions_urls
|
32 |
|
|
|
11 |
dataset = load_dataset("torileatherman/sentiment_analysis_batch_predictions", split='train')
|
12 |
predictions_df = pd.DataFrame(dataset)
|
13 |
grouped_predictions = predictions_df.groupby(predictions_df.Sentiment)
|
14 |
+
#positive_preds = grouped_predictions.get_group(2)
|
15 |
+
#neutral_preds = grouped_predictions.get_group(1)
|
16 |
negative_preds = grouped_predictions.get_group(0)
|
17 |
|
18 |
|
19 |
def article_selection(sentiment):
|
20 |
if sentiment == "Positive":
|
21 |
+
predictions = negative_preds
|
22 |
predictions_urls = predictions['Url'][0:3]
|
23 |
return predictions_urls
|
24 |
elif sentiment == "Negative":
|
|
|
26 |
predictions_urls = predictions['Url'][0:3]
|
27 |
return predictions_urls
|
28 |
else:
|
29 |
+
predictions = negative_preds
|
30 |
predictions_urls = predictions['Url'][0:3]
|
31 |
return predictions_urls
|
32 |
|