Skip to content

Commit cb7b951

Browse files
committed
edits
1 parent ba8792d commit cb7b951

13 files changed

+21
-21
lines changed

articles/machine-learning/prompt-flow/how-to-evaluate-semantic-kernel.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ ms.topic: how-to
1212
author: lgayhardt
1313
ms.author: lagayhar
1414
ms.reviewer: chenlujiao
15-
ms.date: 10/11/2024
15+
ms.date: 10/14/2024
1616
---
1717

1818
# Evaluate Semantic Kernel with prompt flow
1919

20-
This article describes the seamless integration between prompt flow and [Semantic Kernel](/semantic-kernel/overview/), and demonstrates how to evaluate Semantic Kernal plugins and planners by using prompt flow. In the rapidly evolving landscape of AI orchestration, a comprehensive evaluation of your plugins and planners is important for optimal performance.
20+
This article describes the seamless integration between prompt flow and [Semantic Kernel](/semantic-kernel/overview/), and demonstrates how to evaluate Semantic Kernel plugins and planners by using prompt flow. In the rapidly evolving landscape of AI orchestration, a comprehensive evaluation of your plugins and planners is important for optimal performance.
2121

22-
Semantic Kernel is an open-source SDK that lets you easily combine AI services with programming languages like C# and Python to create AI apps that combine the best of both worlds. Semantic Kernel provides [plugins](/semantic-kernel/ai-orchestration/plugins) and [planners](/semantic-kernel/ai-orchestration/planners), which are powerful tools that use AI capabilities to optimize operations, thereby driving efficiency and accuracy in planning.
22+
Semantic Kernel is an open-source SDK that lets you easily combine AI services with programming languages like C# and Python to create AI apps that combine the best of both worlds. Semantic Kernel provides [plugins](/semantic-kernel/ai-orchestration/plugins) and [planners](/semantic-kernel/ai-orchestration/planners), which are powerful tools that use AI capabilities to optimize operations, thus driving efficiency and accuracy in planning.
2323

24-
As you build plugins and add them to planners, it's important to make sure they work as intended. Adding more plugins increases the potential for errors. Testing plugins and planners used to be a manual, time-consuming process. Now you can use prompt flow to automate this process.
24+
As you build and add more plugins to planners, the potential for errors increases, so it's important to make sure they work as intended. Testing plugins and planners used to be a manual, time-consuming process. Now you can use prompt flow to automate this process.
2525

2626
The integration of Semantic Kernel with prompt flow allows you to:
2727

@@ -30,23 +30,23 @@ The integration of Semantic Kernel with prompt flow allows you to:
3030

3131
## Prerequisites
3232

33-
- Before you start developing the flow, you must install the [Semantic Kernel package](/semantic-kernel/get-started/quick-start-guide/?toc=%2Fsemantic-kernel%2Ftoc.json&tabs=python) in your *requirements.txt* for the executor. For more information, see [How to manage compute session](how-to-manage-compute-session.md).
33+
- Before you start developing the flow, you must add the [Semantic Kernel package](/semantic-kernel/get-started/quick-start-guide/?toc=%2Fsemantic-kernel%2Ftoc.json&tabs=python) to your *requirements.txt* for the executor to install. For more information, see [Manage prompt flow compute session](how-to-manage-compute-session.md).
3434

3535
- To use Semantic Kernel to consume Azure OpenAI or OpenAI resources in a prompt flow, you must create a custom connection.
3636

37-
1. Obtain the keys you specified for the resources in environment variables or in an *.env* file.
37+
1. Obtain the keys you specified for the resources in environment variables or an *.env* file.
3838

3939
1. Select **Create** from the **Connection** tab on the Azure Machine Learning studio **Prompt flow** page, and select **Custom** provider.
4040

4141
1. Convert the keys from environment variables to key-value pairs in the custom connection.
4242

4343
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/custom-connection-for-semantic-kernel.png" alt-text="Screenshot of custom connection." lightbox = "./media/how-to-evaluate-semantic-kernel/custom-connection-for-semantic-kernel.png":::
4444

45-
1. You can now use this custom connection to invoke your Azure OpenAI or OpenAI model within the flow.
45+
You can now use this custom connection to invoke your Azure OpenAI or OpenAI model within the flow.
4646

4747
## Create a flow with Semantic Kernel
4848

49-
Similar to the integration of LangChain with prompt flow, Semantic Kernel supports Python and can operate in a Python node within a prompt flow.
49+
Similar to the [integration of LangChain with prompt flow](how-to-integrate-with-langchain.md), Semantic Kernel supports Python and can operate in a Python node within a prompt flow.
5050

5151
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/prompt-flow-end-result.png" alt-text="Diagram of prompt flow with Semantic Kernel." border="false":::
5252

@@ -55,8 +55,8 @@ For this example, you create a flow with a Semantic Kernel planner that solves m
5555
1. From the **Prompt flow** page, select **Create**.
5656
1. On the **Create a new flow** screen, select **Create** in the **Standard flow** tile.
5757
1. At the top of the new flow, select **+ Python** to create a new Python node, and name the node *math_planner*.
58-
1. Select **+** at the top of the **Files** tab to upload reference files such as the **MathPlugin**.
59-
1. Update the code in *math_planner.py* to set up the connection and define the input and output of the planner node.
58+
1. Select **+** at the top of the **Files** tab to upload reference files such as the MathPlugin from the Semantic Kernel package.
59+
1. Update the the *math_planner.py* code to set up the connection and define the input and output of the planner node.
6060

