9
9
from azure .ai .evaluation ._evaluators ._common import RaiServiceEvaluatorBase
10
10
11
11
@experimental
12
- class ISAEvaluator (RaiServiceEvaluatorBase [Union [str , bool ]]):
12
+ class UngroundedAttributesEvaluator (RaiServiceEvaluatorBase [Union [str , bool ]]):
13
13
"""
14
- Evaluates ungrounded inference of sensitive attributes for a given query, response, and context for a single-turn
15
- evaluation only, where query represents the user query and response represents the AI system response given the provided context.
14
+ Evaluates ungrounded inference of human attributes for a given query, response, and context for a single-turn evaluation only,
15
+ where query represents the user query and response represents the AI system response given the provided context.
16
16
17
- Inference of Sensitive Attribute checks for whether a response is first, ungrounded, and checks if it contains information
18
- about protected class or emotional state of someone .
17
+ Ungrounded Attributes checks for whether a response is first, ungrounded, and checks if it contains information about protected class or
18
+ emotional state of a person .
19
19
20
- The inference of sensitive attributes evaluation identifies the following vulnerabilities:
20
+
21
+ It identifies the following attributes:
21
22
22
23
- emotional_state
23
24
- protected_class
@@ -34,19 +35,19 @@ class ISAEvaluator(RaiServiceEvaluatorBase[Union[str, bool]]):
34
35
.. admonition:: Example:
35
36
36
37
.. literalinclude:: ../samples/evaluation_samples_evaluate.py
37
- :start-after: [START isa_evaluator ]
38
- :end-before: [END isa_evaluator ]
38
+ :start-after: [START ungrounded_attributes_evaluator ]
39
+ :end-before: [END ungrounded_attributes_evaluator ]
39
40
:language: python
40
41
:dedent: 8
41
- :caption: Initialize and call a ISAEvaluator with a query, response and context.
42
+ :caption: Initialize and call a UngroundedAttributesEvaluator with a query, response and context.
42
43
43
44
.. note::
44
45
45
46
If this evaluator is supplied to the `evaluate` function, the metric
46
- for the inference of sensitive attributes will be "inference_sensitive_attributes_label ".
47
+ for the ungrounded attributes will be "ungrounded_attributes_label ".
47
48
"""
48
49
49
- id = "inference_sensitive_attributes "
50
+ id = "ungrounded_attributes "
50
51
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
51
52
52
53
@override
@@ -56,7 +57,7 @@ def __init__(
56
57
azure_ai_project ,
57
58
):
58
59
super ().__init__ (
59
- eval_metric = EvaluationMetrics .ISA ,
60
+ eval_metric = EvaluationMetrics .UNGROUNDED_ATTRIBUTES ,
60
61
azure_ai_project = azure_ai_project ,
61
62
credential = credential ,
62
63
)
@@ -69,15 +70,15 @@ def __call__(
69
70
response : str ,
70
71
context : str ,
71
72
) -> Dict [str , Union [str , float ]]:
72
- """Evaluate a given query/response pair and context for inference of sensitive attributes
73
+ """Evaluate a given query/response pair and context for ungrounded attributes
73
74
74
75
:keyword query: The query to be evaluated.
75
76
:paramtype query: str
76
77
:keyword response: The response to be evaluated.
77
78
:paramtype response: str
78
79
:keyword context: The context to be used for evaluation.
79
80
:paramtype context: str
80
- :return: The inference of sensitive attributes label.
81
+ :return: The ungrounded attributes label.
81
82
:rtype: Dict[str, Union[str, bool]]
82
83
"""
83
84
@@ -87,15 +88,15 @@ def __call__( # pylint: disable=docstring-missing-param
87
88
* args ,
88
89
** kwargs ,
89
90
):
90
- """Evaluate a given query/response pair and context for inference of sensitive attributes
91
+ """Evaluate a given query/response pair and context for ungrounded attributes
91
92
92
93
:keyword query: The query to be evaluated.
93
94
:paramtype query: str
94
95
:keyword response: The response to be evaluated.
95
96
:paramtype response: str
96
97
:keyword context: The context to be used for evaluation.
97
98
:paramtype context: str
98
- :return: The inference of sensitive attributes label.
99
+ :return: The ungrounded attributes label.
99
100
:rtype: Dict[str, Union[str, bool]]
100
101
"""
101
102
0 commit comments