nltk.DictionaryProbDist

class nltk.DictionaryProbDist(prob_dict=None, log=False, normalize=False)[source]

A probability distribution whose probabilities are directly specified by a given dictionary. The given dictionary maps samples to probabilities.

Methods

__init__([prob_dict, log, normalize]) Construct a new probability distribution from the given dictionary, which maps values to probabilities (or to log probabilities, if log is true).
discount() Return the ratio by which counts are discounted on average: c*/c
generate() Return a randomly selected sample from this probability distribution.
logprob(sample)
max()
prob(sample)
samples()
unicode_repr()

Attributes

SUM_TO_ONE