Skip to content

Commit 67dee5c

Browse files
authored
Update evaluate-sdk.md
1 parent b91f46d commit 67dee5c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

articles/ai-foundry/how-to/develop/evaluate-sdk.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ model_config = AzureOpenAIModelConfiguration(
174174
api_version=os.environ.get("AZURE_API_VERSION"),
175175
)
176176

177-
# Initializing Groundedness and Groundedness Pro evaluators
177+
# Initializing the Groundedness and Groundedness Pro evaluators:
178178
groundedness_eval = GroundednessEvaluator(model_config)
179179

180180
conversation = {
@@ -186,7 +186,7 @@ conversation = {
186186
]
187187
}
188188

189-
# Alternatively, you can load the same content from a JSONL file
189+
# Alternatively, you can load the same content from a JSONL file.
190190
groundedness_conv_score = groundedness_eval(conversation=conversation)
191191
print(json.dumps(groundedness_conv_score, indent=4))
192192
```
@@ -241,10 +241,10 @@ from pathlib import Path
241241
from azure.ai.evaluation import ContentSafetyEvaluator
242242
import base64
243243

244-
# create an instance of an evaluator with image and multi-modal support
244+
# Create an instance of an evaluator with image and multi-modal support.
245245
safety_evaluator = ContentSafetyEvaluator(credential=azure_cred, azure_ai_project=project_scope)
246246

247-
# example of a conversation with an image URL
247+
# Example of a conversation with an image URL:
248248
conversation_image_url = {
249249
"messages": [
250250
{
@@ -277,7 +277,7 @@ conversation_image_url = {
277277
]
278278
}
279279

280-
# example of a conversation with base64 encoded images
280+
# Example of a conversation with base64 encoded images:
281281
base64_image = ""
282282

283283
with Path.open("Image1.jpg", "rb") as image_file:
@@ -293,7 +293,7 @@ conversation_base64 = {
293293
]
294294
}
295295

296-
# run the evaluation on the conversation to output the result
296+
# Run the evaluation on the conversation to output the result.
297297
safety_score = safety_evaluator(conversation=conversation_image_url)
298298
```
299299

@@ -350,12 +350,12 @@ To ensure the `evaluate()` API can correctly parse the data, you must specify co
350350
from azure.ai.evaluation import evaluate
351351

352352
result = evaluate(
353-
data="data.jsonl", # provide your data here
353+
data="data.jsonl", # Provide your data here
354354
evaluators={
355355
"groundedness": groundedness_eval,
356356
"answer_length": answer_length
357357
},
358-
# column mapping
358+
# Column mapping
359359
evaluator_config={
360360
"groundedness": {
361361
"column_mapping": {
@@ -365,9 +365,9 @@ result = evaluate(
365365
}
366366
}
367367
},
368-
# Optionally provide your Azure AI Foundry project information to track your evaluation results in your project portal
368+
# Optionally, provide your Azure AI Foundry project information to track your evaluation results in your project portal.
369369
azure_ai_project = azure_ai_project,
370-
# Optionally provide an output path to dump a json of metric summary, row level data and metric and Azure AI project URL
370+
# Optionally, provide an output path to dump a JSON file of metric summary, row level data, and metric and Azure AI project URL.
371371
output_path="./myevalresults.json"
372372
)
373373
```

0 commit comments

Comments
 (0)