Suggestions from code review

This commit is contained in:
Paul O'Leary McCann 2023-02-01 12:42:24 +09:00
parent 82f1e20c4a
commit 8ee1ae0b99
2 changed files with 3 additions and 4 deletions

View File

@ -123,8 +123,7 @@ def make_entity_linker(
from spacy_legacy.components.entity_linker import EntityLinker_v1
except:
raise ImportError(
"""In order to use v1 of the EntityLinker, you must use
spacy-legacy>=3.0.12."""
"In order to use v1 of the EntityLinker, you must use spacy-legacy>=3.0.12."
)
# The only difference in arguments here is that use_gold_ents and threshold aren't available.
return EntityLinker_v1(

View File

@ -20,8 +20,6 @@ from spacy.training import Example
from spacy.util import ensure_path
from spacy.vocab import Vocab
from spacy_legacy.components.entity_linker import EntityLinker_v1
@pytest.fixture
def nlp():
@ -998,6 +996,8 @@ def test_scorer_links():
)
# fmt: on
def test_legacy_architectures(name, config):
from spacy_legacy.components.entity_linker import EntityLinker_v1
# Ensure that the legacy architectures still work
vector_length = 3
nlp = English()