Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 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));
 }