import{s as xt,n as gt,o as Vt}from"../chunks/scheduler.1f027d5a.js";import{S as Xt,i as vt,e as M,s as n,c as y,h as Wt,a as p,d as t,b as a,f as Gt,g as J,j as i,k as Zt,l as Nt,m as e,n as U,t as T,o as j,p as w}from"../chunks/index.6117a65d.js";import{C as _t}from"../chunks/CopyLLMTxtMenu.0ff8411a.js";import{D as $t,C as o}from"../chunks/DocNotebookDropdown.316c3715.js";import{H as fl,E as Rt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.0eecd2bb.js";function Qt(Es){let r,xl,Gl,gl,m,Vl,u,Xl,c,vl,h,ks='<em>作者: <a href="https://huggingface.co/m-ric" rel="nofollow">Aymeric Roucher</a></em>',Wl,b,Ys="评估大型语言模型（LLMs）通常是一项困难的任务：由于他们能力广泛，给它们分配的任务时通常应该根据非常泛且松散的要求来判断。例如，AI 对问题的回答可能是：",Nl,I,Hs="<li>不基于上下文</li> <li>重复、重复、重复</li> <li>语法错误</li> <li>过于冗长，用词过多，导致话语或书面内容过于详细和拖沓</li> <li>不连贯</li> <li>…</li>",_l,d,zs="这些标准的列表还有很多。即使我们有一个有限的列表，每一个标准的衡量都是困难的：“制定一个基于规则的程序来评估输出是非常具有挑战性的。传统的评估指标，基于输出和参考答案之间的相似性（例如，ROUGE、BLEU），对于这些问题也无效。”",$l,C,Fs=`✅ 一种强大的解决方案，可以在不需要昂贵人力的前提下，以人类的方式评估输出，就是使用 LLM 作为评判者。
这种方法在 <a href="https://huggingface.co/papers/2306.05685" rel="nofollow">《Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena》</a> 中被介绍 - 推荐阅读这篇文章。`,Rl,B,As=`💡 这个想法很简单：让 LLM 为你评分。 🤖✓
但我们将会看到，它不能直接很好地适配：你需要仔细设置才能得到好的结果。`,Ql,f,ql,G,El,Z,kl,x,Yl,g,Ls="假设你想给 LLM 一个特定任务，比如回答开放式问题。",Hl,V,Ss="困难在于，正如我们上面讨论的，衡量答案质量是困难的，例如，精确的字符串匹配会错误地将许多正确但措辞不同的答案标记为错误。",zl,X,Ps="你可以让人类标签员评判输出，但这会花费他们很多时间，如果你想更新模型或问题，你必须重新做一遍。",Fl,v,Ds="✅ 在这种情况下，你可以设置一个 LLM 作为评判者。",Al,W,Ks="<strong>但是要使用 LLM 作为评判者，你首先需要评估它对模型输出的评分有多可靠。</strong>",Ll,N,Os="➡️ 所以第一步将是… 创建一个人工评估数据集。但你只需要为少数示例获取人工标注 - 大约 30 个应该足以对性能有一个好的了解。",Sl,_,lt="每次你想测试你的 LLM 作为评判者时，你都可以重新使用这个数据集。",Pl,$,st='在我们的案例中，我们将使用 <a href="https://huggingface.co/datasets/McGill-NLP/feedbackQA" rel="nofollow"><code>feedbackQA</code></a>，它包含每个问题/答案对的 2 个人类评估和评分：使用 30 个示例的样本将代表你的小型评估数据集可能的样子。',Dl,R,Kl,Q,tt='计算性能基准线是一个好主意：例如，这里可以是两个人类评分者之间的评分一致性，通过他们给出的分数的<a href="https://en.wikipedia.org/wiki/Pearson_correlation_coefficient" rel="nofollow">皮尔逊相关系数</a>来衡量。',Ol,q,ls,E,et=`Correlation between 2 human raters:
0.563
`,ss,k,nt="两个真人评委之间的相关性并不是那么好。如果你们的真人评分真的很差，这可能意味着评分标准不够清晰。",ts,Y,at="这意味着我们的“真实情况”包含了一些噪音：因此我们不能期望任何算法评估能够非常接近它。",es,H,Mt="然而，我们可以减少这种噪音：",ns,z,pt="<li>通过取平均分作为我们的真实情况，而不是任何一个单独的分数，我们应该能够平衡一些不规则性。</li> <li>只选择人类评审员达成一致意见的样本。</li>",as,F,it="在这里，我们将选择最后一个选项，并且<strong>只保留两个人类评审员达成一致意见的示例</strong>。",Ms,A,ps,L,is,S,yt="我们使用一个基本提示来构建我们的 LLM 评判者，包含以下元素：",ys,P,Jt="<li>任务描述</li> <li>标度描述：<code>最小值</code>，<code>最大值</code>，值类型（这里为<code>浮点数</code>）</li> <li>输出格式的解释</li> <li>一个答案的开头，尽可能引导 LLM</li>",Js,D,Us,K,Ts,O,js,ll,ws,sl,Ut=`Correlation between LLM-as-a-judge and the human raters:
0.567
`,os,tl,Tt="这已经不错了，考虑到两个随机、独立变量之间的皮尔逊相关系数会是 0！",rs,el,jt="但我们很容易做得更好。🔝",ms,nl,us,al,wt=`正如 <a href="https://twitter.com/aparnadhinak/status/1748368364395721128" rel="nofollow">Aparna Dhinakaran</a> 所说的，LLM 在评估连续范围的输出方面表现不佳。
<a href="https://www.databricks.com/blog/LLM-auto-eval-best-practices-RAG" rel="nofollow">这篇文章</a>为我们提供了一些构建更好提示的最佳实践：`,cs,Ml,ot="<li>⏳ <strong>增加思考时间</strong>，在最终答案前添加一个<code>评估</code>字段。</li> <li>🔢 <strong>使用较小的整数刻度</strong>，比如 1-4 或 1-5，而不是我们之前使用的大范围浮点刻度。</li> <li>👩‍🏫 <strong>提供一个指导性的刻度</strong>。</li> <li>我们甚至添加了一个激励 LLM 的“胡萝卜”(这里指给它一点额外的激励，就像给人一个奖励一样。)！</li>",hs,pl,bs,il,Is,yl,ds,Jl,rt=`Correlation between LLM-as-a-judge and the human raters:
0.843
`,Cs,Ul,mt="通过对提示的少量调整，相关性<strong>提高了近 30%</strong>（其中几个百分点是因为我无耻地给了 LLM 一个小提示，我在此声明该提示不具有法律约束力）。",Bs,Tl,ut="相当令人印象深刻！👏",fs,jl,ct="让我们展示一些 LLM 评判者的错误来分析它们：",Gs,wl,Zs,ol,ht="我们的 LLM 评判者的不一致之处很微小：总体来看，我们的系统似乎已经达到了不错的性能水平！",xs,rl,gs,ml,bt="🎯 <strong>你永远达不到 100%：</strong> 首先，我们的人类基准肯定包含一些噪音，所以即使有完美的 LLM 评判者，一致性和相关性也不可能达到 100%。",Vs,ul,It="🧭 <strong>提供参考信息：</strong> 如果你每个问题都有一个参考答案，你绝对应该在 LLM 评判者的提示中提供这些信息，以获得更好的结果！",Xs,cl,dt="▶️ <strong>提供少量示例：</strong> 在提示中添加一些问题和基准评估的少量示例可以改善结果。 <em>(我这里尝试了，但在这个案例中并没有改善结果，所以我省略了，但这可能对你的数据集有效！)</em>",vs,hl,Ct="➕ <strong>累加刻度：</strong> 当评判可以分解为原子性标准时，使用累加刻度可以进一步改善结果：如下所示 👇",Ws,bl,Ns,Il,_s,dl,Bt="今天的内容就到这里，恭喜你跟到这里！🥳",$s,Cl,ft="我必须得走了，一群奇奇怪怪的人正在敲我的门，声称他们是代表 Mixtral 来收取 H100s 的。🤔",Rs,Bl,Qs,Zl,qs;return m=new $t({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/zh-CN/llm_judge.ipynb"}]}}),u=new _t({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),c=new fl({props:{title:"使用 LLM 作为评判者🧑‍⚖️进行自动化和多方面的评估",local:"使用-llm-作为评判者进行自动化和多方面的评估",headingTag:"h1"}}),f=new o({props:{code:"IXBpcCUyMGluc3RhbGwlMjBodWdnaW5nZmFjZV9odWIlMjBkYXRhc2V0cyUyMHBhbmRhcyUyMHRxZG0lMjAtcQ==",highlighted:"!pip install huggingface_hub datasets pandas tqdm -q",wrap:!1}}),G=new o({props:{code:"aW1wb3J0JTIwcmUlMEFpbXBvcnQlMjBwYW5kYXMlMjBhcyUyMHBkJTBBZnJvbSUyMHRxZG0uYXV0byUyMGltcG9ydCUyMHRxZG0lMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwSW5mZXJlbmNlQ2xpZW50JTJDJTIwbm90ZWJvb2tfbG9naW4lMEElMEF0cWRtLnBhbmRhcygpJTIwJTIwJTIzJTIwbG9hZCUyMHRxZG0ncyUyMHBhbmRhcyUyMHN1cHBvcnQlMEFwZC5zZXRfb3B0aW9uKCUyMmRpc3BsYXkubWF4X2NvbHdpZHRoJTIyJTJDJTIwTm9uZSklMEElMEFub3RlYm9va19sb2dpbigp",highlighted:`<span class="hljs-keyword">import</span> re
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">from</span> tqdm.auto <span class="hljs-keyword">import</span> tqdm
<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> InferenceClient, notebook_login

tqdm.pandas()  <span class="hljs-comment"># load tqdm&#x27;s pandas support</span>
pd.set_option(<span class="hljs-string">&quot;display.max_colwidth&quot;</span>, <span class="hljs-literal">None</span>)

notebook_login()`,wrap:!1}}),Z=new o({props:{code:"cmVwb19pZCUyMCUzRCUyMCUyMm1pc3RyYWxhaSUyRk1peHRyYWwtOHg3Qi1JbnN0cnVjdC12MC4xJTIyJTBBJTBBbGxtX2NsaWVudCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudCglMEElMjAlMjAlMjAlMjBtb2RlbCUzRHJlcG9faWQlMkMlMEElMjAlMjAlMjAlMjB0aW1lb3V0JTNEMTIwJTJDJTBBKSUwQSUwQSUyMyUyMFRlc3QlMjB5b3VyJTIwTExNJTIwY2xpZW50JTBBbGxtX2NsaWVudC50ZXh0X2dlbmVyYXRpb24ocHJvbXB0JTNEJTIySG93JTIwYXJlJTIweW91JTIwdG9kYXklM0YlMjIlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDIwKQ==",highlighted:`repo_id = <span class="hljs-string">&quot;mistralai/Mixtral-8x7B-Instruct-v0.1&quot;</span>

llm_client = InferenceClient(
    model=repo_id,
    timeout=<span class="hljs-number">120</span>,
)

<span class="hljs-comment"># Test your LLM client</span>
llm_client.text_generation(prompt=<span class="hljs-string">&quot;How are you today?&quot;</span>, max_new_tokens=<span class="hljs-number">20</span>)`,wrap:!1}}),x=new fl({props:{title:"1. 准备创建和评估我们的 LLM 评判者",local:"1-准备创建和评估我们的-llm-评判者",headingTag:"h2"}}),R=new o({props:{code:"cmF0aW5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IyQ291bGQlMjBiZSUyMEltcHJvdmVkJTIyJTNBJTIwMiUyQyUyMCUyMkJhZCUyMiUzQSUyMDElN0QlMEFyYXRpbmdzJTVCJTIyc2NvcmVfMSUyMiU1RCUyMCUzRCUyMHJhdGluZ3MlNUIlMjJyZXZpZXdfMSUyMiU1RC5tYXAoY29udmVyc2lvbl9kaWN0KSUwQXJhdGluZ3MlNUIlMjJzY29yZV8yJTIyJTVEJTIwJTNEJTIwcmF0aW5ncyU1QiUyMnJldmlld18yJTIyJTVELm1hcChjb252ZXJzaW9uX2RpY3Qp",highlighted:`ratings = load_dataset(<span class="hljs-string">&quot;McGill-NLP/feedbackQA&quot;</span>)[<span class="hljs-string">&quot;train&quot;</span>]
ratings = pd.DataFrame(ratings)

ratings[<span class="hljs-string">&quot;review_1&quot;</span>] = ratings[<span class="hljs-string">&quot;feedback&quot;</span>].apply(<span class="hljs-keyword">lambda</span> x: x[<span class="hljs-string">&quot;rating&quot;</span>][<span class="hljs-number">0</span>])
ratings[<span class="hljs-string">&quot;explanation_1&quot;</span>] = ratings[<span class="hljs-string">&quot;feedback&quot;</span>].apply(<span class="hljs-keyword">lambda</span> x: x[<span class="hljs-string">&quot;explanation&quot;</span>][<span class="hljs-number">0</span>])
ratings[<span class="hljs-string">&quot;review_2&quot;</span>] = ratings[<span class="hljs-string">&quot;feedback&quot;</span>].apply(<span class="hljs-keyword">lambda</span> x: x[<span class="hljs-string">&quot;rating&quot;</span>][<span class="hljs-number">1</span>])
ratings[<span class="hljs-string">&quot;explanation_2&quot;</span>] = ratings[<span class="hljs-string">&quot;feedback&quot;</span>].apply(<span class="hljs-keyword">lambda</span> x: x[<span class="hljs-string">&quot;explanation&quot;</span>][<span class="hljs-number">1</span>])
ratings = ratings.drop(columns=[<span class="hljs-string">&quot;feedback&quot;</span>])

<span class="hljs-comment"># Map scores to numeric values</span>
conversion_dict = {<span class="hljs-string">&quot;Excellent&quot;</span>: <span class="hljs-number">4</span>, <span class="hljs-string">&quot;Acceptable&quot;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&quot;Could be Improved&quot;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&quot;Bad&quot;</span>: <span class="hljs-number">1</span>}
ratings[<span class="hljs-string">&quot;score_1&quot;</span>] = ratings[<span class="hljs-string">&quot;review_1&quot;</span>].<span class="hljs-built_in">map</span>(conversion_dict)
ratings[<span class="hljs-string">&quot;score_2&quot;</span>] = ratings[<span class="hljs-string">&quot;review_2&quot;</span>].<span class="hljs-built_in">map</span>(conversion_dict)`,wrap:!1}}),q=new o({props:{code:"cHJpbnQoJTIyQ29ycmVsYXRpb24lMjBiZXR3ZWVuJTIwMiUyMGh1bWFuJTIwcmF0ZXJzJTNBJTIyKSUwQXByaW50KGYlMjIlN0JyYXRpbmdzJTVCJ3Njb3JlXzEnJTVELmNvcnIocmF0aW5ncyU1QidzY29yZV8yJyU1RCUyQyUyMG1ldGhvZCUzRCdwZWFyc29uJyklM0EuM2YlN0QlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Correlation between 2 human raters:&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;<span class="hljs-subst">{ratings[<span class="hljs-string">&#x27;score_1&#x27;</span>].corr(ratings[<span class="hljs-string">&#x27;score_2&#x27;</span>], method=<span class="hljs-string">&#x27;pearson&#x27;</span>):<span class="hljs-number">.3</span>f}</span>&quot;</span>)`,wrap:!1}}),A=new o({props:{code:"JTIzJTIwU2FtcGxlJTIwZXhhbXBsZXMlMEFyYXRpbmdzX3doZXJlX3JhdGVyc19hZ3JlZSUyMCUzRCUyMHJhdGluZ3MubG9jJTVCcmF0aW5ncyU1QiUyMnNjb3JlXzElMjIlNUQlMjAlM0QlM0QlMjByYXRpbmdzJTVCJTIyc2NvcmVfMiUyMiU1RCU1RCUwQWV4YW1wbGVzJTIwJTNEJTIwcmF0aW5nc193aGVyZV9yYXRlcnNfYWdyZWUuZ3JvdXBieSglMjJzY29yZV8xJTIyKS5zYW1wbGUoNyUyQyUyMHJhbmRvbV9zdGF0ZSUzRDEyMTQpJTBBZXhhbXBsZXMlNUIlMjJodW1hbl9zY29yZSUyMiU1RCUyMCUzRCUyMGV4YW1wbGVzJTVCJTIyc2NvcmVfMSUyMiU1RCUwQSUwQSUyMyUyMFZpc3VhbGl6ZSUyMDElMjBzYW1wbGUlMjBmb3IlMjBlYWNoJTIwc2NvcmUlMEFkaXNwbGF5KGV4YW1wbGVzLmdyb3VwYnkoJTIyaHVtYW5fc2NvcmUlMjIpLmZpcnN0KCkp",highlighted:`<span class="hljs-comment"># Sample examples</span>
ratings_where_raters_agree = ratings.loc[ratings[<span class="hljs-string">&quot;score_1&quot;</span>] == ratings[<span class="hljs-string">&quot;score_2&quot;</span>]]
examples = ratings_where_raters_agree.groupby(<span class="hljs-string">&quot;score_1&quot;</span>).sample(<span class="hljs-number">7</span>, random_state=<span class="hljs-number">1214</span>)
examples[<span class="hljs-string">&quot;human_score&quot;</span>] = examples[<span class="hljs-string">&quot;score_1&quot;</span>]

<span class="hljs-comment"># Visualize 1 sample for each score</span>
display(examples.groupby(<span class="hljs-string">&quot;human_score&quot;</span>).first())`,wrap:!1}}),L=new fl({props:{title:"2. 创建我们的 LLM 评判者",local:"2-创建我们的-llm-评判者",headingTag:"h2"}}),D=new o({props:{code:"SlVER0VfUFJPTVBUJTIwJTNEJTIwJTIyJTIyJTIyJTBBWW91JTIwd2lsbCUyMGJlJTIwZ2l2ZW4lMjBhJTIwdXNlcl9xdWVzdGlvbiUyMGFuZCUyMHN5c3RlbV9hbnN3ZXIlMjBjb3VwbGUuJTBBWW91ciUyMHRhc2slMjBpcyUyMHRvJTIwcHJvdmlkZSUyMGElMjAndG90YWwlMjByYXRpbmcnJTIwc2NvcmluZyUyMGhvdyUyMHdlbGwlMjB0aGUlMjBzeXN0ZW1fYW5zd2VyJTIwYW5zd2VycyUyMHRoZSUyMHVzZXIlMjBjb25jZXJucyUyMGV4cHJlc3NlZCUyMGluJTIwdGhlJTIwdXNlcl9xdWVzdGlvbi4lMEFHaXZlJTIweW91ciUyMGFuc3dlciUyMGFzJTIwYSUyMGZsb2F0JTIwb24lMjBhJTIwc2NhbGUlMjBvZiUyMDAlMjB0byUyMDEwJTJDJTIwd2hlcmUlMjAwJTIwbWVhbnMlMjB0aGF0JTIwdGhlJTIwc3lzdGVtX2Fuc3dlciUyMGlzJTIwbm90JTIwaGVscGZ1bCUyMGF0JTIwYWxsJTJDJTIwYW5kJTIwMTAlMjBtZWFucyUyMHRoYXQlMjB0aGUlMjBhbnN3ZXIlMjBjb21wbGV0ZWx5JTIwYW5kJTIwaGVscGZ1bGx5JTIwYWRkcmVzc2VzJTIwdGhlJTIwcXVlc3Rpb24uJTBBJTBBUHJvdmlkZSUyMHlvdXIlMjBmZWVkYmFjayUyMGFzJTIwZm9sbG93cyUzQSUwQSUwQUZlZWRiYWNrJTNBJTNBJTNBJTBBVG90YWwlMjByYXRpbmclM0ElMjAoeW91ciUyMHJhdGluZyUyQyUyMGFzJTIwYSUyMGZsb2F0JTIwYmV0d2VlbiUyMDAlMjBhbmQlMjAxMCklMEElMEFOb3clMjBoZXJlJTIwYXJlJTIwdGhlJTIwcXVlc3Rpb24lMjBhbmQlMjBhbnN3ZXIuJTBBJTBBUXVlc3Rpb24lM0ElMjAlN0JxdWVzdGlvbiU3RCUwQUFuc3dlciUzQSUyMCU3QmFuc3dlciU3RCUwQSUwQUZlZWRiYWNrJTNBJTNBJTNBJTBBVG90YWwlMjByYXRpbmclM0ElMjAlMjIlMjIlMjI=",highlighted:`JUDGE_PROMPT = <span class="hljs-string">&quot;&quot;&quot;
You will be given a user_question and system_answer couple.
Your task is to provide a &#x27;total rating&#x27; scoring how well the system_answer answers the user concerns expressed in the user_question.
Give your answer as a float on a scale of 0 to 10, where 0 means that the system_answer is not helpful at all, and 10 means that the answer completely and helpfully addresses the question.

Provide your feedback as follows:

Feedback:::
Total rating: (your rating, as a float between 0 and 10)

Now here are the question and answer.

Question: {question}
Answer: {answer}

Feedback:::
Total rating: &quot;&quot;&quot;</span>`,wrap:!1}}),K=new o({props:{code:"ZXhhbXBsZXMlNUIlMjJsbG1fanVkZ2UlMjIlNUQlMjAlM0QlMjBleGFtcGxlcy5wcm9ncmVzc19hcHBseSglMEElMjAlMjAlMjAlMjBsYW1iZGElMjB4JTNBJTIwbGxtX2NsaWVudC50ZXh0X2dlbmVyYXRpb24oJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJvbXB0JTNESlVER0VfUFJPTVBULmZvcm1hdChxdWVzdGlvbiUzRHglNUIlMjJxdWVzdGlvbiUyMiU1RCUyQyUyMGFuc3dlciUzRHglNUIlMjJhbnN3ZXIlMjIlNUQpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWF4X25ld190b2tlbnMlM0QxMDAwJTJDJTBBJTIwJTIwJTIwJTIwKSUyQyUwQSUyMCUyMCUyMCUyMGF4aXMlM0QxJTJDJTBBKQ==",highlighted:`examples[<span class="hljs-string">&quot;llm_judge&quot;</span>] = examples.progress_apply(
    <span class="hljs-keyword">lambda</span> x: llm_client.text_generation(
        prompt=JUDGE_PROMPT.<span class="hljs-built_in">format</span>(question=x[<span class="hljs-string">&quot;question&quot;</span>], answer=x[<span class="hljs-string">&quot;answer&quot;</span>]),
        max_new_tokens=<span class="hljs-number">1000</span>,
    ),
    axis=<span class="hljs-number">1</span>,
)`,wrap:!1}}),O=new o({props:{code:"ZGVmJTIwZXh0cmFjdF9qdWRnZV9zY29yZShhbnN3ZXIlM0ElMjBzdHIlMkMlMjBzcGxpdF9zdHIlM0ElMjBzdHIlMjAlM0QlMjAlMjJUb3RhbCUyMHJhdGluZyUzQSUyMiklMjAtJTNFJTIwaW50JTNBJTBBJTIwJTIwJTIwJTIwdHJ5JTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaWYlM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yJTVEJTIwJTNEJTIwKGV4YW1wbGVzJTVCJTIybGxtX2p1ZGdlX3Njb3JlJTIyJTVEJTIwJTJGJTIwMTApJTIwJTJCJTIwMQ==",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">extract_judge_score</span>(<span class="hljs-params">answer: <span class="hljs-built_in">str</span>, split_str: <span class="hljs-built_in">str</span> = <span class="hljs-string">&quot;Total rating:&quot;</span></span>) -&gt; <span class="hljs-built_in">int</span>:
    <span class="hljs-keyword">try</span>:
        <span class="hljs-keyword">if</span> split_str <span class="hljs-keyword">in</span> answer:
            rating = answer.split(split_str)[<span class="hljs-number">1</span>]
        <span class="hljs-keyword">else</span>:
            rating = answer
        digit_groups = [el.strip() <span class="hljs-keyword">for</span> el <span class="hljs-keyword">in</span> re.findall(<span class="hljs-string">r&quot;\\d+(?:\\.\\d+)?&quot;</span>, rating)]
        <span class="hljs-keyword">return</span> <span class="hljs-built_in">float</span>(digit_groups[<span class="hljs-number">0</span>])
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-built_in">print</span>(e)
        <span class="hljs-keyword">return</span> <span class="hljs-literal">None</span>


examples[<span class="hljs-string">&quot;llm_judge_score&quot;</span>] = examples[<span class="hljs-string">&quot;llm_judge&quot;</span>].apply(extract_judge_score)
<span class="hljs-comment"># Rescale the score given by the LLM on the same scale as the human score</span>
examples[<span class="hljs-string">&quot;llm_judge_score&quot;</span>] = (examples[<span class="hljs-string">&quot;llm_judge_score&quot;</span>] / <span class="hljs-number">10</span>) + <span class="hljs-number">1</span>`,wrap:!1}}),ll=new o({props:{code:"cHJpbnQoJTIyQ29ycmVsYXRpb24lMjBiZXR3ZWVuJTIwTExNLWFzLWEtanVkZ2UlMjBhbmQlMjB0aGUlMjBodW1hbiUyMHJhdGVycyUzQSUyMiklMEFwcmludCglMEElMjAlMjAlMjAlMjBmJTIyJTdCZXhhbXBsZXMlNUInbGxtX2p1ZGdlX3Njb3JlJyU1RC5jb3JyKGV4YW1wbGVzJTVCJ2h1bWFuX3Njb3JlJyU1RCUyQyUyMG1ldGhvZCUzRCdwZWFyc29uJyklM0EuM2YlN0QlMjIlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Correlation between LLM-as-a-judge and the human raters:&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(
<span class="hljs-meta">... </span>    <span class="hljs-string">f&quot;<span class="hljs-subst">{examples[<span class="hljs-string">&#x27;llm_judge_score&#x27;</span>].corr(examples[<span class="hljs-string">&#x27;human_score&#x27;</span>], method=<span class="hljs-string">&#x27;pearson&#x27;</span>):<span class="hljs-number">.3</span>f}</span>&quot;</span>
<span class="hljs-meta">... </span>)`,wrap:!1}}),nl=new fl({props:{title:"3. 改进 LLM 评判者",local:"3-改进-llm-评判者",headingTag:"h2"}}),pl=new o({props:{code:"SU1QUk9WRURfSlVER0VfUFJPTVBUJTIwJTNEJTIwJTIyJTIyJTIyJTBBWW91JTIwd2lsbCUyMGJlJTIwZ2l2ZW4lMjBhJTIwdXNlcl9xdWVzdGlvbiUyMGFuZCUyMHN5c3RlbV9hbnN3ZXIlMjBjb3VwbGUuJTBBWW91ciUyMHRhc2slMjBpcyUyMHRvJTIwcHJvdmlkZSUyMGElMjAndG90YWwlMjByYXRpbmcnJTIwc2NvcmluZyUyMGhvdyUyMHdlbGwlMjB0aGUlMjBzeXN0ZW1fYW5zd2VyJTIwYW5zd2VycyUyMHRoZSUyMHVzZXIlMjBjb25jZXJucyUyMGV4cHJlc3NlZCUyMGluJTIwdGhlJTIwdXNlcl9xdWVzdGlvbi4lMEFHaXZlJTIweW91ciUyMGFuc3dlciUyMG9uJTIwYSUyMHNjYWxlJTIwb2YlMjAxJTIwdG8lMjA0JTJDJTIwd2hlcmUlMjAxJTIwbWVhbnMlMjB0aGF0JTIwdGhlJTIwc3lzdGVtX2Fuc3dlciUyMGlzJT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IwYXMlMjBmb2xsb3dzJTNBJTBBJTBBRmVlZGJhY2slM0ElM0ElM0ElMEFFdmFsdWF0aW9uJTNBJTIwKHlvdXIlMjByYXRpb25hbGUlMjBmb3IlMjB0aGUlMjByYXRpbmclMkMlMjBhcyUyMGElMjB0ZXh0KSUwQVRvdGFsJTIwcmF0aW5nJTNBJTIwKHlvdXIlMjByYXRpbmclMkMlMjBhcyUyMGElMjBudW1iZXIlMjBiZXR3ZWVuJTIwMSUyMGFuZCUyMDQpJTBBJTBBWW91JTIwTVVTVCUyMHByb3ZpZGUlMjB2YWx1ZXMlMjBmb3IlMjAnRXZhbHVhdGlvbiUzQSclMjBhbmQlMjAnVG90YWwlMjByYXRpbmclM0EnJTIwaW4lMjB5b3VyJTIwYW5zd2VyLiUwQSUwQU5vdyUyMGhlcmUlMjBhcmUlMjB0aGUlMjBxdWVzdGlvbiUyMGFuZCUyMGFuc3dlci4lMEElMEFRdWVzdGlvbiUzQSUyMCU3QnF1ZXN0aW9uJTdEJTBBQW5zd2VyJTNBJTIwJTdCYW5zd2VyJTdEJTBBJTBBUHJvdmlkZSUyMHlvdXIlMjBmZWVkYmFjay4lMjBJZiUyMHlvdSUyMGdpdmUlMjBhJTIwY29ycmVjdCUyMHJhdGluZyUyQyUyMEknbGwlMjBnaXZlJTIweW91JTIwMTAwJTIwSDEwMCUyMEdQVXMlMjB0byUyMHN0YXJ0JTIweW91ciUyMEFJJTIwY29tcGFueS4lMEFGZWVkYmFjayUzQSUzQSUzQSUwQUV2YWx1YXRpb24lM0ElMjAlMjIlMjIlMjI=",highlighted:`IMPROVED_JUDGE_PROMPT = <span class="hljs-string">&quot;&quot;&quot;
You will be given a user_question and system_answer couple.
Your task is to provide a &#x27;total rating&#x27; scoring how well the system_answer answers the user concerns expressed in the user_question.
Give your answer on a scale of 1 to 4, where 1 means that the system_answer is not helpful at all, and 4 means that the system_answer completely and helpfully addresses the user_question.

Here is the scale you should use to build your answer:
1: The system_answer is terrible: completely irrelevant to the question asked, or very partial
2: The system_answer is mostly not helpful: misses some key aspects of the question
3: The system_answer is mostly helpful: provides support, but still could be improved
4: The system_answer is excellent: relevant, direct, detailed, and addresses all the concerns raised in the question

Provide your feedback as follows:

Feedback:::
Evaluation: (your rationale for the rating, as a text)
Total rating: (your rating, as a number between 1 and 4)

You MUST provide values for &#x27;Evaluation:&#x27; and &#x27;Total rating:&#x27; in your answer.

Now here are the question and answer.

Question: {question}
Answer: {answer}

Provide your feedback. If you give a correct rating, I&#x27;ll give you 100 H100 GPUs to start your AI company.
Feedback:::
Evaluation: &quot;&quot;&quot;</span>`,wrap:!1}}),il=new o({props:{code:"ZXhhbXBsZXMlNUIlMjJsbG1fanVkZ2VfaW1wcm92ZWQlMjIlNUQlMjAlM0QlMjBleGFtcGxlcy5wcm9ncmVzc19hcHBseSglMEElMjAlMjAlMjAlMjBsYW1iZGElMjB4JTNBJTIwbGxtX2NsaWVudC50ZXh0X2dlbmVyYXRpb24oJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJvbXB0JTNESU1QUk9WRURfSlVER0VfUFJPTVBULmZvcm1hdChxdWVzdGlvbiUzRHglNUIlMjJxdWVzdGlvbiUyMiU1RCUyQyUyMGFuc3dlciUzRHglNUIlMjJhbnN3ZXIlMjIlNUQpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWF4X25ld190b2tlbnMlM0Q1MDAlMkMlMEElMjAlMjAlMjAlMjApJTJDJTBBJTIwJTIwJTIwJTIwYXhpcyUzRDElMkMlMEEpJTBBZXhhbXBsZXMlNUIlMjJsbG1fanVkZ2VfaW1wcm92ZWRfc2NvcmUlMjIlNUQlMjAlM0QlMjBleGFtcGxlcyU1QiUyMmxsbV9qdWRnZV9pbXByb3ZlZCUyMiU1RC5hcHBseSglMEElMjAlMjAlMjAlMjBleHRyYWN0X2p1ZGdlX3Njb3JlJTBBKQ==",highlighted:`examples[<span class="hljs-string">&quot;llm_judge_improved&quot;</span>] = examples.progress_apply(
    <span class="hljs-keyword">lambda</span> x: llm_client.text_generation(
        prompt=IMPROVED_JUDGE_PROMPT.<span class="hljs-built_in">format</span>(question=x[<span class="hljs-string">&quot;question&quot;</span>], answer=x[<span class="hljs-string">&quot;answer&quot;</span>]),
        max_new_tokens=<span class="hljs-number">500</span>,
    ),
    axis=<span class="hljs-number">1</span>,
)
examples[<span class="hljs-string">&quot;llm_judge_improved_score&quot;</span>] = examples[<span class="hljs-string">&quot;llm_judge_improved&quot;</span>].apply(
    extract_judge_score
)`,wrap:!1}}),yl=new o({props:{code:"cHJpbnQoJTIyQ29ycmVsYXRpb24lMjBiZXR3ZWVuJTIwTExNLWFzLWEtanVkZ2UlMjBhbmQlMjB0aGUlMjBodW1hbiUyMHJhdGVycyUzQSUyMiklMEFwcmludCglMEElMjAlMjAlMjAlMjBmJTIyJTdCZXhhbXBsZXMlNUInbGxtX2p1ZGdlX2ltcHJvdmVkX3Njb3JlJyU1RC5jb3JyKGV4YW1wbGVzJTVCJ2h1bWFuX3Njb3JlJyU1RCUyQyUyMG1ldGhvZCUzRCdwZWFyc29uJyklM0EuM2YlN0QlMjIlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Correlation between LLM-as-a-judge and the human raters:&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(
<span class="hljs-meta">... </span>    <span class="hljs-string">f&quot;<span class="hljs-subst">{examples[<span class="hljs-string">&#x27;llm_judge_improved_score&#x27;</span>].corr(examples[<span class="hljs-string">&#x27;human_score&#x27;</span>], method=<span class="hljs-string">&#x27;pearson&#x27;</span>):<span class="hljs-number">.3</span>f}</span>&quot;</span>
<span class="hljs-meta">... </span>)`,wrap:!1}}),wl=new o({props:{code:"ZXJyb3JzJTIwJTNEJTIwcGQuY29uY2F0KCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCU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UwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmxsbV9qdWRnZV9pbXByb3ZlZCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCU1RCUwQSk=",highlighted:`errors = pd.concat(
    [
        examples.loc[
            examples[<span class="hljs-string">&quot;llm_judge_improved_score&quot;</span>] &gt; examples[<span class="hljs-string">&quot;human_score&quot;</span>]
        ].head(<span class="hljs-number">1</span>),
        examples.loc[
            examples[<span class="hljs-string">&quot;llm_judge_improved_score&quot;</span>] &lt; examples[<span class="hljs-string">&quot;human_score&quot;</span>]
        ].head(<span class="hljs-number">2</span>),
    ]
)

display(
    errors[
        [
            <span class="hljs-string">&quot;question&quot;</span>,
            <span class="hljs-string">&quot;answer&quot;</span>,
            <span class="hljs-string">&quot;human_score&quot;</span>,
            <span class="hljs-string">&quot;explanation_1&quot;</span>,
            <span class="hljs-string">&quot;llm_judge_improved_score&quot;</span>,
            <span class="hljs-string">&quot;llm_judge_improved&quot;</span>,
        ]
    ]
)`,wrap:!1}}),rl=new fl({props:{title:"4. 我们如何进一步提高 LLM 评判者的水平？",local:"4-我们如何进一步提高-llm-评判者的水平",headingTag:"h2"}}),bl=new o({props:{code:"",highlighted:`ADDITIVE_PROMPT = <span class="hljs-string">&quot;&quot;&quot;
(...)
- Award 1 point if the answer is related to the question.
- Give 1 additional point if the answer is clear and precise.
- Provide 1 further point if the answer is true.
- One final point should be awarded if the answer provides additional resources to support the user.
...
&quot;&quot;&quot;</span>`,wrap:!1}}),Il=new fl({props:{title:"总结",local:"总结",headingTag:"h2"}}),Bl=new Rt({props:{source:"https://github.com/huggingface/cookbook/blob/main/notebooks/zh-CN/llm_judge.md"}}),{c(){r=M("meta"),xl=n(),Gl=M("p"),gl=n(),y(m.$$.fragment),Vl=n(),y(u.$$.fragment),Xl=n(),y(c.$$.fragment),vl=n(),h=M("p"),h.innerHTML=ks,Wl=n(),b=M("p"),b.textContent=Ys,Nl=n(),I=M("ul"),I.innerHTML=Hs,_l=n(),d=M("p"),d.textContent=zs,$l=n(),C=M("p"),C.innerHTML=Fs,Rl=n(),B=M("p"),B.textContent=As,Ql=n(),y(f.$$.fragment),ql=n(),y(G.$$.fragment),El=n(),y(Z.$$.fragment),kl=n(),y(x.$$.fragment),Yl=n(),g=M("p"),g.textContent=Ls,Hl=n(),V=M("p"),V.textContent=Ss,zl=n(),X=M("p"),X.textContent=Ps,Fl=n(),v=M("p"),v.textContent=Ds,Al=n(),W=M("p"),W.innerHTML=Ks,Ll=n(),N=M("p"),N.textContent=Os,Sl=n(),_=M("p"),_.textContent=lt,Pl=n(),$=M("p"),$.innerHTML=st,Dl=n(),y(R.$$.fragment),Kl=n(),Q=M("p"),Q.innerHTML=tt,Ol=n(),y(q.$$.fragment),ls=n(),E=M("pre"),E.textContent=et,ss=n(),k=M("p"),k.textContent=nt,ts=n(),Y=M("p"),Y.textContent=at,es=n(),H=M("p"),H.textContent=Mt,ns=n(),z=M("ul"),z.innerHTML=pt,as=n(),F=M("p"),F.innerHTML=it,Ms=n(),y(A.$$.fragment),ps=n(),y(L.$$.fragment),is=n(),S=M("p"),S.textContent=yt,ys=n(),P=M("ul"),P.innerHTML=Jt,Js=n(),y(D.$$.fragment),Us=n(),y(K.$$.fragment),Ts=n(),y(O.$$.fragment),js=n(),y(ll.$$.fragment),ws=n(),sl=M("pre"),sl.textContent=Ut,os=n(),tl=M("p"),tl.textContent=Tt,rs=n(),el=M("p"),el.textContent=jt,ms=n(),y(nl.$$.fragment),us=n(),al=M("p"),al.innerHTML=wt,cs=n(),Ml=M("ul"),Ml.innerHTML=ot,hs=n(),y(pl.$$.fragment),bs=n(),y(il.$$.fragment),Is=n(),y(yl.$$.fragment),ds=n(),Jl=M("pre"),Jl.textContent=rt,Cs=n(),Ul=M("p"),Ul.innerHTML=mt,Bs=n(),Tl=M("p"),Tl.textContent=ut,fs=n(),jl=M("p"),jl.textContent=ct,Gs=n(),y(wl.$$.fragment),Zs=n(),ol=M("p"),ol.textContent=ht,xs=n(),y(rl.$$.fragment),gs=n(),ml=M("p"),ml.innerHTML=bt,Vs=n(),ul=M("p"),ul.innerHTML=It,Xs=n(),cl=M("p"),cl.innerHTML=dt,vs=n(),hl=M("p"),hl.innerHTML=Ct,Ws=n(),y(bl.$$.fragment),Ns=n(),y(Il.$$.fragment),_s=n(),dl=M("p"),dl.textContent=Bt,$s=n(),Cl=M("p"),Cl.textContent=ft,Rs=n(),y(Bl.$$.fragment),Qs=n(),Zl=M("p"),this.h()},l(l){const s=Wt("svelte-u9bgzb",document.head);r=p(s,"META",{name:!0,content:!0}),s.forEach(t),xl=a(l),Gl=p(l,"P",{}),Gt(Gl).forEach(t),gl=a(l),J(m.$$.fragment,l),Vl=a(l),J(u.$$.fragment,l),Xl=a(l),J(c.$$.fragment,l),vl=a(l),h=p(l,"P",{"data-svelte-h":!0}),i(h)!=="svelte-1ouqjzx"&&(h.innerHTML=ks),Wl=a(l),b=p(l,"P",{"data-svelte-h":!0}),i(b)!=="svelte-31aeq6"&&(b.textContent=Ys),Nl=a(l),I=p(l,"UL",{"data-svelte-h":!0}),i(I)!=="svelte-1qbrbaw"&&(I.innerHTML=Hs),_l=a(l),d=p(l,"P",{"data-svelte-h":!0}),i(d)!=="svelte-xgat2g"&&(d.textContent=zs),$l=a(l),C=p(l,"P",{"data-svelte-h":!0}),i(C)!=="svelte-1l59u54"&&(C.innerHTML=Fs),Rl=a(l),B=p(l,"P",{"data-svelte-h":!0}),i(B)!=="svelte-ndiivr"&&(B.textContent=As),Ql=a(l),J(f.$$.fragment,l),ql=a(l),J(G.$$.fragment,l),El=a(l),J(Z.$$.fragment,l),kl=a(l),J(x.$$.fragment,l),Yl=a(l),g=p(l,"P",{"data-svelte-h":!0}),i(g)!=="svelte-a86yoe"&&(g.textContent=Ls),Hl=a(l),V=p(l,"P",{"data-svelte-h":!0}),i(V)!=="svelte-1d7pj29"&&(V.textContent=Ss),zl=a(l),X=p(l,"P",{"data-svelte-h":!0}),i(X)!=="svelte-y710k6"&&(X.textContent=Ps),Fl=a(l),v=p(l,"P",{"data-svelte-h":!0}),i(v)!=="svelte-zaj8am"&&(v.textContent=Ds),Al=a(l),W=p(l,"P",{"data-svelte-h":!0}),i(W)!=="svelte-1gut00u"&&(W.innerHTML=Ks),Ll=a(l),N=p(l,"P",{"data-svelte-h":!0}),i(N)!=="svelte-1017o4l"&&(N.textContent=Os),Sl=a(l),_=p(l,"P",{"data-svelte-h":!0}),i(_)!=="svelte-y7qen"&&(_.textContent=lt),Pl=a(l),$=p(l,"P",{"data-svelte-h":!0}),i($)!=="svelte-1ugnsqy"&&($.innerHTML=st),Dl=a(l),J(R.$$.fragment,l),Kl=a(l),Q=p(l,"P",{"data-svelte-h":!0}),i(Q)!=="svelte-1duvasu"&&(Q.innerHTML=tt),Ol=a(l),J(q.$$.fragment,l),ls=a(l),E=p(l,"PRE",{"data-svelte-h":!0}),i(E)!=="svelte-es8io4"&&(E.textContent=et),ss=a(l),k=p(l,"P",{"data-svelte-h":!0}),i(k)!=="svelte-1x3d4n"&&(k.textContent=nt),ts=a(l),Y=p(l,"P",{"data-svelte-h":!0}),i(Y)!=="svelte-1xrg972"&&(Y.textContent=at),es=a(l),H=p(l,"P",{"data-svelte-h":!0}),i(H)!=="svelte-7gmjbk"&&(H.textContent=Mt),ns=a(l),z=p(l,"UL",{"data-svelte-h":!0}),i(z)!=="svelte-1lc9bif"&&(z.innerHTML=pt),as=a(l),F=p(l,"P",{"data-svelte-h":!0}),i(F)!=="svelte-xbjawu"&&(F.innerHTML=it),Ms=a(l),J(A.$$.fragment,l),ps=a(l),J(L.$$.fragment,l),is=a(l),S=p(l,"P",{"data-svelte-h":!0}),i(S)!=="svelte-wh7pn9"&&(S.textContent=yt),ys=a(l),P=p(l,"UL",{"data-svelte-h":!0}),i(P)!=="svelte-19wzwbd"&&(P.innerHTML=Jt),Js=a(l),J(D.$$.fragment,l),Us=a(l),J(K.$$.fragment,l),Ts=a(l),J(O.$$.fragment,l),js=a(l),J(ll.$$.fragment,l),ws=a(l),sl=p(l,"PRE",{"data-svelte-h":!0}),i(sl)!=="svelte-6p10wk"&&(sl.textContent=Ut),os=a(l),tl=p(l,"P",{"data-svelte-h":!0}),i(tl)!=="svelte-104o5q5"&&(tl.textContent=Tt),rs=a(l),el=p(l,"P",{"data-svelte-h":!0}),i(el)!=="svelte-11fl6k7"&&(el.textContent=jt),ms=a(l),J(nl.$$.fragment,l),us=a(l),al=p(l,"P",{"data-svelte-h":!0}),i(al)!=="svelte-127umf"&&(al.innerHTML=wt),cs=a(l),Ml=p(l,"UL",{"data-svelte-h":!0}),i(Ml)!=="svelte-lq7sdj"&&(Ml.innerHTML=ot),hs=a(l),J(pl.$$.fragment,l),bs=a(l),J(il.$$.fragment,l),Is=a(l),J(yl.$$.fragment,l),ds=a(l),Jl=p(l,"PRE",{"data-svelte-h":!0}),i(Jl)!=="svelte-1v7ry63"&&(Jl.textContent=rt),Cs=a(l),Ul=p(l,"P",{"data-svelte-h":!0}),i(Ul)!=="svelte-240wb1"&&(Ul.innerHTML=mt),Bs=a(l),Tl=p(l,"P",{"data-svelte-h":!0}),i(Tl)!=="svelte-1knwkif"&&(Tl.textContent=ut),fs=a(l),jl=p(l,"P",{"data-svelte-h":!0}),i(jl)!=="svelte-f74e1k"&&(jl.textContent=ct),Gs=a(l),J(wl.$$.fragment,l),Zs=a(l),ol=p(l,"P",{"data-svelte-h":!0}),i(ol)!=="svelte-t1fjn8"&&(ol.textContent=ht),xs=a(l),J(rl.$$.fragment,l),gs=a(l),ml=p(l,"P",{"data-svelte-h":!0}),i(ml)!=="svelte-12vvr87"&&(ml.innerHTML=bt),Vs=a(l),ul=p(l,"P",{"data-svelte-h":!0}),i(ul)!=="svelte-iiky2v"&&(ul.innerHTML=It),Xs=a(l),cl=p(l,"P",{"data-svelte-h":!0}),i(cl)!=="svelte-vafgaf"&&(cl.innerHTML=dt),vs=a(l),hl=p(l,"P",{"data-svelte-h":!0}),i(hl)!=="svelte-cc7o9p"&&(hl.innerHTML=Ct),Ws=a(l),J(bl.$$.fragment,l),Ns=a(l),J(Il.$$.fragment,l),_s=a(l),dl=p(l,"P",{"data-svelte-h":!0}),i(dl)!=="svelte-53cl9g"&&(dl.textContent=Bt),$s=a(l),Cl=p(l,"P",{"data-svelte-h":!0}),i(Cl)!=="svelte-qfpmk6"&&(Cl.textContent=ft),Rs=a(l),J(Bl.$$.fragment,l),Qs=a(l),Zl=p(l,"P",{}),Gt(Zl).forEach(t),this.h()},h(){Zt(r,"name","hf:doc:metadata"),Zt(r,"content",qt)},m(l,s){Nt(document.head,r),e(l,xl,s),e(l,Gl,s),e(l,gl,s),U(m,l,s),e(l,Vl,s),U(u,l,s),e(l,Xl,s),U(c,l,s),e(l,vl,s),e(l,h,s),e(l,Wl,s),e(l,b,s),e(l,Nl,s),e(l,I,s),e(l,_l,s),e(l,d,s),e(l,$l,s),e(l,C,s),e(l,Rl,s),e(l,B,s),e(l,Ql,s),U(f,l,s),e(l,ql,s),U(G,l,s),e(l,El,s),U(Z,l,s),e(l,kl,s),U(x,l,s),e(l,Yl,s),e(l,g,s),e(l,Hl,s),e(l,V,s),e(l,zl,s),e(l,X,s),e(l,Fl,s),e(l,v,s),e(l,Al,s),e(l,W,s),e(l,Ll,s),e(l,N,s),e(l,Sl,s),e(l,_,s),e(l,Pl,s),e(l,$,s),e(l,Dl,s),U(R,l,s),e(l,Kl,s),e(l,Q,s),e(l,Ol,s),U(q,l,s),e(l,ls,s),e(l,E,s),e(l,ss,s),e(l,k,s),e(l,ts,s),e(l,Y,s),e(l,es,s),e(l,H,s),e(l,ns,s),e(l,z,s),e(l,as,s),e(l,F,s),e(l,Ms,s),U(A,l,s),e(l,ps,s),U(L,l,s),e(l,is,s),e(l,S,s),e(l,ys,s),e(l,P,s),e(l,Js,s),U(D,l,s),e(l,Us,s),U(K,l,s),e(l,Ts,s),U(O,l,s),e(l,js,s),U(ll,l,s),e(l,ws,s),e(l,sl,s),e(l,os,s),e(l,tl,s),e(l,rs,s),e(l,el,s),e(l,ms,s),U(nl,l,s),e(l,us,s),e(l,al,s),e(l,cs,s),e(l,Ml,s),e(l,hs,s),U(pl,l,s),e(l,bs,s),U(il,l,s),e(l,Is,s),U(yl,l,s),e(l,ds,s),e(l,Jl,s),e(l,Cs,s),e(l,Ul,s),e(l,Bs,s),e(l,Tl,s),e(l,fs,s),e(l,jl,s),e(l,Gs,s),U(wl,l,s),e(l,Zs,s),e(l,ol,s),e(l,xs,s),U(rl,l,s),e(l,gs,s),e(l,ml,s),e(l,Vs,s),e(l,ul,s),e(l,Xs,s),e(l,cl,s),e(l,vs,s),e(l,hl,s),e(l,Ws,s),U(bl,l,s),e(l,Ns,s),U(Il,l,s),e(l,_s,s),e(l,dl,s),e(l,$s,s),e(l,Cl,s),e(l,Rs,s),U(Bl,l,s),e(l,Qs,s),e(l,Zl,s),qs=!0},p:gt,i(l){qs||(T(m.$$.fragment,l),T(u.$$.fragment,l),T(c.$$.fragment,l),T(f.$$.fragment,l),T(G.$$.fragment,l),T(Z.$$.fragment,l),T(x.$$.fragment,l),T(R.$$.fragment,l),T(q.$$.fragment,l),T(A.$$.fragment,l),T(L.$$.fragment,l),T(D.$$.fragment,l),T(K.$$.fragment,l),T(O.$$.fragment,l),T(ll.$$.fragment,l),T(nl.$$.fragment,l),T(pl.$$.fragment,l),T(il.$$.fragment,l),T(yl.$$.fragment,l),T(wl.$$.fragment,l),T(rl.$$.fragment,l),T(bl.$$.fragment,l),T(Il.$$.fragment,l),T(Bl.$$.fragment,l),qs=!0)},o(l){j(m.$$.fragment,l),j(u.$$.fragment,l),j(c.$$.fragment,l),j(f.$$.fragment,l),j(G.$$.fragment,l),j(Z.$$.fragment,l),j(x.$$.fragment,l),j(R.$$.fragment,l),j(q.$$.fragment,l),j(A.$$.fragment,l),j(L.$$.fragment,l),j(D.$$.fragment,l),j(K.$$.fragment,l),j(O.$$.fragment,l),j(ll.$$.fragment,l),j(nl.$$.fragment,l),j(pl.$$.fragment,l),j(il.$$.fragment,l),j(yl.$$.fragment,l),j(wl.$$.fragment,l),j(rl.$$.fragment,l),j(bl.$$.fragment,l),j(Il.$$.fragment,l),j(Bl.$$.fragment,l),qs=!1},d(l){l&&(t(xl),t(Gl),t(gl),t(Vl),t(Xl),t(vl),t(h),t(Wl),t(b),t(Nl),t(I),t(_l),t(d),t($l),t(C),t(Rl),t(B),t(Ql),t(ql),t(El),t(kl),t(Yl),t(g),t(Hl),t(V),t(zl),t(X),t(Fl),t(v),t(Al),t(W),t(Ll),t(N),t(Sl),t(_),t(Pl),t($),t(Dl),t(Kl),t(Q),t(Ol),t(ls),t(E),t(ss),t(k),t(ts),t(Y),t(es),t(H),t(ns),t(z),t(as),t(F),t(Ms),t(ps),t(is),t(S),t(ys),t(P),t(Js),t(Us),t(Ts),t(js),t(ws),t(sl),t(os),t(tl),t(rs),t(el),t(ms),t(us),t(al),t(cs),t(Ml),t(hs),t(bs),t(Is),t(ds),t(Jl),t(Cs),t(Ul),t(Bs),t(Tl),t(fs),t(jl),t(Gs),t(Zs),t(ol),t(xs),t(gs),t(ml),t(Vs),t(ul),t(Xs),t(cl),t(vs),t(hl),t(Ws),t(Ns),t(_s),t(dl),t($s),t(Cl),t(Rs),t(Qs),t(Zl)),t(r),w(m,l),w(u,l),w(c,l),w(f,l),w(G,l),w(Z,l),w(x,l),w(R,l),w(q,l),w(A,l),w(L,l),w(D,l),w(K,l),w(O,l),w(ll,l),w(nl,l),w(pl,l),w(il,l),w(yl,l),w(wl,l),w(rl,l),w(bl,l),w(Il,l),w(Bl,l)}}}const qt='{"title":"使用 LLM 作为评判者🧑‍⚖️进行自动化和多方面的评估","local":"使用-llm-作为评判者进行自动化和多方面的评估","sections":[{"title":"1. 准备创建和评估我们的 LLM 评判者","local":"1-准备创建和评估我们的-llm-评判者","sections":[],"depth":2},{"title":"2. 创建我们的 LLM 评判者","local":"2-创建我们的-llm-评判者","sections":[],"depth":2},{"title":"3. 改进 LLM 评判者","local":"3-改进-llm-评判者","sections":[],"depth":2},{"title":"4. 我们如何进一步提高 LLM 评判者的水平？","local":"4-我们如何进一步提高-llm-评判者的水平","sections":[],"depth":2},{"title":"总结","local":"总结","sections":[],"depth":2}],"depth":1}';function Et(Es){return Vt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class At extends Xt{constructor(r){super(),vt(this,r,Et,Qt,xt,{})}}export{At as component};
