nemoguardrails.evaluate.cli.evaluate
Module Contents
Functions
Data
API
Evaluate the performance of the fact-checking rails defined in a Guardrails application.
This command computes accuracy for fact-checking. Negatives can be created synthetically by an LLM that acts as an adversary and modifies the answer to make it incorrect.
Parameters:
The path to the guardrails config. Defaults to “config”.
Path to the folder containing the dataset. Defaults to “nemoguardrails/evaluate/data/factchecking/sample.json”.
Number of samples to be evaluated. Defaults to 50.
Create synthetic negative samples. Defaults to True.
Path to the folder where the outputs will be written. Defaults to “eval_outputs/factchecking”.
Write outputs to the output directory. Defaults to True.
Evaluate the performance of the hallucination rails defined in a Guardrails application.
This command computes accuracy for hallucination detection.
Parameters:
The path to the guardrails config. Defaults to “config”.
Dataset path. Defaults to “nemoguardrails/evaluate/data/hallucination/sample.txt”.
Number of samples to evaluate. Defaults to 50.
Output directory. Defaults to “eval_outputs/hallucination”.
Write outputs to file. Defaults to True.
Evaluate the performance of the moderation rails defined in a Guardrails application.
This command computes accuracy for jailbreak detection and output moderation.
Parameters:
The path to the guardrails config. Defaults to “config”.
Path to the dataset containing prompts. Defaults to “nemoguardrails/evaluate/data/moderation/harmful.txt”.
Number of samples to evaluate. Defaults to 50.
Evaluate the input self-check rail. Defaults to True.
Evaluate the output self-check rail. Defaults to True.
Output directory for predictions. Defaults to “eval_outputs/moderation”.
Write outputs to file. Defaults to True.
Whether prompts are harmful or helpful. Defaults to “harmful”.
Evaluates the performance of the topical rails defined in a Guardrails application. Computes accuracy for canonical form detection, next step generation, and next bot message generation. Only a single Guardrails application can be specified in the config option.
Parameters:
Path to a directory containing configuration files of the Guardrails application for evaluation. Can also point to a single configuration file. Defaults to [""].
If the chat should be verbose and output the prompts. Defaults to False.
Percentage of the samples for an intent to be used as test set. Defaults to 0.3.
Maximum number of test samples per intent to be used when testing. If value is 0, no limit is used. Defaults to 3.
Maximum number of samples per intent indexed in vector database. If value is 0, all samples are used. Defaults to 0.
Print evaluation intermediate results using this step. Defaults to 10.
Minimum similarity score to select the intent when exact match fails. Defaults to 0.0.
Random seed used by the evaluation. Defaults to None.
Output directory for predictions. Defaults to None.