Sha256: a2c0c24ff8978497e2f6e71cf0a8ed4432c17f3d98aeb85a78adc30efb46cfe0

Contents?: true

Size: 1.47 KB

Versions: 6

Compression:

Stored size: 1.47 KB

Contents

Latent Dirichlet Allocation – Ruby Wrapper

This wrapper is based on C-code by David M. Blei. In a nutshell, it can be used to automatically cluster documents into topics. The number of topics are chosen beforehand and the topics found are usually fairly intuitive. Details of the implementation can be found in the paper by Blei, Ng, and Jordan.

The original C code relied on files for the input and output. We felt it was necessary to depart from that model and use Ruby objects for these steps instead. The only file necessary will be the data file (in a format similar to that used by SVMlight). Optionally you may need a vocabulary file to be able to extract the words belonging to topics.

Example usage:

require 'lda'
corpus = Lda::DataCorpus.new("data/data_file.dat")
lda = Lda::Lda.new(corpus)      # create an Lda object for training
lda.em("random")                # run EM algorithm using random starting points
lda.load_vocabulary("data/vocab.txt")
lda.print_topics(20)            # print the topic 20 words per topic

You can check out the mailing list for this project if you have any questions or mail lda-ruby@groups.google.com [email link]. If you have general questions about Latent Dirichlet Allocation, I urge you to use the topic models mailing list, since the people who monitor that are very knowledgeable.


References

Blei, David M., Ng, Andrew Y., and Jordan, Michael I. 2003. Latent dirichlet allocation. Journal of Machine Learning Research. 3 (Mar. 2003), 993-1022.

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lda-ruby-0.3.8 README
lda-ruby-0.3.7 README
lda-ruby-0.3.6 README
lda-ruby-0.3.5 README
lda-ruby-0.3.4 README
lda-ruby-0.3.1 README