#pragma once #include "LDA.h" namespace tomoto { template struct DocumentLLDA : public DocumentLDA<_tw> { using BaseDocument = DocumentLDA<_tw>; using DocumentLDA<_tw>::DocumentLDA; using WeightType = typename DocumentLDA<_tw>::WeightType; Eigen::Matrix labelMask; DEFINE_SERIALIZER_AFTER_BASE_WITH_VERSION(BaseDocument, 0, labelMask); DEFINE_TAGGED_SERIALIZER_AFTER_BASE_WITH_VERSION(BaseDocument, 1, 0x00010001, labelMask); }; class ILLDAModel : public ILDAModel { public: using DefaultDocType = DocumentLLDA; static ILLDAModel* create(TermWeight _weight, size_t _K = 1, Float alpha = 0.1, Float eta = 0.01, size_t seed = std::random_device{}(), bool scalarRng = false); virtual size_t addDoc(const std::vector& words, const std::vector& label) = 0; virtual std::unique_ptr makeDoc(const std::vector& words, const std::vector& label) const = 0; virtual size_t addDoc(const std::string& rawStr, const RawDocTokenizer::Factory& tokenizer, const std::vector& label) = 0; virtual std::unique_ptr makeDoc(const std::string& rawStr, const RawDocTokenizer::Factory& tokenizer, const std::vector& label) const = 0; virtual size_t addDoc(const std::string& rawStr, const std::vector& words, const std::vector& pos, const std::vector& len, const std::vector& label) = 0; virtual std::unique_ptr makeDoc(const std::string& rawStr, const std::vector& words, const std::vector& pos, const std::vector& len, const std::vector& label) const = 0; virtual const Dictionary& getTopicLabelDict() const = 0; virtual size_t getNumTopicsPerLabel() const = 0; }; }