mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-05 05:33:15 +03:00
'entity_linker' instead of 'el'
This commit is contained in:
parent
ec3e860b44
commit
5318ce88fa
|
@ -39,7 +39,7 @@ def create_kb(vocab):
|
||||||
|
|
||||||
|
|
||||||
def add_el(kb, nlp):
|
def add_el(kb, nlp):
|
||||||
el_pipe = nlp.create_pipe(name='el', config={"kb": kb})
|
el_pipe = nlp.create_pipe(name='entity_linker', config={"kb": kb})
|
||||||
nlp.add_pipe(el_pipe, last=True)
|
nlp.add_pipe(el_pipe, last=True)
|
||||||
|
|
||||||
for alias in ["Douglas Adams", "Douglas"]:
|
for alias in ["Douglas Adams", "Douglas"]:
|
||||||
|
|
|
@ -117,7 +117,7 @@ class Language(object):
|
||||||
"tagger": lambda nlp, **cfg: Tagger(nlp.vocab, **cfg),
|
"tagger": lambda nlp, **cfg: Tagger(nlp.vocab, **cfg),
|
||||||
"parser": lambda nlp, **cfg: DependencyParser(nlp.vocab, **cfg),
|
"parser": lambda nlp, **cfg: DependencyParser(nlp.vocab, **cfg),
|
||||||
"ner": lambda nlp, **cfg: EntityRecognizer(nlp.vocab, **cfg),
|
"ner": lambda nlp, **cfg: EntityRecognizer(nlp.vocab, **cfg),
|
||||||
"el": lambda nlp, **cfg: EntityLinker(nlp.vocab, **cfg),
|
"entity_linker": lambda nlp, **cfg: EntityLinker(nlp.vocab, **cfg),
|
||||||
"similarity": lambda nlp, **cfg: SimilarityHook(nlp.vocab, **cfg),
|
"similarity": lambda nlp, **cfg: SimilarityHook(nlp.vocab, **cfg),
|
||||||
"textcat": lambda nlp, **cfg: TextCategorizer(nlp.vocab, **cfg),
|
"textcat": lambda nlp, **cfg: TextCategorizer(nlp.vocab, **cfg),
|
||||||
"sentencizer": lambda nlp, **cfg: SentenceSegmenter(nlp.vocab, **cfg),
|
"sentencizer": lambda nlp, **cfg: SentenceSegmenter(nlp.vocab, **cfg),
|
||||||
|
@ -215,7 +215,7 @@ class Language(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def linker(self):
|
def linker(self):
|
||||||
return self.get_pipe("el")
|
return self.get_pipe("entity_linker")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def matcher(self):
|
def matcher(self):
|
||||||
|
|
|
@ -1059,7 +1059,7 @@ cdef class EntityRecognizer(Parser):
|
||||||
|
|
||||||
|
|
||||||
class EntityLinker(Pipe):
|
class EntityLinker(Pipe):
|
||||||
name = 'el'
|
name = 'entity_linker'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def Model(cls, nr_class=1, **cfg):
|
def Model(cls, nr_class=1, **cfg):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user