nemoguardrails.library.factchecking.align_score.actions

View as Markdown

Module Contents

Functions

NameDescription
alignscore_check_factsChecks the facts for the bot response using an information alignment score.
alignscore_check_facts_mappingMapping for alignscore_check_facts.

Data

log

API

nemoguardrails.library.factchecking.align_score.actions.alignscore_check_facts(
llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
context: typing.Optional[dict] = None,
llm: typing.Optional[nemoguardrails.types.LLMModel] = None,
config: typing.Optional[nemoguardrails.RailsConfig] = None,
kwargs = {}
)
async

Checks the facts for the bot response using an information alignment score.

nemoguardrails.library.factchecking.align_score.actions.alignscore_check_facts_mapping(
result: float
) -> bool

Mapping for alignscore_check_facts.

Expects result to be a numeric score (float) representing the factual accuracy. Returns True (i.e. block the output) if the score is below 0.5.

nemoguardrails.library.factchecking.align_score.actions.log = logging.getLogger(__name__)