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

Method getTopicWords

src/python/handler/py_DT.cpp:111–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111std::vector<std::pair<std::string, float>> DTModelObject::getTopicWords(size_t topicId, size_t timepoint, size_t topN) const
112{
113 auto* inst = getInst<tomoto::IDTModel>();
114 if (topicId >= inst->getK()) throw py::ValueError{ "must topic_id < k" };
115 if (timepoint >= inst->getT()) throw py::ValueError{ "must topic_id < t" };
116 return inst->getWordsByTopicSorted(topicId + inst->getK() * timepoint, topN);
117}
118
119std::vector<float> DTModelObject::getTopicWordDist(size_t topicId, size_t timepoint, bool normalize) const
120{

Callers

nothing calls this directly

Calls 2

getWordsByTopicSortedMethod · 0.80
getKMethod · 0.45

Tested by

no test coverage detected