public double ComputeSmoothedWordProbability(string u, string v, string w, int nGramCount, int n_1_gramCount, int uniqueNGrams) { var collectionProb = CollectionLevelLanguageModel.ComputeWordProbability(null, null, w); var dirichletProb = (nGramCount + M * collectionProb) / (n_1_gramCount + M); return((1 - L) * dirichletProb + L * collectionProb); }
public double ComputeSmoothedWordProbability(string u, string v, string w, int nGramCount, int n_1_gramCount, int uniqueNGrams) { double qMlWcat = (nGramCount * 1.0) / (n_1_gramCount); qMlWcat = double.IsFinite(qMlWcat) ? qMlWcat : 0.0; double qMlWcollection = CollectionLevelLanguageModel.ComputeWordProbability(null, null, w); qMlWcollection = double.IsFinite(qMlWcollection) ? qMlWcollection : 0.0; return((1 - L) * qMlWcat + L * qMlWcollection); }
public double ComputeSmoothedWordProbability(string u, string v, string w, int nGramCount, int n_1_gramCount, int uniqueNGrams) { return((Math.Max(nGramCount - D, 0) + D * uniqueNGrams * CollectionLevelLanguageModel.ComputeWordProbability(null, null, w)) / n_1_gramCount); }
public double ComputeSmoothedWordProbability(string u, string v, string w, int nGramCount, int n_1_gramCount, int uniqueNGrams) { return((nGramCount + M * CollectionLevelLanguageModel.ComputeWordProbability(null, null, w)) / (n_1_gramCount + M)); }