pyannotators-entityfishing 1.6.44__tar.gz → 1.6.47__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.
- {pyannotators_entityfishing-1.6.44 → pyannotators_entityfishing-1.6.47}/PKG-INFO +3 -3
- {pyannotators_entityfishing-1.6.44 → pyannotators_entityfishing-1.6.47}/pyproject.toml +2 -2
- {pyannotators_entityfishing-1.6.44 → pyannotators_entityfishing-1.6.47}/src/pyannotators_entityfishing/__init__.py +1 -1
- {pyannotators_entityfishing-1.6.44 → pyannotators_entityfishing-1.6.47}/src/pyannotators_entityfishing/entityfishing.py +5 -5
- {pyannotators_entityfishing-1.6.44 → pyannotators_entityfishing-1.6.47}/.gitignore +0 -0
- {pyannotators_entityfishing-1.6.44 → pyannotators_entityfishing-1.6.47}/README.md +0 -0
- {pyannotators_entityfishing-1.6.44 → pyannotators_entityfishing-1.6.47}/src/pyannotators_entityfishing/ef_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyannotators-entityfishing
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.47
|
|
4
4
|
Summary: Annotator based on entity-fishing
|
|
5
5
|
Project-URL: Homepage, https://github.com/oterrier/pyannotators_entityfishing/
|
|
6
6
|
Author-email: Olivier Terrier <olivier.terrier@kairntech.com>
|
|
@@ -20,7 +20,7 @@ Requires-Python: >=3.12
|
|
|
20
20
|
Requires-Dist: collections-extended
|
|
21
21
|
Requires-Dist: mongoquery
|
|
22
22
|
Requires-Dist: pydantic<3.0,>=2.0
|
|
23
|
-
Requires-Dist: pymultirole-plugins<
|
|
23
|
+
Requires-Dist: pymultirole-plugins<1.7.0,>=1.6.0
|
|
24
24
|
Requires-Dist: python-singleton-metaclasses
|
|
25
25
|
Requires-Dist: requests
|
|
26
26
|
Requires-Dist: requests-cache
|
|
@@ -30,7 +30,7 @@ Requires-Dist: bump2version; extra == 'dev'
|
|
|
30
30
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
31
31
|
Provides-Extra: docs
|
|
32
32
|
Requires-Dist: lxml-html-clean; extra == 'docs'
|
|
33
|
-
Requires-Dist:
|
|
33
|
+
Requires-Dist: myst-parser; extra == 'docs'
|
|
34
34
|
Requires-Dist: sphinx; extra == 'docs'
|
|
35
35
|
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
|
|
36
36
|
Requires-Dist: sphinxcontrib-apidoc; extra == 'docs'
|
|
@@ -28,7 +28,7 @@ classifiers = [
|
|
|
28
28
|
"Programming Language :: Python :: 3.12",
|
|
29
29
|
]
|
|
30
30
|
dependencies = [
|
|
31
|
-
"pymultirole-plugins>=
|
|
31
|
+
"pymultirole-plugins>=1.6.0,<1.7.0",
|
|
32
32
|
"pydantic>=2.0,<3.0",
|
|
33
33
|
"requests",
|
|
34
34
|
"requests-cache",
|
|
@@ -57,7 +57,7 @@ test = [
|
|
|
57
57
|
docs = [
|
|
58
58
|
"sphinx",
|
|
59
59
|
"sphinx-rtd-theme",
|
|
60
|
-
"
|
|
60
|
+
"myst-parser",
|
|
61
61
|
"sphinxcontrib.apidoc",
|
|
62
62
|
"lxml_html_clean",
|
|
63
63
|
]
|
|
@@ -148,12 +148,12 @@ def _enrich_concepts_with_properties(concepts: dict, wiki_props: list[str], mult
|
|
|
148
148
|
"""Enrich concept dicts with extracted wikidata_properties."""
|
|
149
149
|
for concept in concepts.values():
|
|
150
150
|
if concept is not None and "statements" in concept:
|
|
151
|
-
fingerprint = defaultdict(
|
|
151
|
+
fingerprint = defaultdict(set)
|
|
152
152
|
for wp in wiki_props:
|
|
153
|
-
fingerprint[wp] =
|
|
153
|
+
fingerprint[wp] = set()
|
|
154
154
|
for st in concept["statements"]:
|
|
155
155
|
if st["propertyId"] in wiki_props:
|
|
156
|
-
fingerprint[st["propertyId"]].
|
|
156
|
+
fingerprint[st["propertyId"]].add(st["value"])
|
|
157
157
|
if sum(len(v) for v in fingerprint.values()) > 0:
|
|
158
158
|
concept["wikidata_properties"] = dict(fingerprint)
|
|
159
159
|
|
|
@@ -184,7 +184,7 @@ def _build_annotation(entity: dict, label: str, concept: dict | None, lang: str,
|
|
|
184
184
|
if fingerprints:
|
|
185
185
|
fp_parts = []
|
|
186
186
|
for f in fingerprints:
|
|
187
|
-
fvals = concept["wikidata_properties"].get(f, [])
|
|
187
|
+
fvals = list(concept["wikidata_properties"].get(f, []))
|
|
188
188
|
if fvals:
|
|
189
189
|
fingers = [f"{f}:{v}" for v in sorted(fvals) if isinstance(v, str)]
|
|
190
190
|
if multivalued_props:
|
|
@@ -194,7 +194,7 @@ def _build_annotation(entity: dict, label: str, concept: dict | None, lang: str,
|
|
|
194
194
|
ann_term.properties["fingerprint"] = ",".join(fp_parts)
|
|
195
195
|
if wikidata_properties:
|
|
196
196
|
for wp in wikidata_properties:
|
|
197
|
-
fvals = concept["wikidata_properties"].get(wp, [])
|
|
197
|
+
fvals = list(concept["wikidata_properties"].get(wp, []))
|
|
198
198
|
if len(fvals) == 1:
|
|
199
199
|
ann_term.properties[wp] = fvals[0]
|
|
200
200
|
elif len(fvals) > 1:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|