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

implement merge_annotations_from_documents() #428

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Oct 8, 2024

This PR implements utils.document.merge_annotations_from_documents(). From the doscstring:

"""Merge annotations from multiple documents into a single document. Optionally, store the source
names for all annotations / predictions in the metadata at key metadata_key_source_annotations
/ metadata_key_source_predictions, respectively.

Note that this will remove any annotation duplicates.

Args:
    documents: A dictionary mapping document source (e.g. dataset names) to documents.
    metadata_key_source_annotations: If not None, the key in the metadata where the source names
        for the (gold) annotations are stored.
    metadata_key_source_predictions: If not None, the key in the metadata where the source names
        for the predictions are stored.

Returns:
    The document with merged annotations.
"""

Notes:

@ArneBinder ArneBinder added the enhancement New feature or request label Oct 8, 2024
@ArneBinder ArneBinder force-pushed the merge_annotations_from_documents branch from ac0d7df to b36b27d Compare October 8, 2024 03:18
@ArneBinder ArneBinder force-pushed the merge_annotations_from_documents branch from b36b27d to 866eb80 Compare October 8, 2024 03:34
@ArneBinder ArneBinder merged commit 829abff into main Oct 8, 2024
6 checks passed
@ArneBinder ArneBinder deleted the merge_annotations_from_documents branch October 8, 2024 04:02
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.

1 participant