incerto.llm.IDontKnowDetection#

class incerto.llm.IDontKnowDetection[source]#

Bases: object

Detect when the model is expressing uncertainty verbally.

Common patterns: “I don’t know”, “I’m not sure”, “unclear”, etc.

__init__()#

Methods

__init__()

contains_uncertainty_phrase(text)

Check if text contains uncertainty phrases.

extract_confidence_from_hedging(text)

Detect hedging language and estimate confidence.

Attributes

UNCERTAINTY_PHRASES = ["i don't know", "i'm not sure", 'i am not sure', 'uncertain', 'unclear', 'not certain', 'cannot say', "can't say", 'hard to say', 'difficult to say', 'no information', 'cannot determine', 'unable to determine', 'ambiguous', 'not enough information', 'insufficient information']#
static contains_uncertainty_phrase(text)[source]#

Check if text contains uncertainty phrases.

Parameters:

text (str) – Generated text

Return type:

bool

Returns:

True if uncertainty phrase detected

static extract_confidence_from_hedging(text)[source]#

Detect hedging language and estimate confidence.

Parameters:

text (str) – Generated text

Return type:

dict

Returns:

Dictionary with hedging indicators