Skip to content
Snippets Groups Projects

Implement extraction command

Merged Yoann Schneider requested to merge implement-extraction-command into main
1 file
+ 5
7
Compare changes
  • Side-by-side
  • Inline
@@ -266,9 +266,11 @@ class ArkindexExtractor:
count = 0
for entity in entities["results"]:
start_token, end_token = self.tokens[
entity["entity"]["metas"]["subtype"]
]
matching_tokens = self.tokens[entity["entity"]["metas"]["subtype"]]
start_token, end_token = (
matching_tokens["start"],
matching_tokens["end"],
)
text, count = insert_token(
text,
count,
@@ -402,10 +404,6 @@ def run(
if load_entities:
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.
assert (
"ARKINDEX_API_URL" in os.environ
Loading