Skip to content
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

Unittests for TransformerSpanClassificationModel #38

Merged
merged 2 commits into from
Jan 23, 2022
Merged

Conversation

ChristophAlt
Copy link
Collaborator

No description provided.

Copy link
Owner

@ArneBinder ArneBinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks quite good, as far as I understand it.

Just one thing: does this also sufficiently test the functionality of _start_end_and_span_length_span_index? I do not really get, what's happening there, so this might be already covered. Or could you maybe add a small comment to that function describing what it does?

@ChristophAlt
Copy link
Collaborator Author

ChristophAlt commented Jan 23, 2022

This looks quite good, as far as I understand it.

Just one thing: does this also sufficiently test the functionality of _start_end_and_span_length_span_index? I do not really get, what's happening there, so this might be already covered. Or could you maybe add a small comment to that function describing what it does?

Right now it does not directly test the functionality of _start_end_and_span_length_span_index. I'll add another test case for this. The function basically enumerates all spans up to a length of L for a batch of inputs and returns the start and end offset for each span, the length of the span (because we add a length embedding to each span), and the batch index (the item in the batch each span belongs to) because the span indices must be flattened (as each batch item, e.g. a sentence, has different length and thus a different number of spans).

@ArneBinder
Copy link
Owner

OK, thanks a lot for the explanation :)

@ChristophAlt ChristophAlt merged commit ab4d506 into main Jan 23, 2022
ArneBinder pushed a commit that referenced this pull request Jan 24, 2022
* Unittests for TransformerSpanClassificationModel

* Unittest for start_end_and_span_length_span_index
@ChristophAlt ChristophAlt deleted the test_models branch March 4, 2022 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants