lm_polygraph.estimators.sentence_sar module

class lm_polygraph.estimators.sentence_sar.SentenceSAR(verbose: bool = False)[source]

Bases: Estimator

Estimates the sequence-level uncertainty of a language model following the method of “Sentence SAR” as provided in the paper https://arxiv.org/abs/2307.01379. Works only with whitebox models (initialized using lm_polygraph.utils.model.WhiteboxModel).

This method calculates the sum of the probability of the generated text and text relevance relative to all other generations.