From 6520d1a1df37d481836ae4b59f435830daa5564a Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sat, 29 Aug 2020 12:58:22 +0200 Subject: [PATCH] Work around set order in Language.disabled --- spacy/language.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index d698d6f43..140452a77 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -258,7 +258,9 @@ class Language: RETURNS (List[str]): The disabled components. """ - return list(self._disabled) + # Make sure the disabled components are returned in the order they + # appear in the pipeline (which isn't guaranteed by the set) + return [name for name, _ in self.components if name in self._disabled] @property def factory_names(self) -> List[str]: