lm_polygraph.stat_calculators.prompt module

class lm_polygraph.stat_calculators.prompt.BasePromptCalculator(prompt: str, expected: str, method: str, input_text_dependency: str = 'input_texts', sample_text_dependency: str | None = None, generation_text_dependency: str = 'greedy_texts')[source]

Bases: StatCalculator

Calculates the probability for a specific token to be generated from the specific prompt. Used for P(True)-based methods.

class lm_polygraph.stat_calculators.prompt.ClaimPromptCalculator[source]

Bases: BasePromptCalculator

static meta_info() Tuple[List[str], List[str]][source]

Returns the statistics and dependencies for the ClaimPromptCalculator.

class lm_polygraph.stat_calculators.prompt.PromptCalculator[source]

Bases: BasePromptCalculator

static meta_info() Tuple[List[str], List[str]][source]

Returns the statistics and dependencies for the PromptCalculator.

class lm_polygraph.stat_calculators.prompt.SamplingPromptCalculator[source]

Bases: BasePromptCalculator

static meta_info() Tuple[List[str], List[str]][source]

Returns the statistics and dependencies for the SamplingPromptCalculator.