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

Method getSubTopicDist

src/python/handler/py_PA.cpp:86–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86std::vector<float> DocumentObject::getSubTopicDist(bool normalize) const
87{
88 if (corpus->isIndependent()) throw py::AttributeError{ "This method can only be called by documents bound to the topic model." };
89 auto* inst = corpus->tm->getInst<tomoto::IPAModel>();
90 if (!corpus->tm->isPrepared) throw py::RuntimeError{ "train() should be called first for calculating the topic distribution" };
91 return inst->getSubTopicsByDoc(getBoundDoc(), normalize);
92}
93
94py::UniqueObj PAModelObject::infer(PyObject* docObj, size_t iteration, float tolerance, size_t workers, tomoto::ParallelScheme ps, bool together, PyObject* transform) const
95{

Callers

nothing calls this directly

Calls 2

isIndependentMethod · 0.80
getSubTopicsByDocMethod · 0.45

Tested by

no test coverage detected