Wie, um Vorhersagen, die Thema einer neuen Abfrage, die einen ausgebildeten LDA-Modell mit gensim?

Ich ausgebildet haben, ein Korpus für die LDA Thema Modellierung mit gensim.

Gehen Sie durch die Anleitung auf der gensim website (ist nicht der ganze code):

question = 'Changelog generation from Github issues?';

temp = question.lower()
for i in range(len(punctuation_string)):
    temp = temp.replace(punctuation_string[i], '')

words = re.findall(r'\w+', temp, flags = re.UNICODE | re.LOCALE)
important_words = []
important_words = filter(lambda x: x not in stoplist, words)
print important_words
dictionary = corpora.Dictionary.load('questions.dict')
ques_vec = []
ques_vec = dictionary.doc2bow(important_words)
print dictionary
print ques_vec
print lda[ques_vec]

Dies ist die Ausgabe, die ich bekomme:

['changelog', 'generation', 'github', 'issues']
Dictionary(15791 unique tokens)
[(514, 1), (3625, 1), (3626, 1), (3627, 1)]
[(4, 0.20400000000000032), (11, 0.20400000000000032), (19, 0.20263215848547525), (29, 0.20536784151452539)]

Ich weiß nicht, wie die Letzte Ausgabe wird mir helfen, das mögliche Thema für die question !!!

Bitte um Hilfe!!

Schreibe einen Kommentar