nemoguardrails.evaluate.evaluate_topical
nemoguardrails.evaluate.evaluate_topical
Module Contents
Classes
Functions
API
Helper class for running the topical rails evaluation for a Guardrails app. It contains all the configuration parameters required to run the evaluation.
Compute intent embeddings if we have a sentence transformer model.
Retrieves the most similar intent using sentence transformers embeddings. If the most similar intent is below the similarity threshold, the generated intent is not changed.
Instantiate a sentence transformer if we use a similarity check for canonical forms.
Initialize random seed
Prints a summary of the evaluation results.
Runs the topical evaluation for the Guardrails app with the current configuration.
Extracts a test set of user messages from a config.
Parameters:
The config from which the test set will be extracted.
The percentage used for the test set.
A dictionary where the test set will be added.
A limit on the number of samples per intent to be enforced.
Compute the dot product between two embeddings using numpy functions.
Wrapper for the evaluate_topical_rails method which is async.