torileatherman commited on
Commit
c246e4e
1 Parent(s): a401c4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -3,6 +3,7 @@ from datasets import load_dataset, Dataset
3
  import pandas as pd
4
  from huggingface_hub import create_repo
5
  from huggingface_hub import login
 
6
 
7
  dataset = load_dataset("torileatherman/sentiment_analysis_batch_predictions", split='train')
8
  predictions_df = pd.DataFrame(dataset)
@@ -38,7 +39,8 @@ def article_selection(sentiment):
38
  def manual_label():
39
  # Selecting random row from batch data
40
  random_sample = predictions_df.sample()
41
- random_sample.to_csv('/Users/torileatherman/Github/ID2223_scalable_machine_learning/news_articles_sentiment/sample.csv', index=False)
 
42
  random_headline = random_sample['Headline_string'].iloc[0]
43
  random_prediction = random_sample['Prediction'].iloc[0]
44
  return random_headline, random_prediction
 
3
  import pandas as pd
4
  from huggingface_hub import create_repo
5
  from huggingface_hub import login
6
+ login(token='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')
7
 
8
  dataset = load_dataset("torileatherman/sentiment_analysis_batch_predictions", split='train')
9
  predictions_df = pd.DataFrame(dataset)
 
39
  def manual_label():
40
  # Selecting random row from batch data
41
  random_sample = predictions_df.sample()
42
+ #random_sample.to_csv('/Users/torileatherman/Github/ID2223_scalable_machine_learning/news_articles_sentiment/sample.csv', index=False)
43
+ random_sample.to_csv('torileatherman/sample')
44
  random_headline = random_sample['Headline_string'].iloc[0]
45
  random_prediction = random_sample['Prediction'].iloc[0]
46
  return random_headline, random_prediction