nemoguardrails.evaluate.evaluate_factcheck
nemoguardrails.evaluate.evaluate_factcheck
Module Contents
Classes
Functions
API
Helper class for running the fact checking evaluation for a Guardrails app. It contains all the configuration parameters required to run the evaluation.
Check facts using the fact checking rail. The fact checking rail is a binary classifier that takes in evidence and a response and predicts whether the response is grounded in the evidence or not.
Parameters:
The split type for checking facts. Either “positive” or “negative”.
Returns:
Tuple[List[FactCheckPrediction], int, float]: Tuple containing fact check predictions,
Create synthetic negative samples for fact checking. The negative samples are created by an LLM that acts as an adversary and modifies the answer to make it incorrect.
Parameters:
The dataset to create negative samples for.
Returns:
List[Dict]: The dataset with synthetic negative samples.
Run the fact checking evaluation and print the results.