Skip to content

Commit

Permalink
improve docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder committed Oct 8, 2024
1 parent 0c70478 commit b36b27d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pytorch_ie/utils/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ def merge_annotations_from_documents(
metadata_key_source_annotations: Optional[str] = None,
metadata_key_source_predictions: Optional[str] = None,
) -> D:
"""Merge annotations from multiple documents into a single document. Note that this will remove
any annotation duplicates.
"""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.
Expand All @@ -98,8 +101,7 @@ def merge_annotations_from_documents(
for the predictions are stored.
Returns:
The merged document with the source names and annotation scores stored in the metadata at key
metadata_key, for each layer in the order of the predictions.
The document with merged annotations.
"""
if len(documents) == 0:
raise ValueError("No documents provided.")
Expand Down

0 comments on commit b36b27d

Please sign in to comment.