课程: Hands-On Natural Language Processing
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Topic modeling with Gensim
- [Instructor] Now, let's see how to apply topic modeling algorithms to a pre-processed data set. We'll apply the Latent Dirichlet Allocation, LDA, and the Latent Semantic Analysis, LSA, algorithms from the Gensim Python library to the train and use script data set that has been pre-processed, using two methods of vectorization. To start, we import the LDA model from the gensim models module, and then create the variable called "LDA bow" to hold the LDA model (indistinct) with hyper-parameters. For the bag of words corpus, the number of topic and identity to word mapping and the random states of zero to ensure consistency. Now, we'll print the possible topic classes that were inferred by the Lda algorithm. The predictions will include up to 20 topics and about 8 words as we specified. Now, if I take a look at the output, we'll see that the model did a good job. This topic contains words like space, NASA,…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。