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

enforce_same_original_doc_id parameter & improved text pair metadata #121

Merged
merged 7 commits into from
Sep 20, 2024

Conversation

ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Sep 19, 2024

This changes construct_text_pair_coref_documents_from_partitions_via_relations() to add the following to metadata:

  • original_doc_id: doc id of the original document where the text is from
  • original_doc_id_pair: doc id of the original document where the text_pair is from
  • original_doc_span: a dict with start and end keys indicating where the text is from with respect to the original doc
  • original_doc_span_pair: a dict with start and end keys indicating where the text_pair is from with respect to the original doc

Also, this gets correctly propagated inadd_negative_coref_relations(), when available.

Finally, this adds the parameter enforce_same_original_doc_id to add_negative_coref_relations(). If enabled, only negatives where both text and text_pair are from the same original document, get created.

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.73%. Comparing base (a307df8) to head (2997307).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/pie_modules/document/processing/text_pair.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #121      +/-   ##
==========================================
- Coverage   95.76%   95.73%   -0.03%     
==========================================
  Files          61       61              
  Lines        5048     5061      +13     
==========================================
+ Hits         4834     4845      +11     
- Misses        214      216       +2     

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

@ArneBinder ArneBinder changed the title Text pair metadata enforce_same_original_doc_id parameter & improved text pair metadata Sep 20, 2024
@ArneBinder ArneBinder merged commit 69ff92d into main Sep 20, 2024
2 checks passed
@ArneBinder ArneBinder deleted the text_pair_metadata branch September 20, 2024 10:16
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