From 931250e1f5c0f947ae87f3c19f4095c82ce45e11 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Fri, 10 Jul 2020 20:32:53 +0200 Subject: [PATCH] Fix pipeline component schema --- spacy/schemas.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spacy/schemas.py b/spacy/schemas.py index d8df33ed5..c4d67e90f 100644 --- a/spacy/schemas.py +++ b/spacy/schemas.py @@ -233,10 +233,17 @@ class ConfigSchemaNlpComponent(BaseModel): arbitrary_types_allowed = True +class ConfigSchemaPipeline(BaseModel): + __root__: Dict[str, ConfigSchemaNlpComponent] + + class Config: + extra = "allow" + + class ConfigSchemaNlp(BaseModel): lang: StrictStr = Field(..., title="The base language to use") vectors: Optional[DirectoryPath] = Field(..., title="Path to vectors") - pipeline: Optional[Dict[str, ConfigSchemaNlpComponent]] + pipeline: Optional[ConfigSchemaPipeline] class Config: extra = "forbid"