言語処理100本ノック 2020「60. 単語ベクトルの読み込みと表示」
問題文
問題の概要
本章では、単語の意味を実ベクトルで表現する単語ベクトル(単語埋め込み)を扱います。最初に、学習済みモデルをダウンロードし、単語ベクトルを表示します。
from gensim.models import KeyedVectors model = KeyedVectors.load_word2vec_format('ch07/GoogleNews-vectors-negative300.bin', binary=True) us = model['United_States'] print(us)