0

I've used Watson Studio for some basic course work; is it possible to load Google Word Vectors in binary form (.bin) into Watson Studio?

yenlaw
  • 1

1 Answers1

0

You can certainly read binary format files and technically any type of files in watson studio Notebook.

First thing, you need is to upload the binary zip file of GoogleNews-vectors-negative300.bin.gz to watson studio data asset, you can drag and drop to files section. Once that is done, you can use project-lib to read that file into binary object.

  1. insert project token, please refer below documentation on how to.

  2. fetch file

    my_file = project.get_file("GoogleNews-vectors-negative300.bin.gz")

  3. since it is gzip, you need to use gzip

    import gzip

    gzip_f = gzip.GzipFile(fileobj=my_file)

  4. install gensim !pip install gensim

  5. import genism and Load the model

import gensim

    # Load Google's pre-trained Word2Vec model.
    model = gensim.models.KeyedVectors.load_word2vec_format(gzip_f,binary=True)  

Ref:- https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/project-lib-python.html?audience=wdp

Full Notebook :- https://dataplatform.cloud.ibm.com/analytics/notebooks/v2/3ea58eda-cd56-4f7a-8b73-707d4b84edb2/view?access_token=cdfedfc282a7fc98691a1e7c5c183eeac607a7d1e09656dff448c6989e52eb5a

charles gomes
  • 2,145
  • 10
  • 15