-
Notifications
You must be signed in to change notification settings - Fork 68
improve docs for attaching evaluator to dataset #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
samnoyes
wants to merge
1
commit into
main
Choose a base branch
from
sam/bind-dataset-rule
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 | ||||
---|---|---|---|---|---|---|
|
@@ -2,7 +2,7 @@ | |||||
sidebar_position: 2 | ||||||
--- | ||||||
|
||||||
# How to bind an evaluator to a dataset in the UI | ||||||
# Automatically run evaluators on experiments | ||||||
|
||||||
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. We have support for both LLM-based evaluators, and custom python code evaluators. | ||||||
|
@@ -13,40 +13,18 @@ The process for configuring this is very similar to the process for configuring | |||||
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 Auto-Evaluator` button** to add an evaluator to the dataset. This will open a modal you can use to configure the evaluator. | ||||||
1. **Navigate to the dataset details page** by clicking **Datasets and Experiments** in the sidebar and selecting the dataset you want to configure the evaluator for. | ||||||
2. **Click on the `+ Evaluator` button** to add an evaluator to the dataset. This will open a pane you can use to configure the evaluator. | ||||||
|
||||||
The next steps vary based on the evaluator type. | ||||||
|
||||||
## LLM as judge evaluators | ||||||
## LLM as a judge evaluators | ||||||
|
||||||
1. **Select the LLM as judge type evaluator** | ||||||
2. **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. | ||||||
[See this page for instructions on setting up an LLM-as-a-judge evaluator](./llm_as_judge?mode=ui#customize-your-llm-as-a-judge-evaluator) | ||||||
|
||||||
 | ||||||
Once you have saved your new evaluator, **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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
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. | ||||||
|
||||||
 | ||||||
|
||||||
3. **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. | ||||||
|
||||||
 | ||||||
 | ||||||
|
||||||
## Custom code evaluators | ||||||
|
||||||
|
This file contains hidden or 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 hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.