From 52c65e78485613b24d84a7d96f4d440c347c2028 Mon Sep 17 00:00:00 2001 From: "philblunsom@gmail.com" Date: Thu, 1 Jul 2010 04:11:26 +0000 Subject: Added hierarchical topics. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@87 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/pyp-topics/src/pyp-topics.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gi/pyp-topics/src/pyp-topics.hh') diff --git a/gi/pyp-topics/src/pyp-topics.hh b/gi/pyp-topics/src/pyp-topics.hh index 47207d65..db0f7468 100644 --- a/gi/pyp-topics/src/pyp-topics.hh +++ b/gi/pyp-topics/src/pyp-topics.hh @@ -15,7 +15,9 @@ public: typedef double F; public: - PYPTopics(int num_topics) : m_num_topics(num_topics), m_word_pyps(1) {} + PYPTopics(int num_topics, bool use_topic_pyp=false) + : m_num_topics(num_topics), m_word_pyps(1), + m_topic_pyp(0.5,1.0), m_use_topic_pyp(use_topic_pyp) {} void sample(const Corpus& corpus, int samples); int sample(const DocumentId& doc, const Term& term); @@ -50,6 +52,8 @@ private: typedef std::vector< PYP > PYPs; PYPs m_document_pyps; std::vector m_word_pyps; + PYP m_topic_pyp; + bool m_use_topic_pyp; TermBackoffPtr m_backoff; }; -- cgit v1.2.3