models.basemodel
– Core TM interface¶gensim.models.basemodel.
BaseTopicModel
¶Bases: object
get_topics
()¶Get words X topics matrix.
The term topic matrix learned during inference, shape (num_topics, vocabulary_size).
numpy.ndarray
NotImplementedError –
print_topic
(topicno, topn=10)¶Get a single topic as a formatted string.
topicno (int) – Topic id.
topn (int) – Number of words from topic that will be used.
String representation of topic, like ‘-0.340 * “category” + 0.298 * “$M$” + 0.183 * “algebra” + … ‘.
str
print_topics
(num_topics=20, num_words=10)¶Get the most significant topics (alias for show_topics() method).
num_topics (int, optional) – The number of topics to be selected, if -1 - all topics will be in result (ordered by significance).
num_words (int, optional) – The number of words to be included per topics (ordered by significance).
Sequence with (topic_id, [(word, value), … ]).
list of (int, list of (str, float))