MCPcopy Create free account
hub / github.com/bab2min/tomotopy / getTopicWords

Method getTopicWords

src/python/handler/py_MGLDA.cpp:91–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91std::vector<std::pair<std::string, tomoto::Float>> MGLDAModelObject::getTopicWords(size_t topicId, size_t topN) const
92{
93 auto* inst = getInst<tomoto::IMGLDAModel>();
94 if (topicId >= inst->getK() + inst->getKL()) throw py::ValueError{ "must topic_id < KG + KL" };
95
96 return inst->getWordsByTopicSorted(topicId, topN);
97}
98
99std::vector<float> MGLDAModelObject::getTopicWordDist(size_t topicId, bool normalize) const
100{

Callers

nothing calls this directly

Calls 2

getWordsByTopicSortedMethod · 0.80
getKMethod · 0.45

Tested by

no test coverage detected