I'm new to python. What I'm trying to do is to read 2 parameters via console.
- parameter:path to a trained LDA model with gensim.
- parameter:the number of most common words per topic which I want to get in return.
Now I want to print for all the topics the number of the most common words per topic. Now my question is how to get all the topics.
This is what I have so far:
import sys, getopt
import gensim
def main(argv):
input_file = argv[0] #LDA Path
number_of_words = argv[1] #Number of most common word per topic
ldamodel = gensim.models.ldamodel.LdaModel.load(input_file, mmap=None) #load model
ldamodel.print_topic(?, number_of_words)
if __name__ == "__main__":
main(sys.argv[1:])
Thanks