MIND-Lab / OCTIS

OCTIS: Comparing Topic Models is Simple! A python package to optimize and evaluate topic models (accepted at EACL2021 demo track)
MIT License
718 stars 102 forks source link

No parameter for topk words per topic #78

Closed ERijck closed 1 year ago

ERijck commented 1 year ago

Description

When training a model, I want to adjust the number of words per topic. However, I did not see this option in the source code of various models. Can you add this option for the different models?

silviatti commented 1 year ago

Hi, the parameter top_words in the train_model function controls what you want. For example,

model = LDA(num_topics=25)
model_output = model.train_model(dataset, top_words=20)

I noticed that this wasn't present in the implementation of NMF and I fixed it. It will be part of the next release. If you notice that it's missing in other models that you want to use, please let me know. Thanks,

Silvia

silviatti commented 1 year ago

For reference, PR #84 fixed the top_words parameter for CTM. The changes are available from OCTIS version 1.11.0. I'm closing this issue.

Silvia