-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add targets arg to fill-mask pipeline #6239
Conversation
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.
I think that's a very cool feature! Maybe also print a warning if one of the tokens gets tokenized to an unknown token?
I think single input is okay for now. We should look at handling multi-input in the fill-mask
pipeline as a whole, so if you want to take a stab at that, please feel free to do so :).
Codecov Report
@@ Coverage Diff @@
## master #6239 +/- ##
==========================================
+ Coverage 79.61% 79.64% +0.03%
==========================================
Files 146 146
Lines 26597 26618 +21
==========================================
+ Hits 21175 21200 +25
+ Misses 5422 5418 -4
Continue to review full report at Codecov.
|
The fill-mask pipeline does, at least if we mean the same thing by "multi-input". It can take an arbitrarily long list of strings and return the top-k predictions for each. |
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.
Nice tests. Not sure whether this should be in a separate ScoreTargetsPipeline
that inherits from FillMaskPipeline
or some such. I don't have a strong opinion.
Awesome. @LysandreJik am I set to merge? |
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.
Great, LGTM
Proposal to add a
targets
arg when callingFillMaskPipeline
, allowing a user to compare different target tokens in addition to getting the top k predictions. This could be useful in a number of areas, such as in probing model behavior:This could also prove useful in the setting of using MLMs for cloze tasks and few/zero-shot prediction:
Notes: