nltk.tag.HiddenMarkovModelTagger.probability

HiddenMarkovModelTagger.probability(sequence)[source]

Returns the probability of the given symbol sequence. If the sequence is labelled, then returns the joint probability of the symbol, state sequence. Otherwise, uses the forward algorithm to find the probability over all label sequences.

Returns:the probability of the sequence
Return type:float
Parameters:sequence (Token) – the sequence of symbols which must contain the TEXT property, and optionally the TAG property