torileatherman commited on
Commit
92533eb
·
1 Parent(s): 5673b9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -25,19 +25,32 @@ def article_selection(sentiment):
25
  else:
26
  return f"""The sentence you requested is Neutral!"""
27
 
 
 
 
28
  description = '''
29
  This application recommends news articles depending on the sentiment of the headline.
30
  Enter your preference of what type of news articles you would like recommended to you today: Positive, Negative, or Neutral.
31
  '''
32
 
33
- demo = gr.Interface(
34
  fn=article_selection,
35
- title = 'Extractive News Summarizer BART',
36
  inputs = gr.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
37
  outputs = gr.Textbox(label="Recommended News Articles", lines=3),
38
  description = description,
39
  examples=predictions_df_urls)
40
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  #TODO
43
  #demo = gr.TabbedInterface([url_demo, voice_demo], ["Swedish YouTube Video to English Text", "Swedish Audio to English Text"])
 
25
  else:
26
  return f"""The sentence you requested is Neutral!"""
27
 
28
+ def thanks():
29
+ return "Thank you for making our model better!"
30
+
31
  description = '''
32
  This application recommends news articles depending on the sentiment of the headline.
33
  Enter your preference of what type of news articles you would like recommended to you today: Positive, Negative, or Neutral.
34
  '''
35
 
36
+ suggestion_demo = gr.Interface(
37
  fn=article_selection,
38
+ title = 'Recommending News Articles',
39
  inputs = gr.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
40
  outputs = gr.Textbox(label="Recommended News Articles", lines=3),
41
  description = description,
42
  examples=predictions_df_urls)
43
 
44
+ manual_label_demo = gr.Interface(
45
+ fn=thanks,
46
+ title="Manually Label a News Article",
47
+ [
48
+ gr.Textbox(label = "Paste in URL of news article here."),
49
+ gr.Dropdown(["Positive","Negative","Neutral"], label="Select the sentiment of the news article.")
50
+ ]
51
+ outputs = gr.Textbox()
52
+ )
53
+
54
 
55
  #TODO
56
  #demo = gr.TabbedInterface([url_demo, voice_demo], ["Swedish YouTube Video to English Text", "Swedish Audio to English Text"])