Examples of ngramLogProbability()


Examples of joshua.decoder.ff.lm.buildin_lm.TrieLM.ngramLogProbability()

    Assert.assertEquals(lm.ngramLogProbability(vocab.getIDs("the potato")), -9.753210f + -0.1606644f, 0.000001f);
    Assert.assertEquals(lm.ngramLogProbability(vocab.getIDs("potato parliament")), -3.875917f + -0.0f, 0.000001f);
   
    // Test trigrams know to NOT be in the language model (but the bigrams are)
    int[] words = vocab.getIDs("because of a");
    double f = lm.ngramLogProbability(words);
    Assert.assertEquals(f, -1.403534f + -0.03083654f, 0.000001f);
//    //Assert.assertEquals(lm.ngramLogProbability(vocab.getIDs("of the parliament")), -3.875917f + -0.05237135f, 0.000001f);
   
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.