from gensim.models.keyedvectors import KeyedVectors
model = KeyedVectors.load_word2vec_format('google_news.bin', binary=True)
print(model['the']) # this prints the 300D vector for the word 'the'
該
所以..我寫了一些代碼,想知道複合算子的原型(即類似operator*=或operator/=)。當我查看它時,我意識到它們應該返回引用。 (至少我的源這樣指出:R& operator +=(K& a, S b);。)嗯..然後我意識到,在我的代碼行可能會多一分危險比它似乎是: // I have a really fancy Vector class I've been making. :P