Gensim: Wie speichern LDA-Modell produziert Themen, um ein lesbares format (csv,txt,etc)?

letzten Teile des Codes:

lda = LdaModel(corpus=corpus,id2word=dictionary, num_topics=2)
print lda

bash-Ausgang:

INFO : adding document #0 to Dictionary(0 unique tokens)
INFO : built Dictionary(18 unique tokens) from 5 documents (total  20 corpus positions)
INFO : using serial LDA version on this node
INFO : running online LDA training, 2 topics, 1 passes over the supplied corpus of 5 documents, updating model once every 5 documents
WARNING : too few updates, training might not converge; consider increasing the number of passes to improve accuracy
INFO : PROGRESS: iteration 0, at document #5/5
INFO : 2/5 documents converged within 50 iterations
INFO : topic #0: 0.079*cute + 0.076*broccoli + 0.070*adopted + 0.069*yesterday + 0.069*eat + 0.069*sister + 0.068*kitten + 0.068*kittens + 0.067*bananas + 0.067*chinchillas
INFO : topic #1: 0.082*broccoli + 0.079*cute + 0.071*piece + 0.070*munching + 0.069*spinach + 0.068*hamster + 0.068*ate + 0.067*banana + 0.066*breakfast + 0.066*smoothie
INFO : topic diff=0.470477, rho=1.000000
<gensim.models.ldamodel.LdaModel object at 0x10f1f4050>

So, ich bin gefragt, ich bin in der Lage, speichern Sie die bearbeiteten Themen, die es erzeugt, zu einem lesbaren format. Ich habe versucht, die .save() Methoden, aber es gibt das Videosignal immer mit etwas unleserlich.

haben Sie versucht, regex? ich konfrontiert die gleiche Sache und bemerkt, dass jedes Element verhält sich wie ein string.

InformationsquelleAutor jeremy.ting | 2013-06-27

Schreibe einen Kommentar