explosion / spaCy

💫 Industrial-strength Natural Language Processing (NLP) in Python
https://spacy.io
MIT License
29.82k stars 4.37k forks source link

fill-config turns "source = ..." into "factory = ..." #7055

Closed Mwni closed 3 years ago

Mwni commented 3 years ago

Let's say we have this base config:

[components]

[components.tok2vec]
source = "en_core_web_trf"

[components.transformer]
source = "en_core_web_trf"

[components.parser]
source = "en_core_web_trf"

[components.tagger]
source = "en_core_web_trf"

[components.ner]
factory = "ner"

Which effectively is supposed to state, that I want a model that reuses all components of en_core_web_trf, except for the NER. Running it through py -m spacy init fill-config base_config.cfg config.cfg however yields a config that defines each component as factory, basically ignoring what was stated before:

[components]

[components.ner]
factory = "ner"

[components.ner.model]
@architectures = "spacy.TransitionBasedParser.v2"
state_type = "ner"
...

[components.parser]
factory = "parser"
learn_tokens = false
...

[components.parser.model]
@architectures = "spacy.TransitionBasedParser.v2"
state_type = "parser"
...

[components.tok2vec]
factory = "tok2vec"

ETC...

What's going on? Did I misinterpret the documentation?

Windows, Python 3.8, spacy 3.0.0

svlandeg commented 3 years ago

Thanks for the detailed bug report! This was a bug indeed, and is fixed by PR #7058. The fix is available in spaCy 3.0.3 which was released a few hours ago :-)

Mwni commented 3 years ago

No, thank YOU for the record speed fix of this :)

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.