emilylearning commited on
Commit
ce84560
1 Parent(s): 016995c

Default a fun building date example. Finally fix title!

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -263,7 +263,7 @@ def predict_gender_pronouns(
263
  )
264
 
265
 
266
- title = "Changing Gender Pronouns"
267
  description = """
268
  <h2> Intro </h2>
269
 
@@ -366,12 +366,12 @@ no_job_example = [
366
  'Born in DATE, she was a happy child. Her family raised her in a loving environment where she thrived.',
367
  ]
368
 
369
- building_date_example = [
370
- 30,
371
- ['birth_date'],
372
  [1.5],
373
- BERT_LIKE_MODELS,
374
- 'Built in DATE, her building provided the perfect environment for her job as a teacher.'
375
  ]
376
 
377
 
@@ -380,31 +380,31 @@ gr.Interface(
380
  fn=predict_gender_pronouns,
381
  inputs=[
382
  gr.inputs.Number(
383
- default=15,
384
  label="Number of points (years) plotted -- select fewer if slow.",
385
  ),
386
  gr.inputs.CheckboxGroup(
387
  CONDITIONING_VARIABLES,
388
- default=["none", "birth_date"],
389
  type="value",
390
  label="(1) Pick conditioning variable included in text during fine-tuning.",
391
  ),
392
  gr.inputs.CheckboxGroup(
393
  FEMALE_WEIGHTS,
394
- default=[5],
395
  type="value",
396
  label="(2) Pick loss function weight placed on female predictions during fine-tuning.",
397
  ),
398
  gr.inputs.CheckboxGroup(
399
  BERT_LIKE_MODELS,
400
- default=["bert"],
401
  type="value",
402
- label="(Optional) Pick bert-like base uncased model for comparison.",
403
  ),
404
  gr.inputs.Textbox(
405
  lines=7,
406
  label="Input Text: Include one or more instance of the word 'DATE' below (to be replaced with a range of `{dates}` in demo), and one or more gender pronoun (to be `[MASK]`ed for prediction).",
407
- default="Born in DATE, she was a computer scientist. Her work was greatly respected, and she was well-regarded in her field.",
408
  ),
409
  ],
410
  outputs=[
@@ -430,5 +430,5 @@ gr.Interface(
430
  title=title,
431
  description=description,
432
  article=article,
433
- examples=[ceo_example, death_date_example, no_job_example, building_date_example]
434
  ).launch()
 
263
  )
264
 
265
 
266
+ title = "Causing Gender Pronouns"
267
  description = """
268
  <h2> Intro </h2>
269
 
 
366
  'Born in DATE, she was a happy child. Her family raised her in a loving environment where she thrived.',
367
  ]
368
 
369
+ coder_example = [
370
+ 20,
371
+ ['none', 'birth_date'],
372
  [1.5],
373
+ ['bert'],
374
+ 'Born in DATE, she was a computer scientist. Her work was greatly respected, and she was well-regarded in her field.'
375
  ]
376
 
377
 
 
380
  fn=predict_gender_pronouns,
381
  inputs=[
382
  gr.inputs.Number(
383
+ default=20,
384
  label="Number of points (years) plotted -- select fewer if slow.",
385
  ),
386
  gr.inputs.CheckboxGroup(
387
  CONDITIONING_VARIABLES,
388
+ default=["birth_date"],
389
  type="value",
390
  label="(1) Pick conditioning variable included in text during fine-tuning.",
391
  ),
392
  gr.inputs.CheckboxGroup(
393
  FEMALE_WEIGHTS,
394
+ default=[1.5],
395
  type="value",
396
  label="(2) Pick loss function weight placed on female predictions during fine-tuning.",
397
  ),
398
  gr.inputs.CheckboxGroup(
399
  BERT_LIKE_MODELS,
400
+ default=BERT_LIKE_MODELS,
401
  type="value",
402
+ label="(Optional) Pick BERT-like base uncased model for comparison.",
403
  ),
404
  gr.inputs.Textbox(
405
  lines=7,
406
  label="Input Text: Include one or more instance of the word 'DATE' below (to be replaced with a range of `{dates}` in demo), and one or more gender pronoun (to be `[MASK]`ed for prediction).",
407
+ default="She always walked past the building built in DATE on her way to her job as an elementary school teacher.",
408
  ),
409
  ],
410
  outputs=[
 
430
  title=title,
431
  description=description,
432
  article=article,
433
+ examples=[ceo_example, death_date_example, no_job_example, coder_example]
434
  ).launch()