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

Method getWidsByDocSorted

src/TopicModel/TopicModel.hpp:817–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

815 }
816
817 std::vector<std::pair<Vid, Float>> getWidsByDocSorted(const DocumentBase* doc, size_t topN) const
818 {
819 std::vector<Float> cnt(dict.size());
820 for (auto w : doc->words) cnt[w] += 1;
821 for (auto& c : cnt) c /= doc->words.size();
822 return extractTopN<Vid>(cnt, topN);
823 }
824
825 std::vector<std::pair<std::string, Float>> getWordsByDocSorted(const DocumentBase* doc, size_t topN) const override
826 {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected