Emily McMilin commited on
Commit
a1b7fc7
1 Parent(s): 20e63d7

rem job from date exmple. fix bug not masking capitalized pronouns.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -153,7 +153,7 @@ def get_gendered_token_ids():
153
 
154
  def prepare_text_for_masking(input_text, mask_token, gendered_tokens, split_key):
155
  text_w_masks_list = [
156
- mask_token if word in gendered_tokens else word for word in input_text.split()]
157
  num_masks = len([m for m in text_w_masks_list if m == mask_token])
158
 
159
  text_portions = ' '.join(text_w_masks_list).split(split_key)
@@ -307,7 +307,7 @@ date_example = [
307
  'DATE',
308
  "False",
309
  3,
310
- 'Born in DATE, she was a doctor.'
311
  ]
312
 
313
 
 
153
 
154
  def prepare_text_for_masking(input_text, mask_token, gendered_tokens, split_key):
155
  text_w_masks_list = [
156
+ mask_token if word.lower() in gendered_tokens else word for word in input_text.split()]
157
  num_masks = len([m for m in text_w_masks_list if m == mask_token])
158
 
159
  text_portions = ' '.join(text_w_masks_list).split(split_key)
 
307
  'DATE',
308
  "False",
309
  3,
310
+ 'She was born in DATE.'
311
  ]
312
 
313