JRQi commited on
Commit
08a437b
1 Parent(s): 4ba4a77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -131,15 +131,16 @@ Choose one of the three tasks below ... and start to play!
131
  # gr.Markdown(''' <h2 style="text-align: center;"> or </h2> ''')
132
  sample_button_nl = gr.Button("Click to get a review in Dutch.", size='sm')
133
 
134
- h1 = gr.HighlightedText(label="Review/Recensie:", interactive=True, show_legend=True, combine_adjacent=False, color_map={"+": "red", "-": "green"})
135
 
136
- # input_text = gr.Textbox(label="Review/Recensie:", value="HELLO! Hallo!", visible=False, container=False)
137
- # interpretation1 = gr.components.Interpretation(input_text)
138
 
139
  # image_1_1 = gr.Image('icon_user.png', height=80, width=80, min_width=80, show_label=False, show_share_button=False, interactive=False)
140
  slider_1_1 = gr.Slider(label="Human: Dislike ——> Like", container=True, min_width=200, height=80, show_label=True, interactive=True)
141
  # checkbox_1 = gr.CheckboxGroup(label="Which words are the guesses based on?", interactive=True)
142
-
 
143
  gr.Markdown(
144
  ''' ## Like or Dislike
145
  You're given a short review of a movie, book or restaurant.
@@ -172,8 +173,7 @@ Choose one of the three tasks below ... and start to play!
172
  chat_button_1 = gr.Button("Click to see AI's answer.", size='sm')
173
  slider_1_2 = gr.Slider(label="AI: Dislike ——> Like", container=True, min_width=200, height=80, show_label=True, interactive=True)
174
  interpre_button = gr.Button("See how AI gets the answer.", size='sm')
175
- h2 = gr.HighlightedText(label="Review/Recensie:", interactive=True, show_legend=True, combine_adjacent=False, color_map={"+": "red", "-": "green"})
176
-
177
  placeholder_text = gr.Textbox(label="Review/Recensie:", value="HELLO! Hallo!", visible=False)
178
  interpretation2 = gr.components.Interpretation(placeholder_text)
179
  # image_1_2 = gr.Image('icon_robot.png', height=80, width=80, min_width=80, show_label=False, show_share_button=False, interactive=False)
@@ -204,10 +204,10 @@ Choose one of the three tasks below ... and start to play!
204
  # chat_button_1.click(func1, inputs=[lang_selected, num_selected, slider_1_1, num1, num2, checkbox_1], outputs=[slider_1_2, chatbot1, num1, num2, tot_scores, plot])
205
  # interpre_button.click(interpre1, inputs=[lang_selected, num_selected], outputs=[interpretation2])
206
 
207
- sample_button_en.click(read1, inputs=[text_en], outputs=[h1, lang_selected, num_selected, h2, slider_1_1, slider_1_2, chatbot1])
208
- sample_button_nl.click(read1, inputs=[text_nl], outputs=[h1, lang_selected, num_selected, h2, slider_1_1, slider_1_2, chatbot1])
209
- chat_button_1.click(func1, inputs=[lang_selected, num_selected, slider_1_1, num1, num2, h1], outputs=[slider_1_2, chatbot1, num1, num2, tot_scores, plot])
210
- interpre_button.click(interpre1, inputs=[lang_selected, num_selected], outputs=[h2])
211
 
212
  # sample_button_en_written.click(read1_written, inputs=[text_en], outputs=[text_written])
213
  # sample_button_nl_written.click(read1_written, inputs=[text_nl], outputs=[text_written])
 
131
  # gr.Markdown(''' <h2 style="text-align: center;"> or </h2> ''')
132
  sample_button_nl = gr.Button("Click to get a review in Dutch.", size='sm')
133
 
134
+ # h1 = gr.HighlightedText(label="Review/Recensie:", interactive=True, show_legend=True, combine_adjacent=False, color_map={"+": "red", "-": "green"})
135
 
136
+ input_text = gr.Textbox(label="Review/Recensie:", value="HELLO! Hallo!", visible=False, container=False)
137
+ interpretation1 = gr.components.Interpretation(input_text)
138
 
139
  # image_1_1 = gr.Image('icon_user.png', height=80, width=80, min_width=80, show_label=False, show_share_button=False, interactive=False)
140
  slider_1_1 = gr.Slider(label="Human: Dislike ——> Like", container=True, min_width=200, height=80, show_label=True, interactive=True)
141
  # checkbox_1 = gr.CheckboxGroup(label="Which words are the guesses based on?", interactive=True)
142
+ user_important = gr.Textbox(label="Which words are the guesses based on?")
143
+
144
  gr.Markdown(
145
  ''' ## Like or Dislike
146
  You're given a short review of a movie, book or restaurant.
 
173
  chat_button_1 = gr.Button("Click to see AI's answer.", size='sm')
174
  slider_1_2 = gr.Slider(label="AI: Dislike ——> Like", container=True, min_width=200, height=80, show_label=True, interactive=True)
175
  interpre_button = gr.Button("See how AI gets the answer.", size='sm')
176
+ # h2 = gr.HighlightedText(label="Review/Recensie:", interactive=True, show_legend=True, combine_adjacent=False, color_map={"+": "red", "-": "green"})
 
177
  placeholder_text = gr.Textbox(label="Review/Recensie:", value="HELLO! Hallo!", visible=False)
178
  interpretation2 = gr.components.Interpretation(placeholder_text)
179
  # image_1_2 = gr.Image('icon_robot.png', height=80, width=80, min_width=80, show_label=False, show_share_button=False, interactive=False)
 
204
  # chat_button_1.click(func1, inputs=[lang_selected, num_selected, slider_1_1, num1, num2, checkbox_1], outputs=[slider_1_2, chatbot1, num1, num2, tot_scores, plot])
205
  # interpre_button.click(interpre1, inputs=[lang_selected, num_selected], outputs=[interpretation2])
206
 
207
+ sample_button_en.click(read1, inputs=[text_en], outputs=[interpretation1, lang_selected, num_selected, interpretation2, slider_1_1, slider_1_2, chatbot1])
208
+ sample_button_nl.click(read1, inputs=[text_nl], outputs=[interpretation1, lang_selected, num_selected, interpretation2, slider_1_1, slider_1_2, chatbot1])
209
+ chat_button_1.click(func1, inputs=[lang_selected, num_selected, slider_1_1, num1, num2, interpretation1], outputs=[slider_1_2, chatbot1, num1, num2, tot_scores, plot])
210
+ interpre_button.click(interpre1, inputs=[lang_selected, num_selected], outputs=[interpretation2])
211
 
212
  # sample_button_en_written.click(read1_written, inputs=[text_en], outputs=[text_written])
213
  # sample_button_nl_written.click(read1_written, inputs=[text_nl], outputs=[text_written])