mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-15 06:09:01 +03:00
c067b5264c
When sourcing a component, the object from the original pipeline is added to the new pipeline as the same object. This creates a situation where there are several attributes that cannot be in sync between the original pipeline and the new pipeline at the same time for this one object: * component.name * component.listener_map / component.listening_components for tok2vec and transformer When running replace_listeners on a component, the config is not updated correctly if the state of the component is incorrect for the current pipeline (in particular changes that should be applied from model.attrs["replace_listener_cfg"] as used in spacy-transformers) due to the fact that: * find_listeners relies on component.name to set the name in the listener_map * replace_listeners relies on listener_map to determine how to modify the configs In addition, there are several places where pipeline components are modified and the listener map and/or internal component names aren't currently updated. In cases where there is a component shared by two pipelines that cannot be in sync, this PR chooses to prioritize the most recently modified or initialized pipeline. There is no actual solution with the current source behavior that will make both pipelines usable, so the current pipeline is updated whenever components are added/renamed/removed or the pipeline is initialized for training. |
||
---|---|---|
.. | ||
converters | ||
__init__.pxd | ||
__init__.py | ||
align.pyx | ||
alignment_array.pxd | ||
alignment_array.pyx | ||
alignment.py | ||
augment.py | ||
batchers.py | ||
callbacks.py | ||
corpus.py | ||
example.pxd | ||
example.pyx | ||
gold_io.pyx | ||
initialize.py | ||
iob_utils.py | ||
loggers.py | ||
loop.py | ||
pretrain.py |