Skip to content

Commit b496a08

Browse files
authored
use InMemoryLookupKB for spacy 3.5 (#181)
* use InMemoryLookupKB for spacy 3.5 * update spacy version in yml
1 parent 10872d4 commit b496a08

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎tutorials/nel_emerson/project.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ vars:
1313
dev: "dev"
1414
version: "0.0.3"
1515

16-
spacy_version: ">=3.0.0,<3.5.0"
16+
spacy_version: ">=3.5.0,<3.6.0"
1717

1818
# These are the directories that the project needs. The project CLI will make
1919
# sure that they always exist.

‎tutorials/nel_emerson/scripts/create_kb.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55

66
import spacy
7-
from spacy.kb import KnowledgeBase
7+
from spacy.kb import InMemoryLookupKB
88

99

1010
def main(entities_loc: Path, vectors_model: str, kb_loc: Path, nlp_dir: Path):
@@ -20,7 +20,7 @@ def main(entities_loc: Path, vectors_model: str, kb_loc: Path, nlp_dir: Path):
2020

2121
name_dict, desc_dict = _load_entities(entities_loc)
2222

23-
kb = KnowledgeBase(vocab=nlp.vocab, entity_vector_length=300)
23+
kb = InMemoryLookupKB(vocab=nlp.vocab, entity_vector_length=300)
2424

2525
for qid, desc in desc_dict.items():
2626
desc_doc = nlp(desc)

0 commit comments

Comments
 (0)