1
2
3
5 """
6 A processing interface for assigning a probability to the next word.
7 """
8
10 '''Create a new language model.'''
11 raise NotImplementedError()
12
13 - def prob(self, word, context):
14 '''Evaluate the probability of this word in this context.'''
15 raise NotImplementedError()
16
18 '''Evaluate the log probability of this word in this context.'''
19 raise NotImplementedError()
20
22 '''Randomly select a word that is likely to appear in this context.'''
23 raise NotImplementedError()
24
26 '''Generate n words of text from the language model.'''
27 raise NotImplementedError()
28
30 '''Evaluate the total entropy of a message with respect to the model.
31 This is the sum of the log probability of each word in the message.'''
32 raise NotImplementedError()
33