Untitled

mail@pastecode.io avatarunknown
plain_text
a month ago
4.5 kB
2
Indexable
Never
---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
Input In [19], in <cell line: 5>()
      1 from gensim.downloader import load
      3 # Load pre-trained model
      4 #model = load("word2vec-google-news-300")
----> 5 model = load("glove-wiki-gigaword-100")
      6 #model = load("fasttext-wiki-news-subwords-300")
      7 
      8 # Specify the path for saving the embeddings
      9 embedding_file_path = "word2vec_embeddings.txt"

File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/gensim/downloader.py:490, in load(name, return_path)
    436 """Download (if needed) dataset/model and load it to memory (unless `return_path` is set).
    437 
    438 Parameters
   (...)
    487 
    488 """
    489 _create_base_dir()
--> 490 file_name = _get_filename(name)
    491 if file_name is None:
    492     raise ValueError("Incorrect model/corpus name")

File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/gensim/downloader.py:426, in _get_filename(name)
    412 def _get_filename(name):
    413     """Retrieve the filename of the dataset/model.
    414 
    415     Parameters
   (...)
    424 
    425     """
--> 426     information = info()
    427     corpora = information['corpora']
    428     models = information['models']

File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/gensim/downloader.py:268, in info(name, show_only_latest, name_only)
    228 def info(name=None, show_only_latest=True, name_only=False):
    229     """Provide the information related to model/dataset.
    230 
    231     Parameters
   (...)
    266 
    267     """
--> 268     information = _load_info()
    270     if name is not None:
    271         corpora = information['corpora']

File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/gensim/downloader.py:220, in _load_info(url, encoding)
    215 try:
    216     #
    217     # We need io.open here because Py2 open doesn't support encoding keyword
    218     #
    219     with io.open(cache_path, 'r', encoding=encoding) as fin:
--> 220         return json.load(fin)
    221 except IOError:
    222     raise ValueError(
    223         'unable to read local cache %r during fallback, '
    224         'connect to the Internet and retry' % cache_path
    225     )

File /Analytics/python3/lib/python3.8/json/__init__.py:293, in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    274 def load(fp, *, cls=None, object_hook=None, parse_float=None,
    275         parse_int=None, parse_constant=None, object_pairs_hook=None, **kw):
    276     """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
    277     a JSON document) to a Python object.
    278 
   (...)
    291     kwarg; otherwise ``JSONDecoder`` is used.
    292     """
--> 293     return loads(fp.read(),
    294         cls=cls, object_hook=object_hook,
    295         parse_float=parse_float, parse_int=parse_int,
    296         parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)

File /Analytics/python3/lib/python3.8/json/__init__.py:357, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    352     del kw['encoding']
    354 if (cls is None and object_hook is None and
    355         parse_int is None and parse_float is None and
    356         parse_constant is None and object_pairs_hook is None and not kw):
--> 357     return _default_decoder.decode(s)
    358 if cls is None:
    359     cls = JSONDecoder

File /Analytics/python3/lib/python3.8/json/decoder.py:337, in JSONDecoder.decode(self, s, _w)
    332 def decode(self, s, _w=WHITESPACE.match):
    333     """Return the Python representation of ``s`` (a ``str`` instance
    334     containing a JSON document).
    335 
    336     """
--> 337     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338     end = _w(s, end).end()
    339     if end != len(s):

File /Analytics/python3/lib/python3.8/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx)
    353     obj, end = self.scan_once(s, idx)
    354 except StopIteration as err:
--> 355     raise JSONDecodeError("Expecting value", s, err.value) from None
    356 return obj, end

JSONDecodeError: Expecting value: line 2 column 1 (char 1)