mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
fix tests
This commit is contained in:
parent
68a0662019
commit
1c80b85241
|
@ -41,8 +41,12 @@ def create_kb(vocab):
|
|||
|
||||
|
||||
def add_el(kb, nlp):
|
||||
el_pipe = nlp.create_pipe(name='entity_linker', config={"kb": kb})
|
||||
el_pipe = nlp.create_pipe(name='entity_linker', config={"context_width": 64})
|
||||
el_pipe.set_kb(kb)
|
||||
nlp.add_pipe(el_pipe, last=True)
|
||||
nlp.begin_training()
|
||||
el_pipe.context_weight = 0
|
||||
el_pipe.prior_weight = 1
|
||||
|
||||
for alias in ["Douglas Adams", "Douglas"]:
|
||||
candidates = nlp.linker.kb.get_candidates(alias)
|
||||
|
|
|
@ -666,7 +666,7 @@ def build_nel_encoder(embed_width, hidden_width, **cfg):
|
|||
entity_width = cfg.get("entity_width")
|
||||
|
||||
with Model.define_operators({">>": chain, "**": clone}):
|
||||
model = Affine(1, entity_width+context_width+1, drop_factor=0.0)\
|
||||
model = Affine(1, entity_width+context_width, drop_factor=0.0)\
|
||||
>> logistic
|
||||
|
||||
# context encoder
|
||||
|
|
|
@ -126,7 +126,7 @@ def test_preserving_links_asdoc(nlp):
|
|||
ruler.add_patterns(patterns)
|
||||
nlp.add_pipe(ruler)
|
||||
|
||||
el_pipe = nlp.create_pipe(name='entity_linker', config={})
|
||||
el_pipe = nlp.create_pipe(name='entity_linker', config={"context_width": 64})
|
||||
el_pipe.set_kb(mykb)
|
||||
el_pipe.begin_training()
|
||||
el_pipe.context_weight = 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user