Tidy up code comments [ci skip]

This commit is contained in:
Ines Montani 2021-01-27 12:40:03 +11:00
parent e7db07a0b9
commit fabd3a3394
1 changed files with 5 additions and 5 deletions

View File

@ -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