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

add argument_type_whitelist parameter to RETextClassificationWithIndicesTaskModule #152

Merged
merged 7 commits into from
Feb 10, 2025

Conversation

RainbowRivey
Copy link
Collaborator

@RainbowRivey RainbowRivey commented Feb 3, 2025

Adds argument_type_whitelist: List[List[str]] parameter used by _add_candidate_relations().

This allows adding candidates only of pre-defined argument type pairs.
E.g. when argument_type_whitelist=[['ORG','PER']] only relations with head.label='ORG' and tail.label='PER' will be added.

TODO:

  • test in downstream setup (e.g. runs with 3 seeds at drugprot)
metric baseline with whitelist
quality (micro f1) 0.7597 (±0.0037) 0.7737 (±0.0042)
Inference time 83.56 13.5 (±0.3)

@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.51%. Comparing base (afcf7d4) to head (ac964bd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #152      +/-   ##
==========================================
+ Coverage   95.49%   95.51%   +0.01%     
==========================================
  Files          61       61              
  Lines        5195     5212      +17     
==========================================
+ Hits         4961     4978      +17     
  Misses        234      234              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Main code looks good, but please simplify the test.

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.

still hard to verify, see below

Add extra test to cover ValueError
Add assertions
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.

looks good, thanks!

@ArneBinder ArneBinder added the enhancement New feature or request label Feb 4, 2025
@ArneBinder ArneBinder changed the title add `argument_type_whitelist' parameter add argument_type_whitelist parameter Feb 4, 2025
@ArneBinder ArneBinder changed the title add argument_type_whitelist parameter add argument_type_whitelist parameter to RETextClassificationWithIndicesTaskModule Feb 4, 2025
@ArneBinder ArneBinder merged commit 65a225b into main Feb 10, 2025
2 checks passed
@ArneBinder ArneBinder deleted the add_candidate_relations_argument_type_whitelist branch February 10, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants