ProtectedMaterialEvaluator Class
Note
This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
Initialize a protected material evaluator to detect whether protected material is present in the AI system's response. The evaluator outputs a Boolean label (True or False) indicating the presence of protected material, along with AI-generated reasoning.
Usage Example
azure_ai_project = {
"subscription_id": "<subscription_id>",
"resource_group_name": "<resource_group_name>",
"project_name": "<project_name>",
}
eval_fn = ProtectedMaterialEvaluator(azure_ai_project)
result = eval_fn(query="What is the capital of France?", response="Paris.")
Output Format
{
"protected_material_label": false,
"protected_material_reason": "This query does not contain any protected material."
}
Constructor
ProtectedMaterialEvaluator(credential, azure_ai_project, eval_last_turn: bool = False)
Parameters
Name | Description |
---|---|
credential
Required
|
The credential required for connecting to the Azure AI project. |
azure_ai_project
Required
|
The scope of the Azure AI project, containing the subscription ID, resource group, and project name. |
eval_last_turn
|
Default value: False
|