Git Product home page Git Product logo

pylda's Introduction

PyLDA

PyLDA is a Latent Dirichlet Allocation topic modeling package, developed by the Cloud Computing Research Team in University of Maryland, College Park.

Please download the latest version from our GitHub repository.

Please send any bugs of problems to Ke Zhai ([email protected]).

Install and Build

This package depends on many external python libraries, such as numpy, scipy and nltk.

Launch and Execute

Assume the PyLDA package is downloaded under directory $PROJECT_SPACE/src/, i.e.,

$PROJECT_SPACE/src/PyLDA

To prepare the example dataset,

tar zxvf associated-press.tar.gz

To launch PyLDA, first redirect to the directory of PyLDA source code,

cd $PROJECT_SPACE/src/PyLDA

and run the following command on example dataset,

python -m launch_train --input_directory=./associated-press --output_directory=./ --number_of_topics=10 --training_iterations=100

The generic argument to run PyLDA is

python -m launch_train --input_directory=$INPUT_DIRECTORY/$CORPUS_NAME --output_directory=$OUTPUT_DIRECTORY --number_of_topics=$NUMBER_OF_TOPICS --training_iterations=$NUMBER_OF_ITERATIONS

You should be able to find the output at directory $OUTPUT_DIRECTORY/$CORPUS_NAME.

Under any circumstances, you may also get help information and usage hints by running the following command

python -m launch_train --help

pylda's People

Contributors

kzhai avatar longteng6046 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylda's Issues

Adding regularizer term for topic vectors

I have to add some regularizer term to the likelihood equation containing beta terms. I am unable to figure out from the code which part of the code does the M-step update for the conditional multinomial parameter beta

find some error!

to make it run example , we sould:
1.use --training_iterations , not ----number_of_iterations
2.express the ap.tar.gz and copy the file to root like:

ubgpu@ubgpu:~/github/PyLDA$ tree
.
├── doc.dat
├── input
│   ├── ap
│   └── ap.tar.gz
├── output
├── raw
│   └── ap.tar.gz
├── README.md
├── src
│   └── lda
│   ├── hybrid.py
│   ├── inferencer.py
│   ├── init.py
│   ├── init.pyc
│   ├── launch_test.py
│   ├── launch_train.py
│   ├── monte_carlo.py
│   └── variational_bayes.py
├── test.dat
├── train.dat
└── voc.dat

6 directories, 15 files
ubgpu@ubgpu:/github/PyLDA$ cd src/
ubgpu@ubgpu:
/github/PyLDA/src$ python -m lda.launch_train --input_directory=../ input/ap --output_directory=../output/ --number_of_topics=10 --training_iterations=100 --inference_mode=0
successfully load all training docs from /home/ubgpu/github/PyLDA/train.dat...
successfully load all the words from /home/ubgpu/github/PyLDA/voc.dat...
========== ========== ========== ========== ==========
output_directory=../output/../150730-225540-lda-I100-S10-K10-aa0.100000-ab0.000147-im0/
input_directory=..
corpus_name=..
training_iterations=100

iteration of phi

Hi @kzhai ,
it's a nice work.
when i am reading you code , i find that the iteration of phi is a little different from the iteration formular:
图片
where is a "lambda" rather then a "eta" in you code,
log_phi = E_log_eta[:, term_ids].T + numpy.tile(scipy.special.psi(gamma_values[[doc_id], :]), (word_ids[doc_id].shape[0], 1));

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.