Last active
October 3, 2022 14:33
-
-
Save rchurch4/b1c917d7906d25f262ba3caeb497b9ef 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 GTM | |
# 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' | |
gtm_path = 'path/to/mallet-gtm/bin/mallet' | |
seed_topics_file = 'data/seed_topics.csv' | |
# We pass in the paths to the java code along with the data set and whatever parameters we want to set | |
model = GTM(dataset=dataset, mallet_tnd_path=tnd_path, mallet_gtm_path=gtm_path, | |
tnd_k=10, gtm_k=10, phi=10, top_words=20, seed_topics_file=seed_topics_file) | |
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
from gdtm.helpers.common import save_topics