[GenderBias] Add Controllable Gender Bias Task #3146
Conversation
Your PR contains a change to a task. Please paste the results of the following command into a comment: python tests/datatests/test_new_tasks.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Tiny nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing, thanks so much for adding this 😻
====================== | ||
Description: The task in this directory is not a task itself, but rather a wrapper. The task will flatten a specified other ParlAI task (that is, turn multi-turn episodes into single-turn examples), and append a control token that corresponds with the level of gender present in the label. If `--four-class` is specified as `True`, the control token will be one of the following: | ||
|
||
- `f0m0` - no gender words in the label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would note which word lists were used to generate these labels
type='bool', | ||
default=True, | ||
help='Use 4 class classification for gendered word list (f0m0/f0m1/f1m0/f1m1). ' | ||
'Set false to use 3-class classification (MALE/FEMALE/NEUTRAL)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we've never used m/f/n so maybe let's get rid of this option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do - in that case @EricMichaelSmith make sure to update #3144 to remove the --four-class
flag
Patch description
Adds the
genderation_bias:controllable_task
task, which, given an input task, flattens and classifies each label as having male, female, or neutral words, and subsequently adds a control token to indicate such.To use the teacher, simply run
parlai dd -t genderation_bias:controllable_task:<ORIGINAL_TASK>
, and the teacher takes care of the rest!Testing steps
Tested with
parlai dd
; I additionally included a test to ensure thatflatten_and_classify
, the core of the teacher, works well.Logs