A processing interface for assigning a probability to the next
word.
|
|
|
|
|
prob(self,
word,
context)
Evaluate the probability of this word in this context. |
source code
|
|
|
|
logprob(self,
word,
context)
Evaluate the (negative) log probability of this word in this context. |
source code
|
|
|
|
choose_random_word(self,
context)
Randomly select a word that is likely to appear in this context. |
source code
|
|
|
|
generate(self,
n)
Generate n words of text from the language model. |
source code
|
|
|
|
entropy(self,
text)
Evaluate the total entropy of a message with respect to the model. |
source code
|
|