diff --git a/deidentification/deidentification.py b/deidentification/deidentification.py index 6087225..d67dd19 100644 --- a/deidentification/deidentification.py +++ b/deidentification/deidentification.py @@ -125,6 +125,7 @@ def deidentify(self, text: str) -> str: if self.config.debug: self.__debug_log(f"deidentify(): first iter, persons={len(self.all_persons)}") self._find_all_pronouns() + self.aggregate_pronouns.extend(self.all_pronouns) if self.config.debug: self.__print_entities_table(self.all_persons) @@ -142,7 +143,6 @@ def deidentify(self, text: str) -> str: self.__debug_log(f"deidentify(): next iter, persons={len(self.all_persons)}") if persons_count == 0: break - self.aggregate_pronouns.extend(self.all_pronouns) self.all_pronouns = [] merged = self._merge_metadata() replaced_text = self._replace_merged(replaced_text, merged)