torileatherman commited on
Commit
7f33b70
1 Parent(s): a784a26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,6 +1,8 @@
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()
@@ -9,10 +11,12 @@ dataset_api = project.get_dataset_api()
9
 
10
  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:
 
1
  import gradio as gr
2
  import hopsworks
3
  from datasets import load_dataset
4
+ import numpy as np
5
+ import pandas as pd
6
 
7
  project = hopsworks.login()
8
  fs = project.get_feature_store()
 
11
 
12
  dataset_api.download("Resources/batch_data_predictions.csv")
13
  dataset = load_dataset("csv", data_files="batch_data_predictions.csv")
14
+ predictions_df = pd.DataFrame(dataset,columns=['Headlines', 'URL','Predictions'],)
15
+ predictions_df_url = predictions_df['URL']
16
 
17
  def article_selection(sentiment):
18
  if sentiment == "Positive":
19
+ return predictions_df_url #f"""The sentence you requested is Positive!"""
20
  #elif sentiment == "Negative":
21
  # return f"""The sentence you requested is Negative!"""
22
  #else: