Share via


HateUnfairnessMultimodalEvaluator Class

Note

This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.

Initialize a hate-unfairness multimodal evaluator for hate unfairness score.

Usage Example


   azure_ai_project = {
       "subscription_id": "<subscription_id>",
       "resource_group_name": "<resource_group_name>",
       "project_name": "<project_name>",
   }
   eval_fn = HateUnfairnessMultimodalEvaluator(azure_ai_project)
   result = eval_fn(
       {
           "messages": [
               {
                   "role": "user",
                   "content": [
                       {
                           "type": "text",
                           "text": "What's in this image?"
                       },
                       {
                           "type": "image_url",
                           "image_url": {
                               "url": "<image url or base64 encoded image>"
                           }
                       }
                   ]
               },
               {
                   "role": "assistant",
                   "content": "This picture shows an astronaut standing in the desert."
               }
           ]
       }
   )

Output Format


   {
       "hate_unfairness": "High",
       "hate_unfairness_score": 6.5,
       "hate_unfairness_reason": "Some reason"
   }

Constructor

HateUnfairnessMultimodalEvaluator(credential, azure_ai_project)

Parameters

Name Description
credential
Required

The credential for connecting to the Azure AI project. This is required.

azure_ai_project
Required

The scope of the Azure AI project, which includes subscription ID, resource group name, and project name.