how to compute the probability of a sentence?

76 views
Skip to first unread message

fanc...@gmail.com

unread,
Jan 22, 2015, 9:49:00 PM1/22/15
to berkeleyl...@googlegroups.com
I am new to language model. I want to compute the probability of a sentence using language model. Other people have trained a language model and save it as arpa format(using other tool)
I can convert it to berkeleylm's internal format using MakeLmBinaryFromArpa. So I have a NgramLanguageModel instance in java.
in the source code:

/**

* Scores a complete sentence, taking appropriate care with the start- and

* end-of-sentence symbols. This is a convenience method and will generally

* be inefficient.

* @return

*/

public float scoreSentence(List<W> sentence);

it seems this method is what I want. But the doc says it's not efficient. So what should do to make it efficiently?

Reply all
Reply to author
Forward
0 new messages