mirror of https://github.com/explosion/spaCy.git
reorder so tagmap is replaced only if a custom file is provided. (#6164)
* reorder so tagmap is replaced only if a custom file is provided. * Remove unneeded variable initialization Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
This commit is contained in:
parent
27c5795ea5
commit
4cbb954281
|
@ -59,10 +59,6 @@ def debug_data(
|
||||||
if not dev_path.exists():
|
if not dev_path.exists():
|
||||||
msg.fail("Development data not found", dev_path, exits=1)
|
msg.fail("Development data not found", dev_path, exits=1)
|
||||||
|
|
||||||
tag_map = {}
|
|
||||||
if tag_map_path is not None:
|
|
||||||
tag_map = srsly.read_json(tag_map_path)
|
|
||||||
|
|
||||||
# Initialize the model and pipeline
|
# Initialize the model and pipeline
|
||||||
pipeline = [p.strip() for p in pipeline.split(",")]
|
pipeline = [p.strip() for p in pipeline.split(",")]
|
||||||
if base_model:
|
if base_model:
|
||||||
|
@ -70,6 +66,9 @@ def debug_data(
|
||||||
else:
|
else:
|
||||||
lang_cls = get_lang_class(lang)
|
lang_cls = get_lang_class(lang)
|
||||||
nlp = lang_cls()
|
nlp = lang_cls()
|
||||||
|
|
||||||
|
if tag_map_path is not None:
|
||||||
|
tag_map = srsly.read_json(tag_map_path)
|
||||||
# Replace tag map with provided mapping
|
# Replace tag map with provided mapping
|
||||||
nlp.vocab.morphology.load_tag_map(tag_map)
|
nlp.vocab.morphology.load_tag_map(tag_map)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue