Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. from gensim.models.keyedvectors import KeyedVectors
  2. model_path = './data/GoogleNews-vectors-negative300.bin'
  3. w2v_model = KeyedVectors.load_word2vec_format(model_path, binary=True)
  4.  
  5. FileNotFoundError Traceback (most recent call last)
  6. <ipython-input-16-04e6454088bc> in <module>
  7. 1 from gensim.models.keyedvectors import KeyedVectors
  8. 2 model_path = './data/GoogleNews-vectors-negative300.bin'
  9. ----> 3 w2v_model = KeyedVectors.load_word2vec_format(model_path, binary=True)
  10.  
  11. ~AppDataLocalcondacondaenvschannellibsite-packagesgensimmodelskeyedvectors.py in load_word2vec_format(cls, fname, fvocab, binary, encoding, unicode_errors, limit, datatype)
  12. 1434 return _load_word2vec_format(
  13. 1435 cls, fname, fvocab=fvocab, binary=binary, encoding=encoding, unicode_errors=unicode_errors,
  14. -> 1436 limit=limit, datatype=datatype)
  15. 1437
  16. 1438 def get_keras_embedding(self, train_embeddings=False):
  17.  
  18. ~AppDataLocalcondacondaenvschannellibsite-packagesgensimmodelsutils_any2vec.py in _load_word2vec_format(cls, fname, fvocab, binary, encoding, unicode_errors, limit, datatype)
  19. 169
  20. 170 logger.info("loading projection weights from %s", fname)
  21. --> 171 with utils.smart_open(fname) as fin:
  22. 172 header = utils.to_unicode(fin.readline(), encoding=encoding)
  23. 173 vocab_size, vector_size = (int(x) for x in header.split()) # throws for invalid file format
  24.  
  25. ~AppDataLocalcondacondaenvschannellibsite-packagessmart_opensmart_open_lib.py in smart_open(uri, mode, **kw)
  26. 398 transport_params[key] = value
  27. 399
  28. --> 400 return open(uri, mode, ignore_ext=ignore_extension, transport_params=transport_params, **scrubbed_kwargs)
  29. 401
  30. 402
  31.  
  32. ~AppDataLocalcondacondaenvschannellibsite-packagessmart_opensmart_open_lib.py in open(uri, mode, buffering, encoding, errors, newline, closefd, opener, ignore_ext, transport_params)
  33. 298 buffering=buffering,
  34. 299 encoding=encoding,
  35. --> 300 errors=errors,
  36. 301 )
  37. 302 if fobj is not None:
  38.  
  39. ~AppDataLocalcondacondaenvschannellibsite-packagessmart_opensmart_open_lib.py in _shortcut_open(uri, mode, ignore_ext, buffering, encoding, errors)
  40. 457 #
  41. 458 if six.PY3:
  42. --> 459 return _builtin_open(parsed_uri.uri_path, mode, buffering=buffering, **open_kwargs)
  43. 460 elif not open_kwargs:
  44. 461 return _builtin_open(parsed_uri.uri_path, mode, buffering=buffering)
  45.  
  46. FileNotFoundError: [Errno 2] No such file or directory: './data/GoogleNews-vectors-negative300.bin'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement