pyprocessors-coreference 1.6.18__tar.gz → 1.6.22__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/PKG-INFO +5 -5
  2. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/README.md +4 -4
  3. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/docs/sherpa/coreference.en.md +8 -8
  4. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/docs/sherpa/coreference.fr.md +8 -8
  5. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/src/pyprocessors_coreference/__init__.py +1 -1
  6. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/src/pyprocessors_coreference/coreference.py +25 -29
  7. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/.claude/settings.json +0 -0
  8. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/.gitignore +0 -0
  9. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/.gitmodules +0 -0
  10. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/.python-version +0 -0
  11. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/LICENSE +0 -0
  12. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/docs/adr/0001-linking-candidats-entityfishing-decision-jev.md +0 -0
  13. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/pyproject.toml +0 -0
  14. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/.claude-plugin/marketplace.json +0 -0
  15. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/.claude-plugin/plugin.json +0 -0
  16. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/HOWTO.md +0 -0
  17. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/README.md +0 -0
  18. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/resources/Stages.yml +0 -0
  19. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/resources/help/help_examples.py +0 -0
  20. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/resources/help/plugin-help.py +0 -0
  21. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/resources/help/template.en.md +0 -0
  22. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/resources/help/template.fr.md +0 -0
  23. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/new-plugin/SKILL.md +0 -0
  24. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/new-plugin/references/annotator.md +0 -0
  25. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/new-plugin/references/converter.md +0 -0
  26. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/new-plugin/references/formatter.md +0 -0
  27. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/new-plugin/references/importer.md +0 -0
  28. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/new-plugin/references/processor.md +0 -0
  29. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/new-plugin/references/segmenter.md +0 -0
  30. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/new-plugin/references/types.md +0 -0
  31. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/skills/plugin-help/SKILL.md +0 -0
  32. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/tools/check-marketplace.py +0 -0
  33. {pyprocessors_coreference-1.6.18 → pyprocessors_coreference-1.6.22}/submodules/python-archetype/vars/pythonPipeline.groovy +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pyprocessors-coreference
3
- Version: 1.6.18
3
+ Version: 1.6.22
4
4
  Summary: Processor grouping the mentions of the same entity
5
5
  Project-URL: Homepage, https://bitbucket.org/kairntech/pyprocessors_coreference
6
6
  Author-email: Olivier Terrier <olivier.terrier@kairntech.com>
@@ -58,8 +58,8 @@ Pour chaque document, entre mentions de même famille de labels :
58
58
  - **un label dont le nom finit par un autre label regroupé est de sa famille** : le
59
59
  `location` du NER et l'`afplocation` des lexiques AFP annotent le même span, et vont
60
60
  dans le même groupe (de même `organization` et `afporganization`) ;
61
- - **tous les labels de personne forment une seule famille** (`person`, `afpperson`, ou
62
- ceux de `person_labels`) ;
61
+ - **tous les labels de personne forment une seule famille** : ceux de la famille
62
+ `person_family` (`person`, `afpperson`, ou `PER` déclaré dans `label_families`) ;
63
63
  - **un nom partiel de personne rejoint le nom complet dont il est la fin**, que le
64
64
  nom complet soit avant ou après lui dans le document : « Macron » et « M. Macron »
65
65
  rejoignent « Emmanuel Macron » ;