6161
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/set-connection-in-python.png" alt-text="Screenshot of setting custom connection in python node.":::
6262

@@ -68,34 +68,34 @@ For this example, you create a flow with a Semantic Kernel planner that solves m
6868

6969
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/semantic-kernel-flow.png" alt-text="Screenshot of creating a flow with semantic kernel planner." lightbox = "./media/how-to-evaluate-semantic-kernel/semantic-kernel-flow.png":::
7070

71-
### Batch test your plugins and planners
71+
## Batch test your plugins and planners
7272

7373
Instead of manually testing each different scenario, you can automatically run large batches of tests using prompt flow and benchmark data.
7474

75-
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/using-batch-runs-with-prompt-flow.png" alt-text="Diagram showing batch runs with prompt flow for Semantic Kernel." border="false":::
76-
7775
Use batches with prompt flow to run batch tests on your planner that uses the math plugin. By defining several word problems, you can quickly test any changes to your plugins or planners so you can catch regressions early.
7876

79-
Once your flow has passed a single test run, you can create a batch test in prompt flow.
77+
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/using-batch-runs-with-prompt-flow.png" alt-text="Diagram showing batch runs with prompt flow for Semantic Kernel." border="false":::
78+
79+
Once your flow passes a single test run, you can create a batch test in prompt flow.
8080

8181
1. Create your benchmark data in a *.jsonl* file as a list of JSON objects that contain the input and the correct ground truth.
82-
1. Select **Evaluate** from the top menu.
83-
1. Complete the **Basic settings** and the **Batch run settings** by uploading your data file.
82+
1. In the prompt flow, select **Evaluate** from the top menu.
83+
1. Complete the **Basic settings**, upload your data file, and complete the **Batch run settings**.
8484
1. For this test, skip the optional **Evaluation settings** and select **Review + submit**, then select **Submit** to submit the batch run.
8585

8686
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/semantic-kernel-test-data.png" alt-text="Screenshot of data of batch runs with prompt flow for Semantic Kernel." lightbox = "./media/how-to-evaluate-semantic-kernel/semantic-kernel-test-data.png":::
8787

88-
1. Select your run on the prompt flow **Runs** page.
88+
1. When the run finishes, select the run name on the prompt flow **Runs** page.
8989

9090
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/run.png" alt-text="Screenshot of the run list." lightbox = "./media/how-to-evaluate-semantic-kernel/run.png":::
9191

92-
1. Select **Details** at the top of the run page.
92+
1. At the top of the run page, select **Details**.
9393

9494
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/run-detail.png" alt-text="Screenshot of the run detail." lightbox = "./media/how-to-evaluate-semantic-kernel/run-detail.png":::
9595

9696
1. On the **Details** page, select the **Outputs** tab to see the results.
9797

98-
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/run-output.png" alt-text="Screenshot of the run output." lightbox = "./media/how-to-evaluate-semantic-kernel/run-output.png":::
98+
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/run-output.png" alt-text="Screenshot of the run output." lightbox = "./media/how-to-evaluate-semantic-kernel/run-output.png":::
9999

100100
## Evaluate accuracy
101101

@@ -131,7 +131,7 @@ If you find that your plugins and planners aren't performing as well as they sho
131131

132132
A combination of these three actions can turn a failing planner into a winning one. By the end of the enhancement and evaluation process, you should have a planner that can correctly answer all of the benchmark data.
133133

134-
Through the process of enhancing your plugins and planners in prompt flow, you can use the runs to monitor your experimental progress. Each iteration allows you to submit a batch run with an evaluation run at the same time.
134+
Throughout the process of enhancing your plugins and planners in prompt flow, you can use the runs to monitor your experimental progress. Each iteration allows you to submit a batch run with an evaluation run at the same time.
135135

136136
:::image type="content" source="./media/how-to-evaluate-semantic-kernel/batch-evaluation.png" alt-text="Screenshot of batch run with evaluation." lightbox = "./media/how-to-evaluate-semantic-kernel/batch-evaluation.png":::
137137

@@ -145,7 +145,7 @@ The **Visualize outputs** screen shows a detailed table with a line-by-line comp
145145

146146
## Related content
147147

148-
- [Semantic Kernal documentation](/semantic-kernel/)
148+
- [Semantic Kernel documentation](/semantic-kernel/)
149149
- [What is a Plugin?](/semantic-kernel/ai-orchestration/plugins)
150150
- [What is a Planner?](/semantic-kernel/ai-orchestration/planners/evaluate-and-deploy-planners/)
151151
- [Deploy a flow as a managed online endpoint for real-time inference](how-to-deploy-for-real-time-inference.md)
14.5 KB
Loading
12.5 KB
Loading
1.14 KB
Loading
14.7 KB
Loading
10.8 KB
Loading
12.2 KB
Loading
1.75 KB
Loading
16.2 KB
Loading
950 Bytes
Loading

0 commit comments

Comments
 (0)