Closed eboraks closed 3 years ago
I am trying to use sense2vec version 1.0.0a1 with Spacy 2.0.18 and I am getting the following error.
Code
from sense2vec import Sense2VecComponent nlp = spacy.load("en_core_web_lg") s2v = Sense2VecComponent(nlp.vocab).from_disk("/path/to/s2v_reddit_2019_lg") nlp.add_pipe(s2v)
Error
TypeError Traceback (most recent call last) <ipython-input-4-0813b2052d50> in <module>() 3 4 nlp = spacy.load("en_core_web_lg") ----> 5 s2v = Sense2VecComponent(nlp.vocab).from_disk("/Users/eliranboraks/projects/git/nlp-demo-service/s2v_old") 6 nlp.add_pipe(s2v) /Users/eliranboraks/opt/anaconda3/envs/spacy/lib/python3.6/site-packages/sense2vec/__init__.py in __init__(self, vectors_path) 36 37 def __init__(self, vectors_path): ---> 38 self.s2v = load(vectors_path) 39 self.first_run = True 40 /Users/eliranboraks/opt/anaconda3/envs/spacy/lib/python3.6/site-packages/sense2vec/__init__.py in load(vectors_path) 10 11 def load(vectors_path): ---> 12 if not path.exists(vectors_path): 13 raise IOError("Can't find data directory: {}".format(vectors_path)) 14 vector_map = VectorMap(128) /Users/eliranboraks/opt/anaconda3/envs/spacy/lib/python3.6/genericpath.py in exists(path) 17 """Test whether a path exists. Returns False for broken symbolic links""" 18 try: ---> 19 os.stat(path) 20 except OSError: 21 return False TypeError: stat: path should be string, bytes, os.PathLike or integer, not spacy.vocab.Vocab
the problem was older version of Spacy.
I am trying to use sense2vec version 1.0.0a1 with Spacy 2.0.18 and I am getting the following error.
Code
Error