Last active
April 10, 2022 17:09
-
-
Save rchurch4/1ba9d948cf945d2b629b130f7db3d9d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gdtm.models import NLDA | |
# 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' | |
lda_path = 'path/to/mallet-lda/bin/mallet' | |
# We pass in the paths to the java code along with the data set and whatever parameters we want to set | |
model = NLDA(dataset=dataset, mallet_tnd_path=tnd_path, mallet_lda_path=lda_path, | |
tnd_k=30, lda_k=30, nlda_phi=10, 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