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

brat serializer: allow using annotation ids from document metadata #172

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Jul 27, 2024

This PR adds the parameters metadata_gold_id_keys and metadata_prediction_id_keys to the BratSerializer:

  • metadata_gold_id_keys: A dictionary mapping layer names to metadata keys that contain the gold annotation IDs.
  • metadata_prediction_id_keys: A dictionary mapping layer names to metadata keys that contain the prediction annotation IDs.

Usage example:

+serializer.metadata_gold_id_keys.labeled_spans=entity_ids 

This will use the entries in entity_ids from the document metadata as IDs when serializing the gold annotations from the labeled_spans layer.

@ArneBinder ArneBinder merged commit 95d7fdd into main Jul 27, 2024
2 checks passed
@ArneBinder ArneBinder deleted the brat-serializer-use-ids-from-metadata branch July 27, 2024 19:08
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.

1 participant