-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
GH-3509: fix support metric #3510
GH-3509: fix support metric #3510
Conversation
c415e43
to
09108c0
Compare
I'm not sure what the error occurring is, it doesn't seem to be related to my changes but maybe you are familiar with it |
09108c0
to
aecc875
Compare
Looks like the test passed without me changing anything, so this should be ready for review |
flair/nn/model.py
Outdated
@@ -737,7 +743,8 @@ def _encode_data_points(self, sentences: List[DT], data_points: List[DT2]): | |||
|
|||
return data_point_tensor | |||
|
|||
def _mask_scores(self, scores, data_points): | |||
def _mask_scores(self, scores: Tensor, data_points) -> Tensor: | |||
"""This appears to have not been fully implemented and simply returns scores.""" |
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.
In most models, scores are not masked, so the default implementation is to just return the scores. The SpanClassifier
overwrites this method to account for "candidate lists". Anything not on these lists, will be masked.
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, thanks for adding this! Just needs a tiny modification in one of the comment lines, as otherwise it would be misleading.
@MattGPT-ai thanks for fixing this! |
Addresses #3509
Also adds more type hinting and fixes mutable default arguments.