LoginSignup
3
2

More than 5 years have passed since last update.

Word2Vecのお試しのための最小構成

Last updated at Posted at 2018-07-06

Ubuntu 16.04で試しました。

Kyubyong/wordvectors: Pre-trained word vectors of 30+ languagesからJapanese (w)を選んでダウンロードする。

pip3 install gensim

pip3が無いよって怒られるひとは

sudo apt-get install python3-pip

以下のスクリプトを実行して動作確認。

python3 sample.py
sample.py
from gensim.models import word2vec

model = word2vec.Word2Vec.load("./ja/ja.bin") # これはダウンロードしたやつ
print(model.corpus_count)

results = model.wv.most_similar(positive=['東京'], negative=["金"])
for result in results:
    print(result)
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2