-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
85 additions
and
63 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
versioned_docs/version-2.0/how_to_guides/evaluation/bind_evaluator_to_dataset.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Bind an evaluator to a dataset in the UI | ||
|
||
While you can specify evaluators to grade the results of your experiments programmatically (see [this guide](./evaluate_llm_application) for more information), you can also bind evaluators to a dataset in the UI. | ||
This allows you to configure automatic evaluators that grade your experiment results without having to write any code. Currently, only LLM-based evaluators are supported. | ||
|
||
The process for configuring this is very similar to the process for configuring an [online evaluator](../monitoring/online_evaluations) for traces. | ||
|
||
:::note Only affects subsequent experiment runs | ||
|
||
When you configure an evaluator for a dataset, it will only affect the experiment runs that are created after the evaluator is configured. It will not affect the evaluation of experiment runs that were created before the evaluator was configured. | ||
|
||
::: | ||
|
||
1. **Navigate to the dataset details page** by clicking **Datasets and Testing** in the sidebar and selecting the dataset you want to configure the evaluator for. | ||
2. **Click on the `Add Evaluator` button** to add an evaluator to the dataset. This will open a modal you can use to configure the evaluator. | ||
|
||
![Add Evaluator](../static/add_evaluator.png) | ||
|
||
3. **Give your evaluator a name** and **set an inline prompt or load a prompt from the prompt hub** that will be used to evaluate the results of the runs in the experiment. | ||
|
||
![Add evaluator name and prompt](../static/create_evaluator.png) | ||
|
||
Importantly, evaluator prompts can only contain the following input variables: | ||
|
||
- `input` (required): the input to the target you are evaluating | ||
- `output` (required): the output of the target you are evaluating | ||
- `reference`: the reference output, taken from the dataset | ||
|
||
:::note | ||
|
||
Automatic evaluators you configure in the application will only work if the `inputs` to your evaluation target, `outputs` from your evaluation target, and `examples` in your dataset are all single-key dictionaries. | ||
LangSmith will automatically extract the values from the dictionaries and pass them to the evaluator. | ||
|
||
LangSmith currently doesn't support setting up evaluators in the application that act on multiple keys in the `inputs` or `outputs` or `examples` dictionaries. | ||
|
||
::: | ||
|
||
You can specify the scoring criteria in the "schema" field. In this example, we are asking the LLM to grade on "correctness" of the output with respect to the reference, with a boolean output of 0 or 1. The name of the field in the schema will be interpreted as the feedback key and the type will be the type of the score. | ||
|
||
![Evaluator prompt](../static/evaluator_prompt.png) | ||
|
||
4. **Save the evaluator** and navigate back to the dataset details page. Each **subsequent** experiment run from the dataset will now be evaluated by the evaluator you configured. Note that in the below image, each run in the experiment has a "correctness" score. | ||
|
||
![Playground evaluator results](../static/playground_evaluator_results.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
import { | ||
CodeTabs, | ||
python, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters