-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix missing pass of is_training to encode_input #108
Conversation
Do we also want to relax within this PR that the code does not fail if some entity, sentence or relation annotation layer is not available? Maybe just printing some warnings in these cases, e.g. "2 out of 200 documents have no relation annotations" in the case of RE or "5 of 200 documents have no sentence annotations, they will be discarded" when partition_annotation=sentences is used? EDIT: I think this may need some discussion and should be handled in a separate PR. Related issue: #109 |
@@ -505,8 +641,9 @@ def test_unbatch_output(prepared_taskmodule, model_output): | |||
|
|||
@pytest.mark.parametrize("inplace", [False, True]) | |||
def test_decode(prepared_taskmodule, documents, model_output, inplace): | |||
encodings = prepared_taskmodule.encode(documents, encode_target=False) | |||
encodings = prepared_taskmodule.encode(documents, encode_target=True) |
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.
Why did this change?
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.
Because otherwise we would need to change the remaining of this test since encode produces now 10 instead of 2 encodings when enocde_target=False (all combinations of entities). I know, it would be better to decouple the test and do not call encode here at all, but I had not yet the energy to define simple encodings manually (which then could be passed to decode, the actual method to test here).
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 the same holds for test_encode_target
. I created an issue for both cases: #110.
This was missed in #102.
EDIT: This rearranges the tested tokens in
test_encode_input
andtest_collate
to increase the readability of these tests.