Skip to content

Commit

Permalink
Fix the entity creation in global_matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknovak committed Jul 23, 2024
1 parent 4b11866 commit 37efe07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions anonipy/anonymize/extractors/pattern_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def global_matchers(doc: Doc) -> None:
# define the entity span
start, end = match.span(1)
entity = doc.char_span(start, end, label=label["label"])
if not entity:
continue
entity._.score = 1.0
# add the entity to the previous entity list
prev_entities = self._get_doc_entity_spans(doc)
Expand Down

0 comments on commit 37efe07

Please sign in to comment.