Custom Evaluators | LangSmith Evaluations - Part 6
Summary
TLDRこの動画スクリプトは、シリーズの第6回目の動画であり、長評価について焦点を当てています。動画では、評価が重要である理由、Langs Smith Primitivesの基礎、データセットの構築方法、開発者によるデータセットのカスタマイズ、ユーザーログからのデータセットの構築、評価器の使用方法について説明しています。特に、カスタム評価器の作成方法について詳細に説明しており、シンプルなアサーションに基づいた機能テストを通じて、システムが正しく動作していることを確認する方法を提案しています。
Takeaways
- 📈 シリーズの第6回目の動画で、長評価について焦点を当てています。
- 🌟 評価の重要性を説明し、Langs Smith Primitivesの基礎を築きました。
- 🛠️ データセットの構築方法を学び、Databricksを使用してカスタマイズしました。
- 📝 質問と回答のデータセットを作成し、編集と追加の方法を紹介しました。
- 🔍 ユーザーログからデータセットを構築し、フィードバックや質問をプラグインする方法を説明しました。
- 🧠 生成されたデータセットを使用して、ビルトインのライフチャイン評価器を用いてアプリを評価しました。
- 🤖 GDP-35を使用して質問に答え、手作業でキュレートされたデータセットと比較しました。
- 💡 カスタマイズされた評価器を作成し、答えが生成されたかどうかを確認する単純なアサーションを設定しました。
- 📊 評価器は、答えが存在するかどうかを判断し、単位テストのような機能を有する非常简单なアサーションです。
- 🔧 カスタム評価器を構築する際には、出力を抽出する能力が必要です。
- 🎯 カスタム評価器は非常に柔軟で、任意のスコアリング方法を選択できます。
- 📖 情報フローを理解し、例と実行の出力を利用することで、カスタム評価器の構築は非常に簡単です。
Q & A
ビデオ_SERIESの主題は何ですか?
-ビデオ_SERIESの主題は、言語評価に関するものです。
最初のビデオは何を説明していますか?
-最初のビデオでは、評価が重要である理由について説明しています。
Langs Smith Primitivesとは何ですか?
-Langs Smith Primitivesは、データセットの構築に使用される基本的な要素です。
データセットの構築方法について説明するビデオは何ですか?
-3番目のビデオがデータセットの構築方法について説明しています。
Databricksとは何ですか?
-Databricksは、データ分析と機械学習のためのプラットフォームです。
Databricksモデルを使用した質問回答データセットの構築方法について説明するブログ記事のリンクはどこにありますか?
-ブログ記事のリンクは、ビデオのスクリプトの途中部分に示されています。
ユーザーログからデータセットを構築する方法について説明するビデオは何ですか?
-4番目のビデオがユーザーログからデータセットを構築する方法について説明しています。
評価器とは何ですか?
-評価器は、アプリケーションの性能を判断するために使用されるツールです。
GPT-35とは何ですか?
-GPT-35は、OpenAIによって開発された自然言語処理のモデルです。
カスタム評価器を作成する場合、どのようなアサーションを使用することができますか?
-カスタム評価器を作成する場合、答えが生成されたかどうかを確認するようなシンプルなアサーションを使用することができます。
カスタム評価器を構築する際の主な利点は何ですか?
-カスタム評価器を構築する主な利点は、非常に柔軟で、任意の評価方法を適用できることです。
このビデオ_SERIESで説明された評価方法の適用範囲はどこまでですか?
-このビデオ_SERIESで説明された評価方法は、オフライン評価やCIなど、様々な場面で適用可能です。
Outlines
📝 評価方法の紹介とカスタマイズ
この段落では、シリーズの第六回目の動画として、評価方法について説明しています。最初の動画で重要性を述べ、二つ目の動画ではLangs Smithの基本原則を紹介しました。次に、データセットの構築方法について学び、Databricksモデルを使用して質問と回答のペアを編集し、追加する方法を示しました。さらに、ユーザーログからデータセットを構築する方法も紹介しました。そして、ビルトインのライフEvaluatorを使用して、シンプルなアプリを評価する方法を学びました。このアプリは与えられた文脈についての質問に答えることができます。GPD-35を使用して応答し、手動でキュレートされたデータセットと比較しています。
🔍 カスタマイズされた評価器の構築と活用
この段落では、独自の評価器を構築し、アプリの応答をテストする方法について説明しています。カスタマイズされた評価器は、答えが生成されたかどうかを確認するシンプルなアサーションです。これは、エミュレーションされたデータセットから質問と回答のペアを削除し、ハードコードされた判断基準(回答があるかどうか)を使用します。この方法は、単純な機能テストとして考えることができます。この場合、評価は使用されず、代わりにシンプルなアサーションが使われます。この関数は非常に簡単で、例として示しています。
Mindmap
Keywords
💡Langs Smith Primitives
💡データセット
💡評価器 (Evaluator)
💡GPD-35
💡カスタム評価器
💡アサーション
💡ユニットテスト
💡情報流 (Information Flow)
💡スコア付け (Scoring)
💡flexibility
💡メタデータ (Metadata)
Highlights
视频系列的第六部分专注于长度评估。
第一个视频解释了长度评估的重要性。
第二个视频介绍了核心Langs Smith Primitives。
第三部分讨论了如何构建数据集,特别是开发者策划的数据集。
展示了如何为Databricks构建一个问答数据集。
介绍了如何编辑和追加示例到数据集中。
展示了如何从用户日志构建数据集。
讨论了如何使用评估器,特别是在构建的问答应用中的内置Life with Evaluator。
使用GPD-35生成的回答与手动策划的数据集进行比较。
提出了构建自定义评估器的想法,例如简单的断言来检查答案是否生成。
介绍了自定义评估器的构建方法,强调了其灵活性和简便性。
自定义评估器是基于标准的评分,例如答案的存在与否。
讨论了自定义评估器可以用于离线评估,类似于持续集成中的测试。
通过一个简单的函数示例,说明了如何实现自定义评估器。
强调了自定义评估器的强大和通用性,以及它在实践中的便利性。
Transcripts
hi this is lash BL chain this is a sixth
video in our series um focus on langth
evaluations so in the first video we
just kind of laid out why are important
the second video we laid out the core
Langs Smith Primitives we then talked
about how to build data sets um first
developer curated we built one for the
datab bricks um The datab Brick model
which is discussed in this blog post so
we built a question answer data set um
and we showed how to edit that we showed
how to append um example to it we then
also showed how to build data sets from
user logs so if you like an app in
production you're you know getting
feedback questions from user you can
basically Plum those into a data
set um we then just talked through how
to use an evaluator uh in our particular
case uh built-in life with evaluator to
judge our app which we built here so we
a very simple app that answers questions
about a given context and Es case be
plunged in the blog post and we're using
G GPD 35 to answer questions we're
comparing those GPD 35 uh Generations or
or answers to our data set which was
manually curated so that's really it we
used uh a built-in L with evaluator
called coot QA which is very convenient
for question answering so that's kind of
where we are that's what we did now
let's build on this a little bit and
this kind of gives you a summary of what
we just
did now let's say I want to do something
different I want to find my own custom
evaluator
so let's say I want like a simple
assertion that act an answer actually
was generated or not like was there some
kind of like um you know failure in in
in generation of the answer so that you
know to turn some an empty string or or
you know uh there can be other reasons
why and L1 Sals to produce a generation
right so in this case I'm changing it up
a little bit I stole my data set a
question answer pairs dered from that
data post but in this case I want my
graders to be it's like I you're the
hardcoded decision it's just like is
there an answer or not right it's
reference free there isn't like a ground
truth there it's just like is there an
answer or not right so it's more like
criteria based uh grading in this case
you can this is where it's a little bit
squishy because you think of this more
as a unit test it's a very simple
assertion for functionality um as
opposed to it being an evaluation which
is using like an LM as a judge or human
as judge this is just like a quick test
is there an answer present or not and of
course this can be used you know in
offline evaluation potentially like Ci
right so it's like a nice test or sity
check that my system's actually working
so how would I do that so it's actually
really
simple this little function is actually
all you need but let me actually explain
a bit about what's going on here
remember our flow diagram let's actually
go back up so there's this run and
there's an example so the run is my app
basically my app as some output right so
the Run has this do output which is
basically the the dict or the object
that comes out of my app and then
likewise my example which I pass an
evaluator also has this dot outputs
which is basically everything that's
available to the example in my
particular case what I'm going to care
about is you know in typical evaluations
I often care about just the answer but
the point is uh when I'm doing
evaluation there's this example object
and if this run object and these two
things are being compared in some way so
that's really it so remember I have an
example and a run now if I build my
custom
evaluator I plum in that example and run
just like we just talked about and I
could just easily fish out from the run
which is my llm app I want to get the
answer now let's actually go all the way
back up and make sure we understand what
we just said so I'm going to go back to
my app here's my little app answer data
ver question open AI it returns a dict
with this answer key that's where me get
that answer thing from so that key
depends on my app in this case my app
returns you can see it's it's a dict
with answer in it that's it so that's
why in my custom evaluator when I go
down here I just go to my outputs from
the run again it runs my app the outputs
contains everything output by the app in
that case that output is a dict but has
a key answer so I'm fishing it out like
that and I do something really easy if
there's nothing there then it's not
answered otherwise it is as simple as it
gets remember I have this data set dbrx
I'm going to run on this so again here's
my app basically we already talked about
this here's the data set we already
showed how to build that this is my new
little evaluator is answered um I'm
going to create a new prefix for it uh
it's some new metadata kick that off
that should run pretty quick and I can
go over to my data set it's already done
so okay this is kind of interesting so
now you see two evaluations the first
one we show previously using the
built-in uh light chain evaluator now I
had this new one you can see it has this
new prefix and let's open it up and see
so in this case those scores are all one
because there is an answer every time
that's it that's a custom evaluator it
shows up here in Langs Smith this
scoring is arbitrary we can choose
different means of scoring but in this
particular case I just chose one or zero
shows up here that's it pretty simple um
and this is extremely flexible I mean
this is just a function it can be
anything you want again all you need is
the ability to fish out your
output you could do string matching
could do arbitrary different kinds of
evaluations and you can also include for
example llms in this to do arbitrary
reasoning over your answers and produce
scores so I've used this a whole lot
it's extremely convenient very flexible
and building customer values is
extremely simple particularly once you
understand that kind of that information
flow we showed here all that's happening
is I have an example I have a run each
of those has this outputs thing which
gives you access to in the case of my
run
that output object in my case it was
just a dict with answer and this do
outputs actually gives you access to
everything in this example that's really
it that's all I need to know um and
that's really all all I want to say
about building custom valuers it's very
powerful and very general thanks
Browse More Related Video
![](https://i.ytimg.com/vi/kl5U_efgK_8/hq720.jpg)
Eval Comparisons | LangSmith Evaluations - Part 7
![](https://i.ytimg.com/vi/hPqhQJPIVI8/hq720.jpg)
Datasets From Traces | LangSmith Evaluations - Part 4
![](https://i.ytimg.com/vi/N9hjO-Uy1Vo/hq720.jpg)
Manually Curated Datasets | LangSmith Evaluations - Part 3
![](https://i.ytimg.com/vi/OuFUy45RsHU/hq720.jpg)
Evaluation Primitives | LangSmith Evaluations - Part 2
![](https://i.ytimg.com/vi/y5GvqOi4bJQ/hq720.jpg)
Pre-Built Evaluators | LangSmith Evaluations - Part 5
![](https://i.ytimg.com/vi/vygFgCNR7WA/hq720.jpg)
Why Evals Matter | LangSmith Evaluations - Part 1
5.0 / 5 (0 votes)