JRQi commited on
Commit
f197299
1 Parent(s): deb8c69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -9
app.py CHANGED
@@ -73,13 +73,6 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
73
  with gr.Column(scale=1):
74
  logo = gr.Image('logo.png', height=230, width=600, min_width=80, show_label=False, show_share_button=False, interactive=False, container=False)
75
 
76
- gr.Markdown(
77
- ''' ## Today's Scores
78
- '''
79
- )
80
- tot_scores = gr.Markdown(
81
- ''' ### <p style="text-align: center;"> Machine &ensp; ''' + str(int(0)) + ''' &ensp; VS &ensp; ''' + str(int(0)) + ''' &ensp; Human </p>'''
82
- )
83
 
84
  with gr.Tab("Like or Dislike"):
85
  text_en = gr.Textbox(label="", value="en", visible=False)
@@ -102,6 +95,13 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
102
  user_important = gr.Textbox(label="Which words are your guesses based on?", placeholder="Enter words that you think are important for the task")
103
 
104
  with gr.Column(scale=1):
 
 
 
 
 
 
 
105
  gr.Markdown(
106
  ''' ## Like or Dislike
107
  You're given a short review of a movie, book or restaurant.
@@ -148,7 +148,7 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
148
  sample_button_en.click(read1, inputs=[text_en, num_selected_1], outputs=[interpretation1, lang_selected, num_selected_1])
149
  sample_button_nl.click(read1, inputs=[text_nl, num_selected_1], outputs=[interpretation1, lang_selected, num_selected_1])
150
  num_selected_1.change(reset_modules, outputs=[interpretation2, slider_1_1, slider_1_2, chatbot1, user_important])
151
- chat_button_1.click(func1, inputs=[lang_selected, num_selected_1, slider_1_1, num1, num2, user_important], outputs=[slider_1_2, chatbot1, num1, num2, tot_scores])
152
  interpre_button.click(interpre1, inputs=[lang_selected, num_selected_1], outputs=[interpretation2])
153
 
154
  chat_button_2.click(func1_written, inputs=[text_written, slider_1_3, lang_written], outputs=[interpretation4, slider_1_4, chatbot2])
@@ -173,6 +173,13 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
173
  slider_3_1 = gr.Slider(label="Human: Male ——> Female", container=True, min_width=200, height=80, show_label=True, interactive=True)
174
  user_important_mf = gr.Textbox(label="Which words are your guesses based on?", placeholder="Enter words that you think are important for the task")
175
  with gr.Column(scale=1):
 
 
 
 
 
 
 
176
  gr.Markdown(
177
  ''' ## Male or Female
178
 
@@ -217,7 +224,7 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
217
 
218
  sample_button_en_3.click(read3, inputs=[num_selected_3], outputs=[interpretation_mf_1, num_selected_3])
219
  num_selected_3.change(reset_modules, outputs=[interpretation_mf_2, slider_3_1, slider_3_2, chatbot_mf_1, user_important_mf])
220
- chat_button_mf.click(func3, inputs=[num_selected_3, slider_3_1, num1, num2, user_important_mf], outputs=[slider_3_2, chatbot_mf_1, num1, num2, tot_scores])
221
  interpre_button_mf.click(interpre3, inputs=[num_selected_3], outputs=[interpretation_mf_2])
222
 
223
  chat_button_mf_2.click(func3_written, inputs=[text_written_mf, slider_3_3], outputs=[interpretation_mf_4, slider_3_4, chatbot_mf_2])
 
73
  with gr.Column(scale=1):
74
  logo = gr.Image('logo.png', height=230, width=600, min_width=80, show_label=False, show_share_button=False, interactive=False, container=False)
75
 
 
 
 
 
 
 
 
76
 
77
  with gr.Tab("Like or Dislike"):
78
  text_en = gr.Textbox(label="", value="en", visible=False)
 
95
  user_important = gr.Textbox(label="Which words are your guesses based on?", placeholder="Enter words that you think are important for the task")
96
 
97
  with gr.Column(scale=1):
98
+ gr.Markdown(
99
+ ''' ## Today's Scores
100
+ '''
101
+ )
102
+ tot_scores_1 = gr.Markdown(
103
+ ''' ### <p style="text-align: center;"> Machine &ensp; ''' + str(int(0)) + ''' &ensp; VS &ensp; ''' + str(int(0)) + ''' &ensp; Human </p>'''
104
+ )
105
  gr.Markdown(
106
  ''' ## Like or Dislike
107
  You're given a short review of a movie, book or restaurant.
 
148
  sample_button_en.click(read1, inputs=[text_en, num_selected_1], outputs=[interpretation1, lang_selected, num_selected_1])
149
  sample_button_nl.click(read1, inputs=[text_nl, num_selected_1], outputs=[interpretation1, lang_selected, num_selected_1])
150
  num_selected_1.change(reset_modules, outputs=[interpretation2, slider_1_1, slider_1_2, chatbot1, user_important])
151
+ chat_button_1.click(func1, inputs=[lang_selected, num_selected_1, slider_1_1, num1, num2, user_important], outputs=[slider_1_2, chatbot1, num1, num2, tot_scores_1])
152
  interpre_button.click(interpre1, inputs=[lang_selected, num_selected_1], outputs=[interpretation2])
153
 
154
  chat_button_2.click(func1_written, inputs=[text_written, slider_1_3, lang_written], outputs=[interpretation4, slider_1_4, chatbot2])
 
173
  slider_3_1 = gr.Slider(label="Human: Male ——> Female", container=True, min_width=200, height=80, show_label=True, interactive=True)
174
  user_important_mf = gr.Textbox(label="Which words are your guesses based on?", placeholder="Enter words that you think are important for the task")
175
  with gr.Column(scale=1):
176
+ gr.Markdown(
177
+ ''' ## Today's Scores
178
+ '''
179
+ )
180
+ tot_scores_2 = gr.Markdown(
181
+ ''' ### <p style="text-align: center;"> Machine &ensp; ''' + str(int(0)) + ''' &ensp; VS &ensp; ''' + str(int(0)) + ''' &ensp; Human </p>'''
182
+ )
183
  gr.Markdown(
184
  ''' ## Male or Female
185
 
 
224
 
225
  sample_button_en_3.click(read3, inputs=[num_selected_3], outputs=[interpretation_mf_1, num_selected_3])
226
  num_selected_3.change(reset_modules, outputs=[interpretation_mf_2, slider_3_1, slider_3_2, chatbot_mf_1, user_important_mf])
227
+ chat_button_mf.click(func3, inputs=[num_selected_3, slider_3_1, num1, num2, user_important_mf], outputs=[slider_3_2, chatbot_mf_1, num1, num2, tot_scores_2])
228
  interpre_button_mf.click(interpre3, inputs=[num_selected_3], outputs=[interpretation_mf_2])
229
 
230
  chat_button_mf_2.click(func3_written, inputs=[text_written_mf, slider_3_3], outputs=[interpretation_mf_4, slider_3_4, chatbot_mf_2])