mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 10:46:29 +03:00
Update entity_linker.py
This commit is contained in:
parent
20b89a9717
commit
0b52b6904c
|
@ -48,8 +48,11 @@ DEFAULT_NEL_MODEL = Config().from_str(default_model_config)["model"]
|
||||||
"incl_context": True,
|
"incl_context": True,
|
||||||
"get_candidates": {"@misc": "spacy.CandidateGenerator.v1"},
|
"get_candidates": {"@misc": "spacy.CandidateGenerator.v1"},
|
||||||
},
|
},
|
||||||
scores=["nel_micro_p", "nel_micro_r", "nel_micro_f"],
|
default_score_weights={
|
||||||
default_score_weights={"nel_micro_f": 1.0},
|
"nel_micro_f": 1.0,
|
||||||
|
"nel_micro_r": None,
|
||||||
|
"nel_micro_p": None,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
def make_entity_linker(
|
def make_entity_linker(
|
||||||
nlp: Language,
|
nlp: Language,
|
||||||
|
@ -428,7 +431,6 @@ class EntityLinker(Pipe):
|
||||||
validate_examples(examples, "EntityLinker.score")
|
validate_examples(examples, "EntityLinker.score")
|
||||||
return Scorer.score_links(examples, negative_labels=[self.NIL])
|
return Scorer.score_links(examples, negative_labels=[self.NIL])
|
||||||
|
|
||||||
|
|
||||||
def to_disk(
|
def to_disk(
|
||||||
self, path: Union[str, Path], *, exclude: Iterable[str] = SimpleFrozenList()
|
self, path: Union[str, Path], *, exclude: Iterable[str] = SimpleFrozenList()
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user