mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-30 10:00:04 +03:00
Suggestions from code review
This commit is contained in:
parent
82f1e20c4a
commit
8ee1ae0b99
|
@ -123,8 +123,7 @@ def make_entity_linker(
|
||||||
from spacy_legacy.components.entity_linker import EntityLinker_v1
|
from spacy_legacy.components.entity_linker import EntityLinker_v1
|
||||||
except:
|
except:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
"""In order to use v1 of the EntityLinker, you must use
|
"In order to use v1 of the EntityLinker, you must use spacy-legacy>=3.0.12."
|
||||||
spacy-legacy>=3.0.12."""
|
|
||||||
)
|
)
|
||||||
# The only difference in arguments here is that use_gold_ents and threshold aren't available.
|
# The only difference in arguments here is that use_gold_ents and threshold aren't available.
|
||||||
return EntityLinker_v1(
|
return EntityLinker_v1(
|
||||||
|
|
|
@ -20,8 +20,6 @@ from spacy.training import Example
|
||||||
from spacy.util import ensure_path
|
from spacy.util import ensure_path
|
||||||
from spacy.vocab import Vocab
|
from spacy.vocab import Vocab
|
||||||
|
|
||||||
from spacy_legacy.components.entity_linker import EntityLinker_v1
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def nlp():
|
def nlp():
|
||||||
|
@ -998,6 +996,8 @@ def test_scorer_links():
|
||||||
)
|
)
|
||||||
# fmt: on
|
# fmt: on
|
||||||
def test_legacy_architectures(name, config):
|
def test_legacy_architectures(name, config):
|
||||||
|
from spacy_legacy.components.entity_linker import EntityLinker_v1
|
||||||
|
|
||||||
# Ensure that the legacy architectures still work
|
# Ensure that the legacy architectures still work
|
||||||
vector_length = 3
|
vector_length = 3
|
||||||
nlp = English()
|
nlp = English()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user