Skip to content

Instantly share code, notes, and snippets.

@rchurch4
Last active April 10, 2022 17:09
Show Gist options
  • Save rchurch4/64c1495aa753f21fecde6bc159fc7e86 to your computer and use it in GitHub Desktop.
Save rchurch4/64c1495aa753f21fecde6bc159fc7e86 to your computer and use it in GitHub Desktop.
from gdtm.models import TND
# Set these paths to the path where you saved the Mallet implementation of each model, plus bin/mallet
tnd_path = 'path/to/mallet-tnd/bin/mallet'
# We pass in the paths to the java code along with the data set and whatever parameters we want to set
model = TND(dataset=dataset, mallet_path=tnd_path, k=30, beta1=16, top_words=20)
topics = model.get_topics()
noise = model.get_noise_distribution()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment