mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
make EntityLinker robust for nO=None (#7930)
This commit is contained in:
parent
66bfabd839
commit
e9037d8fc0
|
@ -11,7 +11,7 @@ from ...vocab import Vocab
|
||||||
@registry.architectures("spacy.EntityLinker.v1")
|
@registry.architectures("spacy.EntityLinker.v1")
|
||||||
def build_nel_encoder(tok2vec: Model, nO: Optional[int] = None) -> Model:
|
def build_nel_encoder(tok2vec: Model, nO: Optional[int] = None) -> Model:
|
||||||
with Model.define_operators({">>": chain, "**": clone}):
|
with Model.define_operators({">>": chain, "**": clone}):
|
||||||
token_width = tok2vec.get_dim("nO")
|
token_width = tok2vec.maybe_get_dim("nO")
|
||||||
output_layer = Linear(nO=nO, nI=token_width)
|
output_layer = Linear(nO=nO, nI=token_width)
|
||||||
model = (
|
model = (
|
||||||
tok2vec
|
tok2vec
|
||||||
|
|
Loading…
Reference in New Issue
Block a user