I have a trained custom LDA model (Hebrew language) and I want to use pyLDAvis in order to visualize it.
I'm referring to the docs and the following resources: https://pyldavis.readthedocs.io/en/latest/modules/API.html#pyLDAvis.preparehttps://nbviewer.jupyter.org/github/bmabey/pyLDAvis/blob/master/notebooks/pyLDAvis_overview.ipynb http://jeriwieringa.com/2018/07/17/pyLDAviz-and-Mallet/
But I still don't understand how does the input for the prepare method looks like.
topic_term_dists:array-like, shape (n_topics, n_terms)
Matrix of topic-term probabilities. Where n_terms is len(vocab).
doc_topic_dists :array-like, shape (n_docs, n_topics)
Matrix of document-topic probabilities.
doc_lengths :array-like, shape n_docs
The length of each document, i.e. the number of words in each document. The order of the numbers should be consistent with the ordering of the docs in doc_topic_dists.
vocab :array-like, shape n_terms
List of all the words in the corpus used to train the model.
term_frequency :array-like, shape n_terms
The count of each particular term over the entire corpus. The ordering of these counts should correspond with vocab and topic_term_dists.
Does someone have an example for those inputs? Thanks
from Using pyLDAvis with custom model
No comments:
Post a Comment