Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blei-lab/onlineldavb
Online variational Bayes for latent Dirichlet allocation (LDA)
https://github.com/blei-lab/onlineldavb
Last synced: 3 months ago
JSON representation
Online variational Bayes for latent Dirichlet allocation (LDA)
- Host: GitHub
- URL: https://github.com/blei-lab/onlineldavb
- Owner: blei-lab
- License: gpl-3.0
- Created: 2014-10-31T20:06:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T15:20:53.000Z (over 3 years ago)
- Last Synced: 2024-06-28T06:56:06.402Z (4 months ago)
- Language: Python
- Size: 49.8 KB
- Stars: 297
- Watchers: 51
- Forks: 105
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
- awesome-topic-models - onlineldavb - Python online variational Bayes implementation by Matthew Hoffman [:page_facing_up:](https://proceedings.neurips.cc/paper/2010/file/71f6278d140af599e06ad9bf1ba03cb0-Paper.pdf) (Research Implementations / Embedding based Topic Models)
README
ONLINE VARIATIONAL BAYES FOR LATENT DIRICHLET ALLOCATION
Matthew D. Hoffman
[email protected](C) Copyright 2010, Matthew D. Hoffman
This is free software, you can redistribute it and/or modify it under
the terms of the GNU General Public License.The GNU General Public License does not permit this software to be
redistributed in proprietary programs.This software is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA------------------------------------------------------------------------
This Python code implements the online Variational Bayes (VB)
algorithm presented in the paper "Online Learning for Latent Dirichlet
Allocation" by Matthew D. Hoffman, David M. Blei, and Francis Bach,
to be presented at NIPS 2010.The algorithm uses stochastic optimization to maximize the variational
objective function for the Latent Dirichlet Allocation (LDA) topic model.
It only looks at a subset of the total corpus of documents each
iteration, and thereby is able to find a locally optimal setting of
the variational posterior over the topics more quickly than a batch
VB algorithm could for large corpora.Files provided:
* onlineldavb.py: A package of functions for fitting LDA using stochastic
optimization.
* onlinewikipedia.py: An example Python script that uses the functions in
onlineldavb.py to fit a set of topics to the documents in Wikipedia.
* wikirandom.py: A package of functions for downloading randomly chosen
Wikipedia articles.
* printtopics.py: A Python script that displays the topics fit using the
functions in onlineldavb.py.
* dictnostops.txt: A vocabulary of English words with the stop words removed.
* readme.txt: This file.
* COPYING: A copy of the GNU public license version 3.You will need to have the numpy and scipy packages installed somewhere
that Python can find them to use these scripts.Example:
python onlinewikipedia.py 101
python printtopics.py dictnostops.txt lambda-100.datThis would run the algorithm for 101 iterations, and display the
(expected value under the variational posterior of the) topics fit by
the algorithm. (Note that the algorithm will not have fully converged
after 101 iterations---this is just to give an idea of how to use the
code.)