Skip to content
Snippets Groups Projects
Commit 58f3a2e3 authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

fix tokens retrieval

parent d3e43e16
No related branches found
No related tags found
No related merge requests found
...@@ -213,9 +213,11 @@ class ArkindexExtractor: ...@@ -213,9 +213,11 @@ class ArkindexExtractor:
count = 0 count = 0
for entity in entities["results"]: for entity in entities["results"]:
start_token, end_token = self.tokens[ matching_tokens = self.tokens[entity["entity"]["metas"]["subtype"]]
entity["entity"]["metas"]["subtype"] start_token, end_token = (
] matching_tokens["start"],
matching_tokens["end"],
)
text, count = insert_token( text, count = insert_token(
text, text,
count, count,
...@@ -349,10 +351,6 @@ def run( ...@@ -349,10 +351,6 @@ def run(
if load_entities: if load_entities:
assert tokens, "Please provide the entities to match." assert tokens, "Please provide the entities to match."
# Get and initialize the parameters.
os.makedirs(IMAGES_DIR, exist_ok=True)
os.makedirs(LABELS_DIR, exist_ok=True)
# Login to arkindex. # Login to arkindex.
assert ( assert (
"ARKINDEX_API_URL" in os.environ "ARKINDEX_API_URL" in os.environ
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment