0
아래 코드를 실행 중이지만 gensim word2vec이 어휘 오류가 아닌 단어를 내 보냅니다. 해결책을 알려주시겠습니까?gensim : KeyError : "단어 '빨리'어휘가 아닙니다."
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
sentences = [["The quick brown fox jumped over the lazy dog"],
["The sun is shining bright"]]
from gensim.models import word2vec
model = word2vec.Word2Vec(sentences, iter=10, min_count=1, size=300, workers=4)
print(model['quick'])
출력 :
KeyError: "word 'quick' not in vocabulary"
하지만이
print(model['The quick brown fox jumped over the lazy dog'])
이
[ 1.60348183e-03 -9.17983416e-04 -8.30831763e-04 9.46367683e-04
덕분에 작동합니다. –