mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-04 11:53:09 +03:00
rename to _make_unique_pipe_names
This commit is contained in:
parent
2524d067fd
commit
b9537ec03d
|
@ -27,7 +27,7 @@ def _increment_suffix(name: str) -> str:
|
||||||
return f"{prefix}{int(num) + 1}"
|
return f"{prefix}{int(num) + 1}"
|
||||||
|
|
||||||
|
|
||||||
def _make_unique_pipeline_names(nlp: Language, nlp2: Language) -> Dict[str, str]:
|
def _make_unique_pipe_names(nlp: Language, nlp2: Language) -> Dict[str, str]:
|
||||||
"""Given two pipelines, try to rename any collisions in component names.
|
"""Given two pipelines, try to rename any collisions in component names.
|
||||||
|
|
||||||
If a simple increment of a numeric suffix doesn't work, will give up.
|
If a simple increment of a numeric suffix doesn't work, will give up.
|
||||||
|
@ -66,7 +66,7 @@ def _inner_merge(
|
||||||
|
|
||||||
# The outer merge already verified there was exactly one tok2vec
|
# The outer merge already verified there was exactly one tok2vec
|
||||||
tok2vec_name = _get_tok2vecs(nlp2.config)[0]
|
tok2vec_name = _get_tok2vecs(nlp2.config)[0]
|
||||||
rename = _make_unique_pipeline_names(nlp, nlp2)
|
rename = _make_unique_pipe_names(nlp, nlp2)
|
||||||
|
|
||||||
if len(_get_listeners(nlp2)) > 1:
|
if len(_get_listeners(nlp2)) > 1:
|
||||||
if replace_listeners:
|
if replace_listeners:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user