lm_polygraph.estimators.token_entropy module

class lm_polygraph.estimators.token_entropy.MeanTokenEntropy[source]

Bases: Estimator

Estimates the sequence-level uncertainty of a language model by calculating the mean entropy among all tokens in the generation. Works only with whitebox models (initialized using lm_polygraph.utils.model.WhiteboxModel).

class lm_polygraph.estimators.token_entropy.TokenEntropy[source]

Bases: Estimator

Estimates the token-level uncertainty of a language model by calculating the entropy for each token in the generation. Works only with whitebox models (initialized using lm_polygraph.utils.model.WhiteboxModel).