liujch1998 commited on
Commit
7916def
β€’
1 Parent(s): b57bf75
Files changed (1) hide show
  1. app.py +15 -8
app.py CHANGED
@@ -167,11 +167,11 @@ def predict(statements, do_saves):
167
  [gr.update(value='Please provide your feedback before trying out another statement.') for _ in statements]
168
 
169
  def record_feedback(output_raws, feedback, do_saves):
170
- print('Logged feedbacks to dataset:')
171
  for output_raw, do_save in zip(output_raws, do_saves):
172
  if do_save:
173
- print(output_raw)
174
  output_raw.update({ 'feedback': feedback })
 
175
  with open(DATA_PATH, 'a') as f:
176
  json.dump(output_raw, f, ensure_ascii=False)
177
  f.write('\n')
@@ -189,9 +189,9 @@ def record_feedback_disagree(output_raws, do_saves):
189
  return record_feedback(output_raws, 'disagree', do_saves)
190
 
191
  examples = [
192
- # openbookqa
193
- 'If a person walks in the opposite direction of a compass arrow they are walking south.',
194
- 'If a person walks in the opposite direction of a compass arrow they are walking north.',
195
  # arc_easy
196
  'A pond is different from a lake because ponds are smaller and shallower.',
197
  'A pond is different from a lake because ponds have moving water.',
@@ -271,8 +271,15 @@ with gr.Blocks() as demo:
271
  gr.Markdown(
272
  '''# Vera
273
 
274
- This is a demo for Vera, a commonsense statement verification model. Under development.
275
- ⚠️ Data Collection: by default, we are collecting the inputs entered in this app to further improve and evaluate the model. Do not share any personal or sensitive information while using the app!
 
 
 
 
 
 
 
276
  '''
277
  )
278
  with gr.Row():
@@ -280,7 +287,7 @@ with gr.Blocks() as demo:
280
  do_save = gr.Checkbox(
281
  value=True,
282
  label="Store data",
283
- info="You agree to the storage of your input data for research and development purposes:")
284
  statement = gr.Textbox(placeholder='Enter a commonsense statement here, or select an example from below', label='Statement', interactive=True)
285
  submit = gr.Button(value='Submit', variant='primary', visible=True)
286
  with gr.Column(scale=1):
 
167
  [gr.update(value='Please provide your feedback before trying out another statement.') for _ in statements]
168
 
169
  def record_feedback(output_raws, feedback, do_saves):
170
+ print('Logging feedbacks to dataset:')
171
  for output_raw, do_save in zip(output_raws, do_saves):
172
  if do_save:
 
173
  output_raw.update({ 'feedback': feedback })
174
+ print(output_raw)
175
  with open(DATA_PATH, 'a') as f:
176
  json.dump(output_raw, f, ensure_ascii=False)
177
  f.write('\n')
 
189
  return record_feedback(output_raws, 'disagree', do_saves)
190
 
191
  examples = [
192
+ # # openbookqa
193
+ # 'If a person walks in the opposite direction of a compass arrow they are walking south.',
194
+ # 'If a person walks in the opposite direction of a compass arrow they are walking north.',
195
  # arc_easy
196
  'A pond is different from a lake because ponds are smaller and shallower.',
197
  'A pond is different from a lake because ponds have moving water.',
 
271
  gr.Markdown(
272
  '''# Vera
273
 
274
+ Vera is a commonsense statement verification model. Under development.
275
+
276
+ Type a commonsense statement in the box below and click the submit button to see Vera's prediction on its correctness. You can try both correct and incorrect statements. If you are looking for inspiration, try the examples at the bottom of the page!
277
+
278
+ We ask you to share your feedback on Vera's prediction. Please indicate whether you agree or disagree with the predicted label (and don't mind the percentage numbers).
279
+
280
+ ⚠️ **Intended Use**: Vera is a research prototype and may make mistakes. Do not use for making critical decisions. It is intended to predict the correctness of commonsense statements, and may be unreliable when taking input out of this scope.
281
+
282
+ ⚠️ **Data Collection**: by default, we are collecting the inputs entered in this app to further improve and evaluate the model. Do not share any personal or sensitive information while using the app! You can opt out of this data collection by removing the checkbox below:
283
  '''
284
  )
285
  with gr.Row():
 
287
  do_save = gr.Checkbox(
288
  value=True,
289
  label="Store data",
290
+ info="You agree to the storage of your input for research and development purposes:")
291
  statement = gr.Textbox(placeholder='Enter a commonsense statement here, or select an example from below', label='Statement', interactive=True)
292
  submit = gr.Button(value='Submit', variant='primary', visible=True)
293
  with gr.Column(scale=1):