0
以下のコード/ gensim-usageが正しいかどうかを確認したいと思いますか?id2word_token2Gensimでの使用混乱
貴重な時間をいただきありがとうございます。
import gensim
train = ["John likes to watch movies Mary likes movies too" ,
"John also likes to watch football games" ]
test = ["Football is my dream"]
train_texts = [[word for word in document.lower().split()] for document in train]
test_texts = [[word for word in document.lower().split()] for document in test]
dictionary =gensim.corpora.Dictionary(train_texts)
train_corpus = [dictionary.doc2bow(text) for text in train_texts]
test_corpus = [dictionary.doc2bow(text) for text in test_texts]
ldaModel = gensim.models.LdaModel(corpus=train_corpus ,
id2word=dictionary , num_topics=2)
bound_perplex = ldaModel.bound(test_corpus)
を私は他の人と調査しました。それはそうなっている通りです。ありがとうございました – TheWho