diff options
author | bothameister <bothameister@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-13 23:37:29 +0000 |
---|---|---|
committer | bothameister <bothameister@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-13 23:37:29 +0000 |
commit | c29321deae3bc178e9ea0501f598a40894c6bc98 (patch) | |
tree | f5f84e6554272c580eaef5a1f42643949809093f /gi/pyp-topics/src/pyp-topics.cc | |
parent | 1975a182d76171fee56faf671bedcbf13b9dc9ba (diff) |
added thresholding for span labelling
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@247 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/pyp-topics/src/pyp-topics.cc')
-rw-r--r-- | gi/pyp-topics/src/pyp-topics.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gi/pyp-topics/src/pyp-topics.cc b/gi/pyp-topics/src/pyp-topics.cc index e528a923..3614fb22 100644 --- a/gi/pyp-topics/src/pyp-topics.cc +++ b/gi/pyp-topics/src/pyp-topics.cc @@ -344,7 +344,7 @@ int PYPTopics::max_topic() const { return current_topic; } -int PYPTopics::max(const DocumentId& doc) const { +std::pair<int,PYPTopics::F> PYPTopics::max(const DocumentId& doc) const { //std::cerr << "PYPTopics::max(" << doc << "," << term << ")" << std::endl; // collect probs F current_max=0.0; @@ -366,10 +366,11 @@ int PYPTopics::max(const DocumentId& doc) const { } } assert(current_topic >= 0); - return current_topic; + assert(current_max >= 0); + return std::make_pair(current_topic, current_max); } -int PYPTopics::max(const DocumentId& doc, const Term& term) const { +std::pair<int,PYPTopics::F> PYPTopics::max(const DocumentId& doc, const Term& term) const { //std::cerr << "PYPTopics::max(" << doc << "," << term << ")" << std::endl; // collect probs F current_max=0.0; @@ -392,7 +393,8 @@ int PYPTopics::max(const DocumentId& doc, const Term& term) const { } } assert(current_topic >= 0); - return current_topic; + assert(current_max >= 0); + return std::make_pair(current_topic,current_max); } std::ostream& PYPTopics::print_document_topics(std::ostream& out) const { |