MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / log_prob

Method log_prob

numpy_ml/ngram/ngram.py:300–305  ·  view source on GitHub ↗

Compute the log probability of a sequence of words under the unsmoothed, maximum-likelihood `N`-gram language model.

(self, words, N)

Source from the content-addressed store, hash-verified

298
299 @abstractmethod
300 def log_prob(self, words, N):
301 """
302 Compute the log probability of a sequence of words under the
303 unsmoothed, maximum-likelihood `N`-gram language model.
304 """
305 raise NotImplementedError
306
307 @abstractmethod
308 def _log_ngram_prob(self, ngram):

Callers 1

cross_entropyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected