From b37bc8d9b27caaf8fa214dadf02a0ec9f99857bc Mon Sep 17 00:00:00 2001 From: John Bauer Date: Mon, 23 Dec 2024 21:06:04 -0800 Subject: [PATCH] Fix the processing of w/ and w/o transformers when adding NER to the default_accurate package --- stanza/resources/prepare_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stanza/resources/prepare_resources.py b/stanza/resources/prepare_resources.py index 8a3d3d8eca..fd5ff4d444 100644 --- a/stanza/resources/prepare_resources.py +++ b/stanza/resources/prepare_resources.py @@ -475,7 +475,7 @@ def get_default_accurate(resources, lang): if transformer is not None: for processor in ('pos', 'depparse', 'constituency', 'sentiment'): update_processor_add_transformer(resources, lang, default_processors, processor, transformer) - if default_processors['ner'].endswith("_charlm"): + if 'ner' in default_processors and (default_processors['ner'].endswith("_charlm") or default_processors['ner'].endswith("_nocharlm")): update_processor_add_transformer(resources, lang, default_processors, "ner", transformer) optional = get_optional_accurate(resources, lang)