Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bauer <horatio@gmail.com>2022-09-01 03:46:25 +0300
committerJohn Bauer <horatio@gmail.com>2022-09-01 03:46:25 +0300
commit5e3ab62f0bbbc005f08d611657b42b61457ad01f (patch)
tree130b77bd08a89495968c1dc24d9978e35fb09c4b
parent942433a4dd67d799d5ffadfdff057b9278e93640 (diff)
Allow for a list of NER models in the processors argument, similar to the list of NER models in the package argument when creating a pipeline. From @mpenalver in #928
-rw-r--r--stanza/resources/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/stanza/resources/common.py b/stanza/resources/common.py
index 1a93797a..f80986f9 100644
--- a/stanza/resources/common.py
+++ b/stanza/resources/common.py
@@ -404,8 +404,8 @@ def process_pipeline_parameters(lang, model_dir, package, processors):
package = None
elif isinstance(processors, dict):
processors = {
- k.strip().lower(): v.strip().lower() \
- for k, v in processors.items()
+ k.strip().lower(): ([v_i.strip().lower() for v_i in v] if isinstance(v, (tuple, list)) else v.strip().lower())
+ for k, v in processors.items()
}
elif processors is not None:
raise TypeError(