1
我想在一組文檔上應用LDA。假設計算文檔屬於某個主題的概率。我做了以下內容:如何使用scikit學習獲取特定文檔的主題概率?
tfidf_vectorizer = TfidfVectorizer(min_df=12, analyzer="word")
tfidf = tfidf_vectorizer.fit_transform(data_samples)
lda = LatentDirichletAllocation(n_topics=5, max_iter=5,
learning_method='online',
learning_offset=50.,
random_state=0)
lda.fit(tfidf)
現在我希望得到我的data_sample
文檔的概率屬於比如給定主題,因爲我用5個話題:[0.2, 0.1 ,0.1, 0.1, 0.5]
,關於LDA的文檔prety弱,你知道這個信息是否容易訪問?