| 320 | } |
| 321 | |
| 322 | py::UniqueObj LDAModelObject::getTopicWords(size_t topicId, size_t topN, bool returnId) const |
| 323 | { |
| 324 | auto* inst = getInst<tomoto::ILDAModel>(); |
| 325 | if (topicId >= inst->getK()) throw py::ValueError{ "topic_id must < K" }; |
| 326 | |
| 327 | if (returnId) |
| 328 | { |
| 329 | return py::buildPyValue(inst->getWordIdsByTopicSorted(topicId, topN)); |
| 330 | } |
| 331 | else |
| 332 | { |
| 333 | return py::buildPyValue(inst->getWordsByTopicSorted(topicId, topN)); |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | std::vector<tomoto::Float> LDAModelObject::getTopicWordDist(size_t topicId, bool normalize) const |
| 338 | { |
nothing calls this directly
no test coverage detected