Skip to content
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

wip: eval how to revamp #525

Merged
merged 30 commits into from
Nov 23, 2024
Merged

wip: eval how to revamp #525

merged 30 commits into from
Nov 23, 2024

Conversation

baskaryan
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langsmith-docs ✅ Ready (Inspect) Visit Preview 💬 25 unresolved
✅ 5 resolved
Nov 23, 2024 7:11pm

Copy link
Contributor

@agola11 agola11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some flyby comments but overall like the structure

docs/evaluation/how_to_guides/evaluation/async.mdx Outdated Show resolved Hide resolved
- [Run an evaluation using the SDK](./how_to_guides/evaluation/evaluate_llm_application)
- [Run an evaluation asynchronously](./how_to_guides/evaluation/async)
- [Run an evaluation comparing two experiments](./how_to_guides/evaluation/evaluate_pairwise)
- [Run an evaluation of a LangChain / LangGraph object](./how_to_guides/evaluation/langchain_runnable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth it to cover LangChain and LangGraph in separate guides?

There's some more interesting things in LG like evaluating a single node, traectory, etc. It might be worth it to call out the documentation for running a larger eval in the LG eval guide.

We have this tutorial I hacked together with Lance a while back but it's definitely overly complicated and I wonder if bits of it can be adapted to a more concise how to guide https://docs.smith.langchain.com/evaluation/tutorials/agents

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i kinda think this should live in langgraph docs and be linked from here

### Run an evaluation
- [Run an evaluation using the SDK](./how_to_guides/evaluation/evaluate_llm_application)
- [Run an evaluation asynchronously](./how_to_guides/evaluation/async)
- [Run an evaluation comparing two experiments](./how_to_guides/evaluation/evaluate_pairwise)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Run a comparative evaluation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agola11 can review this one

const score = rootRun.outputs?.outputs === example.outputs?.output;
return { key: "correct_label", score };
return { key: "correct", score };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this code correct? The score doesn't have a corresponding value....


`,
typescript`
// ToDo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to fill out before merging in?


# How to define an LLM-as-a-judge evaluator

:::info Key concepts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be part of this PR since it'll take too much time, but users want a lot more guidance on good LLM as judge definition than we give rn. Even our concepts doc isn't very helpful.

typescript`
import type { EvaluationResult } from "langsmith/evaluation";
import type { Run, Example } from "langsmith/schemas";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs code?


LangSmith supports both categorical and numerical metrics, and you can return either when writing a [custom evaluator](../../how_to_guides/evaluation/custom_evaluator).

For an evaluator result to be logged as a numerical metric, it must returned as:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only true for python, since js can't return just an int, right?

We should be clear about this

For an evaluator result to be logged as a numerical metric, it must returned as:

- an `int`, `float`, or `bool`
- a dict of the form `{"key": "metric_name", "score": int | float | bool}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a feedback[link to reference] dict of the form

typescript,
} from "@site/src/components/InstructionsWithCode";

# How to run an aggregate evaluation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way to make it clear to users who want to calculate things like f1 score that they should go here from our indexes? I feel like no one ever finds this page

@baskaryan baskaryan merged commit 1a148ed into main Nov 23, 2024
5 of 6 checks passed
@baskaryan baskaryan deleted the bagatur/eval_how_to_revamp branch November 23, 2024 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants