From fabd3a339479a9ddec77605901bd2d04cc83e7b6 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Wed, 27 Jan 2021 12:40:03 +1100 Subject: [PATCH] Tidy up code comments [ci skip] --- spacy/language.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spacy/language.py b/spacy/language.py index 07e7e4148..6e617e31c 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -641,16 +641,16 @@ class Language: # specify the full config settings, which is not really viable. if pipe_meta.default_config: config = Config(pipe_meta.default_config).merge(config) - # We need to create a top-level key because Thinc doesn't allow resolving - # top-level references to registered functions. Also gives nicer errors. - # The name allows components to know their pipe name and use it in the - # losses etc. (even if multiple instances of the same factory are used) internal_name = self.get_factory_name(factory_name) # If the language-specific factory doesn't exist, try again with the # not-specific name if internal_name not in registry.factories: internal_name = factory_name + # The name allows components to know their pipe name and use it in the + # losses etc. (even if multiple instances of the same factory are used) config = {"nlp": self, "name": name, **config, "@factories": internal_name} + # We need to create a top-level key because Thinc doesn't allow resolving + # top-level references to registered functions. Also gives nicer errors. cfg = {factory_name: config} # We're calling the internal _fill here to avoid constructing the # registered functions twice @@ -1822,7 +1822,7 @@ class DisabledPipes(list): def _copy_examples(examples: Iterable[Example]) -> List[Example]: """Make a copy of a batch of examples, copying the predicted Doc as well. This is used in contexts where we need to take ownership of the examples - so that they can be mutated, for instance during Language.evaluate and + so that they can be mutated, for instance during Language.evaluate and Language.update. """ return [Example(eg.x.copy(), eg.y) for eg in examples]