@@ -118,8 +118,8 @@ document = Document(
118
118
  | Paramètre | Défaut | Description |
119
119
  |-----------|--------|-------------|
120
120
  | `labels` | vide | Labels des mentions à regrouper. Vide : tous les labels. |
121
- | `person_labels` | vide | Labels de personne : ils forment une seule famille, et la règle du nom partiel s'y applique. Vide : tout label dont le nom contient « person » (`person`, `afpperson`…). |
122
- | `label_families` | vide | Familles de labels regroupés comme un seul, une famille par ligne, ses labels séparés par des virgules (`organization,afporganization,loc_org`). Un label non déclaré rejoint la famille du label le plus court qui termine son nom. |
121
+ | `label_families` | vide | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`) ou un nom libre (`loc_org` → `1`, `organization` → `1`). Un label non déclaré rejoint la famille du label le plus court qui termine son nom. |
122
+ | `person_family` | `person` | Famille des noms de personne : ses labels forment un seul groupe, et la règle du nom partiel s'y applique. Un label d'un autre nom la rejoint par `label_families` (`PER` → `person`). |
123
123
  | `honorifics` | `M.`, `Mme`, `Dr`, `Mr`… | Civilités ignorées en tête d'un nom de personne. Paramètre avancé. |
124
124
 
125
125
  ## Development
@@ -28,8 +28,8 @@ Pour chaque document, entre mentions de même famille de labels :
28
28
  - **un label dont le nom finit par un autre label regroupé est de sa famille** : le
29
29
  `location` du NER et l'`afplocation` des lexiques AFP annotent le même span, et vont
30
30
  dans le même groupe (de même `organization` et `afporganization`) ;
31
- - **tous les labels de personne forment une seule famille** (`person`, `afpperson`, ou
32
- ceux de `person_labels`) ;
31
+ - **tous les labels de personne forment une seule famille** : ceux de la famille
32
+ `person_family` (`person`, `afpperson`, ou `PER` déclaré dans `label_families`) ;
33
33
  - **un nom partiel de personne rejoint le nom complet dont il est la fin**, que le
34
34
  nom complet soit avant ou après lui dans le document : « Macron » et « M. Macron »
35
35
  rejoignent « Emmanuel Macron » ;
@@ -88,8 +88,8 @@ document = Document(
88
88
  | Paramètre | Défaut | Description |
89
89
  |-----------|--------|-------------|
90
90
  | `labels` | vide | Labels des mentions à regrouper. Vide : tous les labels. |
91
- | `person_labels` | vide | Labels de personne : ils forment une seule famille, et la règle du nom partiel s'y applique. Vide : tout label dont le nom contient « person » (`person`, `afpperson`…). |
92
- | `label_families` | vide | Familles de labels regroupés comme un seul, une famille par ligne, ses labels séparés par des virgules (`organization,afporganization,loc_org`). Un label non déclaré rejoint la famille du label le plus court qui termine son nom. |
91
+ | `label_families` | vide | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`) ou un nom libre (`loc_org` → `1`, `organization` → `1`). Un label non déclaré rejoint la famille du label le plus court qui termine son nom. |
92
+ | `person_family` | `person` | Famille des noms de personne : ses labels forment un seul groupe, et la règle du nom partiel s'y applique. Un label d'un autre nom la rejoint par `label_families` (`PER` → `person`). |
93
93
  | `honorifics` | `M.`, `Mme`, `Dr`, `Mr`… | Civilités ignorées en tête d'un nom de personne. Paramètre avancé. |
94
94
 
95
95
  ## Development
@@ -47,8 +47,8 @@ Properties the annotation already carried are kept. Processing the same document
47
47
  | Parameter | Default | Effect |
48
48
  |---|---|---|
49
49
  | **Labels** (`labels`) | — (all labels) | Labels of the mentions to group. Annotations of other labels get no property. Empty, all annotations are grouped. |
50
- | **Person Labels** (`person_labels`) | — (labels containing "person") | Labels of person names. They form a single family, and only these names benefit from the partial-name rule ("Macron" joins "Emmanuel Macron"). Empty, these are the labels whose name contains "person": `person`, `afpperson`… A `PER` label must therefore be declared here. |
51
- | **Label Families** (`label_families`) | — | Families of labels grouped as one, one family per line, its labels separated by commas (organization,afporganization,loc_org).<br/> A label not declared here belongs to the family of the shortest label that ends its name (afplocation with location). |
50
+ | **Label Families** (`label_families`) | — | Families of labels grouped as one, each label mapped to its family, the labels mapped to the same family grouped together: another label (`loc_org` → `organization`) or any name (`loc_org` → `1`, `organization` → `1`).<br/> A label not declared here belongs to the family of the shortest label that ends its name (afplocation with location). |
51
+ | **Person Family** (`person_family`) *(advanced)* | `person` | Family of person names: its labels form a single group (`person` and `afpperson`), and only these names benefit from the partial-name rule ("Macron" joins "Emmanuel Macron"). A label of another name joins it through **Label Families** (`PER` → `person`). |
52
52
  | **Honorifics** (`honorifics`) *(advanced)* | `["M.", "MM.", "Mme", "Mmes", "Mlle", "Mlles", "Me", "Dr", "Dr.", "Pr", "Pr.", "Mr", "Mr.", "Mrs", …` | Titles ignored in front of a person name, regardless of case. They are not part of the canonical form either. |
53
53
 
54
54
  <!-- /generated:parameters -->
@@ -166,7 +166,7 @@ Output annotations:
166
166
 
167
167
  ### 4. Declaring a label family
168
168
 
169
- `loc_org` ends with no other label: undeclared, it stays alone. With **Label Families** = `organization,loc_org`, the "PSG" annotated `loc_org` joins the one annotated `organization`:
169
+ `loc_org` ends with no other label: undeclared, it stays alone. With **Label Families** = `loc_org` → `organization`, the "PSG" annotated `loc_org` joins the one annotated `organization`:
170
170
 
171
171
  <!-- generated:example:label-families -->
172
172
 
@@ -182,7 +182,7 @@ Input annotations:
182
182
  | Parc des Princes | `location` | 1.00 |
183
183
  | PSG *(#2)* | `organization` | 1.00 |
184
184
 
185
- Parameters: **Label Families** = `["organization,loc_org"]`.
185
+ Parameters: **Label Families** = `{"loc_org": "organization"}`.
186
186
 
187
187
  Output annotations:
188
188
 
@@ -224,9 +224,9 @@ Output annotations:
224
224
 
225
225
  ## Known limitations
226
226
 
227
- - **A `PER` label is not recognized as a person by default.** Only the labels whose name contains "person" are. With `PER` annotations, "Macron" does not join "Emmanuel Macron" as long as `PER` is not declared in **Person Labels**. Once declared, it groups them:
227
+ - **A `PER` label is not recognized as a person by default.** Only the labels whose name ends with "person" are. With `PER` annotations, "Macron" does not join "Emmanuel Macron" as long as **Label Families** does not map `PER` to `person`. Once declared, it groups them:
228
228
 
229
- <!-- generated:example:person-labels -->
229
+ <!-- generated:example:person-family -->
230
230
 
231
231
  Text (French):
232
232
 
@@ -239,7 +239,7 @@ Input annotations:
239
239
  | Emmanuel Macron | `PER` | 1.00 |
240
240
  | Macron | `PER` | 1.00 |
241
241
 
242
- Parameters: **Person Labels** = `["PER"]`.
242
+ Parameters: **Label Families** = `{"PER": "person"}`.
243
243
 
244
244
  Output annotations:
245
245
 
@@ -248,7 +248,7 @@ Output annotations:
248
248
  | Emmanuel Macron | `PER` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`mention_type`: name |
249
249
  | Macron | `PER` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`mention_type`: name |
250
250
 
251
- <!-- /generated:example:person-labels -->
251
+ <!-- /generated:example:person-family -->
252
252
 
253
253
  - **The partial-name rule only looks at the end of the name.** Two different people sharing a last name are grouped if only one appears in full: in a document that only cites "Brigitte Macron", a "Macron" designating her husband joins her.
254
254
  - **A title missing from the list is part of the name.** "Général Martin" is not reduced to "Martin"; it is grouped with "Martin" by the partial-name rule, but the canonical form of the group then becomes "Général Martin".
@@ -47,8 +47,8 @@ Les propriétés que l'annotation portait déjà sont conservées. Traiter deux
47
47
  | Paramètre | Valeur par défaut | Effet |
48
48
  |---|---|---|
49
49
  | **Labels** (`labels`) | — (tous les labels) | Labels des mentions à regrouper. Les annotations des autres labels ne reçoivent aucune propriété. Vide, toutes les annotations sont regroupées. |
50
- | **Person Labels** (`person_labels`) | — (les labels contenant « person ») | Labels des noms de personnes. Ils forment une seule famille, et seuls ces noms bénéficient de la règle du nom partiel (« Macron » rejoint « Emmanuel Macron »). Vide, ce sont les labels dont le nom contient « person » : `person`, `afpperson`… Un label `PER` doit donc être déclaré ici. |
51
- | **Label Families** (`label_families`) | — | Familles de labels regroupés comme un seul, une famille par ligne, ses labels séparés par des virgules (`organization,afporganization,loc_org`). Un label non déclaré ici rejoint la famille du label le plus court qui termine son nom (`afplocation` avec `location`). |
50
+ | **Label Families** (`label_families`) | — | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`) ou un nom libre (`loc_org` → `1`, `organization` → `1`). Un label non déclaré ici rejoint la famille du label le plus court qui termine son nom (`afplocation` avec `location`). |
51
+ | **Person Family** (`person_family`) *(avancé)* | `person` | Famille des noms de personne : ses labels forment un seul groupe (`person` et `afpperson`), et seuls ces noms bénéficient de la règle du nom partiel (« Macron » rejoint « Emmanuel Macron »). Un label d'un autre nom la rejoint par **Label Families** (`PER` → `person`). |
52
52
  | **Honorifics** (`honorifics`) *(avancé)* | `["M.", "MM.", "Mme", "Mmes", "Mlle", "Mlles", "Me", "Dr", "Dr.", "Pr", "Pr.", "Mr", "Mr.", "Mrs", …` | Civilités ignorées devant un nom de personne, sans tenir compte des majuscules. Elles ne figurent pas non plus dans la forme canonique. |
53
53
 
54
54
  <!-- /generated:parameters -->
@@ -166,7 +166,7 @@ Annotations en sortie :
166
166
 
167
167
  ### 4. Déclarer une famille de labels
168
168
 
169
- `loc_org` ne finit par aucun autre label : sans déclaration, il reste seul. Avec **Label Families** = `organization,loc_org`, le « PSG » annoté `loc_org` rejoint celui annoté `organization` :
169
+ `loc_org` ne finit par aucun autre label : sans déclaration, il reste seul. Avec **Label Families** = `loc_org` → `organization`, le « PSG » annoté `loc_org` rejoint celui annoté `organization` :
170
170
 
171
171
  <!-- generated:example:label-families -->
172
172
 
@@ -182,7 +182,7 @@ Annotations en entrée :
182
182
  | Parc des Princes | `location` | 1,00 |
183
183
  | PSG *(n°2)* | `organization` | 1,00 |
184
184
 
185
- Paramètres : **Label Families** = `["organization,loc_org"]`.
185
+ Paramètres : **Label Families** = `{"loc_org": "organization"}`.
186
186
 
187
187
  Annotations en sortie :
188
188
 
@@ -224,9 +224,9 @@ Annotations en sortie :
224
224
 
225
225
  ## Limites à connaître
226
226
 
227
- - **Un label `PER` n'est pas reconnu comme personne par défaut.** Seuls les labels dont le nom contient « person » le sont. Avec des annotations `PER`, « Macron » ne rejoint pas « Emmanuel Macron » tant que `PER` n'est pas déclaré dans **Person Labels**. Déclaré, il les regroupe :
227
+ - **Un label `PER` n'est pas reconnu comme personne par défaut.** Seuls les labels dont le nom finit par « person » le sont. Avec des annotations `PER`, « Macron » ne rejoint pas « Emmanuel Macron » tant que **Label Families** n'associe pas `PER` à `person`. Déclaré, il les regroupe :
228
228
 
229
- <!-- generated:example:person-labels -->
229
+ <!-- generated:example:person-family -->
230
230
 
231
231
  Texte (français) :
232
232
 
@@ -239,7 +239,7 @@ Annotations en entrée :
239
239
  | Emmanuel Macron | `PER` | 1,00 |
240
240
  | Macron | `PER` | 1,00 |
241
241
 
242
- Paramètres : **Person Labels** = `["PER"]`.
242
+ Paramètres : **Label Families** = `{"PER": "person"}`.
243
243
 
244
244
  Annotations en sortie :
245
245
 
@@ -248,7 +248,7 @@ Annotations en sortie :
248
248
  | Emmanuel Macron | `PER` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`mention_type` : name |
249
249
  | Macron | `PER` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`mention_type` : name |
250
250
 
251
- <!-- /generated:example:person-labels -->
251
+ <!-- /generated:example:person-family -->
252
252
 
253
253
  - **La règle du nom partiel ne regarde que la fin du nom.** Deux personnes différentes qui partagent un nom de famille sont regroupées si une seule apparaît en entier : dans un document qui ne cite que « Brigitte Macron », un « Macron » qui désigne son mari la rejoint.
254
254
  - **Une civilité absente de la liste fait partie du nom.** « Général Martin » ne se réduit pas à « Martin » ; il est regroupé avec « Martin » par la règle du nom partiel, mais la forme canonique du groupe devient alors « Général Martin ».
@@ -1,3 +1,3 @@
1
1
  """Processor grouping the mentions of the same entity"""
2
2
 
3
- __version__ = "1.6.18"
3
+ __version__ = "1.6.22"
@@ -36,18 +36,19 @@ class CoreferenceParameters(ProcessorParameters):
36
36
  belongs to its family (afplocation with location, afporganization with organization), and all person labels form one family.""",
37
37
  json_schema_extra={"extra": "label"},
38
38
  )
39
- person_labels: list[str] | None = Field(
39
+ label_families: dict[str, str] | None = Field(
40
40
  None,
41
- description="""Labels of person names. They form one family (person and afpperson mentions are grouped together),
42
- and a partial name ("Macron") joins the full name it ends ("Emmanuel Macron").<br/>
43
- If empty, every label whose name contains "person" (person, afpperson...).""",
44
- json_schema_extra={"extra": "label"},
45
- )
46
- label_families: list[str] | None = Field(
47
- None,
48
- description="""Families of labels grouped as one, one family per line, its labels separated by commas
49
- (organization,afporganization,loc_org).<br/>
41
+ description="""Families of labels grouped as one: each label is mapped to its family, and the labels mapped to the same family
42
+ are grouped together. The family is another label (loc_org → organization) or any name (loc_org → 1, organization → 1).<br/>
50
43
  A label not declared here belongs to the family of the shortest label that ends its name (afplocation with location).""",
44
+ json_schema_extra={"extra": "key:label"},
45
+ )
46
+ person_family: str = Field(
47
+ "person",
48
+ description="""Family of person names: its labels are grouped together (person and afpperson mentions),
49
+ and a partial name ("Macron") joins the full name it ends ("Emmanuel Macron").<br/>
50
+ A label of another name joins it through Label Families (PER → person).""",
51
+ json_schema_extra={"extra": "advanced"},
51
52
  )
52
53
  honorifics: list[str] = Field(
53
54
  DEFAULT_HONORIFICS,
@@ -149,33 +150,28 @@ def group_document(document: Document, params: CoreferenceParameters, honorifics
149
150
 
150
151
 
151
152
  def label_families(labels: set[str], params: CoreferenceParameters) -> dict[str, str]:
152
- """Label → family, ignoring case: PERSON_FAMILY for a person label, the first label
153
- of its line for a label declared in `label_families`, otherwise the family of the
154
- shortest known label that ends its name ("afplocation" → "location")."""
155
- declared: dict[str, str] = {}
156
- for line in params.label_families or []:
157
- members = [m.strip().casefold() for m in line.split(",") if m.strip()]
158
- declared.update((m, members[0]) for m in members)
159
- known = {label.casefold() for label in labels} | declared.keys()
153
+ """Label → family, ignoring case: its value for a label declared in `label_families`
154
+ (a value is its own family, so that "organization" joins the labels mapped to it),
155
+ otherwise the family of the shortest known label that ends its name ("afplocation" →
156
+ "location"). The family `person_family` is PERSON_FAMILY."""
157
+ declared = {k.strip().casefold(): v.strip().casefold() for k, v in (params.label_families or {}).items() if k.strip() and v.strip()}
158
+ for value in list(declared.values()):
159
+ declared.setdefault(value, value)
160
+ person = params.person_family.strip().casefold()
161
+ known = {label.casefold() for label in labels} | declared.keys() | ({person} - {""})
160
162
 
161
163
  def family(label: str) -> str:
162
- if is_person_label(label, params):
163
- return PERSON_FAMILY
164
164
  folded = label.casefold()
165
165
  if folded in declared:
166
- return declared[folded]
167
- base = min((k for k in known if folded.endswith(k)), key=len)
168
- return declared.get(base, base)
166
+ found = declared[folded]
167
+ else:
168
+ base = min((k for k in known if folded.endswith(k)), key=len)
169
+ found = declared.get(base, base)
170
+ return PERSON_FAMILY if found == person else found
169
171
 
170
172
  return {label: family(label) for label in labels}
171
173
 
172
174
 
173
- def is_person_label(label: str, params: CoreferenceParameters) -> bool:
174
- if params.person_labels:
175
- return label in params.person_labels
176
- return "person" in label.casefold()
177
-
178
-
179
175
  def surface_of(a: Annotation, text: str) -> str:
180
176
  return a.text if a.text is not None else text[a.start : a.end]
181
177