Coder Social home page Coder Social logo

streamlda's Introduction

Update

I am no longer maintaining this repo. A more up to date version is available at https://github.com/kzhai/InfVocLDA


STREAM VARIATIONAL BAYES FOR LATENT DIRICHLET ALLOCATION

Stream LDA implements a version of the LDA algorithm such that a continuous stream of documents can be passed in. The classifier will continue to learn new words and refine the topics over time, while maintaining a constant bound on memory requirements.

Original implementation by Matthew D. Hoffman ([email protected]), (C) Copyright 2009, Matthew D. Hoffman

Extensions by Jessy Cowan-Sharp ([email protected]) and Jordan Boyd-Grader ([email protected])


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 is based on the implementation of 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. It has been extended to support arbitrary streams of documents without constraining the vocabulary or requiring knowledge of the total number of predicted documents.

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:

  • streamlda.py: A package of functions for fitting LDA using stochastic optimization.
  • dirichlet_words.py: A class to represent the evolving vocabulary as probability distributions over words and topics. Provides backoff estimates of unseen words.
  • streamwikipedia.py: An example Python script that uses the functions in streamlda.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 streamlda.py.
  • documentation.txt: More detailed commentary and implementation details.
  • readme.txt: This file.
  • LICENSE: A copy of the GNU public license version 3.

Dependencies:

  • numpy
  • scipy
  • nltk

Example: python streamwikipedia.py 101 python printtopics.py

This 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.)

streamlda's People

Contributors

jessykate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

streamlda's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.