[irstlm] 119/126: handling of missing weights

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:46:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

giuliopaci-guest pushed a commit to annotated tag adaptiveLM.v0.1
in repository irstlm.

commit 9fe9a9a4886f4ec4c4f36db5a75a09577a3bb963
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Fri Oct 23 08:01:22 2015 +0200

    handling of missing weights
---
 src/lmContextDependent.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/lmContextDependent.cpp b/src/lmContextDependent.cpp
index a230d23..764b414 100644
--- a/src/lmContextDependent.cpp
+++ b/src/lmContextDependent.cpp
@@ -234,7 +234,12 @@ namespace irstlm {
 	double lmContextDependent::lprob(ngram& ng, string_vec_t& text, lm_map_t& lm_weights, topic_map_t& topic_weights, double* bow,int* bol,char** maxsuffptr,unsigned int* statesize,bool* extendible)
 	{
 		VERBOSE(2,"lmContextDependent::lprob(ngram& ng, lm_map_t& lm_weights, topic_map_t& topic_weights, ...)" << std::endl);
-		double lm_logprob = m_lm->clprob(ng, lm_weights, bow, bol, maxsuffptr, statesize, extendible);
+		double lm_logprob;
+		if (lm_weights.size() == 0){
+			lm_logprob = m_lm->clprob(ng, bow, bol, maxsuffptr, statesize, extendible);
+		}else{
+			lm_logprob = m_lm->clprob(ng, lm_weights, bow, bol, maxsuffptr, statesize, extendible);
+		}
 		double similarity_score = m_similaritymodel->context_similarity(text, topic_weights);
 		double ret_logprob = lm_logprob + m_similaritymodel_weight * similarity_score;
 		VERBOSE(2, "lm_log10_pr:" << lm_logprob << " similarity_score:" << similarity_score << " m_similaritymodel_weight:" << m_similaritymodel_weight << " ret_log10_pr:" << ret_logprob << std::endl);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/irstlm.git



More information about the debian-science-commits mailing list