Skip to content

Instantly share code, notes, and snippets.

@ChangUk
ChangUk / GibbsLDA.py
Last active Apr 19, 2021
Collapsed Gibbs sampler for Latent Dirichlet Allocation
View GibbsLDA.py
#-*- coding: utf-8 -*-
"""
GIBBS SAMPLING IMPLEMENTATION FOR LATENT DIRICHLET ALLOCATION (2003)
IMPLEMENTED BY CHANG-UK, PARK
DATA FORMAT: "DocID\t WordID\t FREQUENCY\n"
"""
import sys
import random