This is a didactic implementation of LDA (Latent Dirichlet Allocation) which aims to provide an explicative and unoptimized code (as mush as possible). It exploits the collapsed Gibbs sampling to infer the latent variables.
I reccomend to execute this code in a Python 2.7 virtual environment, which can be set up using the provided "requirements.txt" file.
- Create your environment "venv":
virtualenv venv
- Activate it:
source venv/bin/activate
- Install the required libraries:
pip install -r requirements.txt
- Run the didactic LDA:
python my_lda.py
and enjoy LDA!
- Latent Dirichlet Allocation - The seminal paper about LDA (based on Varionatl Inference)
- Gibbs sampling for LDA - LDA based on Gibbs sampling
- Gabriele Pergola - PhD student
This project is licensed under the MIT License - see the LICENSE.md file for details