torileatherman commited on
Commit
fd7e6d1
·
1 Parent(s): 97d7a04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -15,7 +15,7 @@ negative_preds = grouped_predictions.get_group(0)
15
  predictions_df['Prediction'] = predictions_df['Prediction'].map({0: 'Negative', 1: 'Neutral', 2: 'Positive'})
16
 
17
  # Load training data set
18
- dataset = load_dataset("eengel7/sentiment_analysis_training", split='train')
19
  training_df = pd.DataFrame(dataset)
20
  random_sample = {}
21
 
@@ -63,7 +63,7 @@ def thanks(sentiment):
63
  # Upload training data set
64
  ds = Dataset.from_pandas(training_df)
65
  try:
66
- ds.push_to_hub("eengel7/sentiment_analysis_training")
67
  except StopIteration:
68
  pass
69
 
@@ -96,15 +96,6 @@ with gr.Blocks() as manual_label_demo:
96
  submit_btn = gr.Button('Submit your sentiment!')
97
  submit_btn.click(fn=thanks, inputs=drop_down_label, outputs=gr.Textbox())
98
 
99
- manual_label_demo1 = gr.Interface(
100
- fn=thanks,
101
- title="Manually Label a News Article",
102
- inputs=[gr.Textbox(label = "Paste in URL of news article here."),
103
- gr.Dropdown(["Positive","Negative","Neutral"], label="Select the sentiment of the news article.")],
104
- outputs = gr.Textbox(label="Output"),
105
- description = description2
106
- )
107
-
108
 
109
  demo = gr.TabbedInterface([suggestion_demo, manual_label_demo], ["Get recommended news articles", "Help improve our model"])
110
 
 
15
  predictions_df['Prediction'] = predictions_df['Prediction'].map({0: 'Negative', 1: 'Neutral', 2: 'Positive'})
16
 
17
  # Load training data set
18
+ dataset = load_dataset("torileatherman/sentiment_analysis_training", split='train')
19
  training_df = pd.DataFrame(dataset)
20
  random_sample = {}
21
 
 
63
  # Upload training data set
64
  ds = Dataset.from_pandas(training_df)
65
  try:
66
+ ds.push_to_hub("torileatherman/sentiment_analysis_training")
67
  except StopIteration:
68
  pass
69
 
 
96
  submit_btn = gr.Button('Submit your sentiment!')
97
  submit_btn.click(fn=thanks, inputs=drop_down_label, outputs=gr.Textbox())
98
 
 
 
 
 
 
 
 
 
 
99
 
100
  demo = gr.TabbedInterface([suggestion_demo, manual_label_demo], ["Get recommended news articles", "Help improve our model"])
101