Topic modeling with latent Dirichlet allocation
Topic modeling with latent Dirichlet allocation. lda aims for simplicity.
pip install lda
lda.LDA implements latent Dirichlet allocation (LDA). The interface follows conventions found in scikit-learn.
>>> import numpy as np >>> import lda >>> X = np.array([[1,1], [2, 1], [3, 1], [4, 1], [5, 8], [6, 1]]) >>> model = lda.LDA(n_topics=2, n_iter, random_state=1) >>> doc_topic = model.fit_transform(X) # estimate of document-topic distributions >>> model.components_ # estimate of topic-word distributions; model.doc_topic_ is an alias
lda aims for simplicity over speed. If you are working with large corpora or want to use faster and more sophisticated topic models, consider using hca or MALLET. hca is written in C and MALLET_ is written in Java.
horizont is licensed under Version 2.0 of the Mozilla Public License.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size lda-0.1.0.dev2.g0925a91.tar.gz (222.9 kB)||File type Source||Python version None||Upload date||Hashes View hashes|