For reference, I already looked at the following questions:
I am looking to have my LDA model trained from Gensim classify a sentence under one of the topics that the model creates. Something long the lines of
lda = models.LdaModel(corpus=corpus, id2word=id2word, num_topics=7, passes=20)
lda.print_topics()
for line in document: # where each line in the document is its own sentence for simplicity
print('Sentence: ', line)
topic = lda.parse(line) # where the classification would occur
print('Topic: ', topic)
I know gensim does not have a parse
function, but how would one go about accomplishing this? Here is the documentation that I've been following but I haven't gotten anywhere with it:
Thanks in advance.
edit: More documentation- https://radimrehurek.com/gensim/models/ldamodel.html