estimate_confidence()

Estimate confidence in a model response based on textual signals.

Usage

Source

estimate_confidence(response)

Uses heuristics based on hedging language, assertiveness, response length, and structural indicators to produce a confidence score.

Parameters

response: str
The response text to analyze.

Returns

float
Confidence score from 0.0 (very low confidence) to 1.0 (very high confidence).

Examples

import talk_box as tb

tb.estimate_confidence("The answer is 42.")
# ~0.75

tb.estimate_confidence("I'm not sure, but maybe it's 42?")
# ~0.35

tb.estimate_confidence("I cannot answer that question.")
# ~0.15