Skip to content

Commit

Permalink
use deduplicate_annotations() in F1 metric and statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder committed Nov 13, 2024
1 parent 57bb343 commit b0c20a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pytorch_ie/core/statistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def _collect(self, doc: Document) -> Any:
"""Collect any values from a document."""

def _update(self, document: Document) -> None:
document = document.deduplicate_annotations()
values = self._collect(document)
self._values.append(values)

Expand Down
1 change: 1 addition & 0 deletions src/pytorch_ie/metrics/f1.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def add_counts(self, counts: Tuple[int, int, int], label: str):
)

def _update(self, document: Document):
document = document.deduplicate_annotations()
new_counts = self.calculate_counts(
document=document,
annotation_filter=(
Expand Down

0 comments on commit b0c20a8

Please sign in to comment.