import{s as Es,n as Ps,o as Ss}from"../chunks/scheduler.1f027d5a.js";import{S as As,i as Ds,e as i,s as a,c as r,h as Ks,a as p,d as l,b as n,f as qs,g as m,j as d,k as zl,l as Os,m as s,n as b,t as u,o as f,p as o}from"../chunks/index.6117a65d.js";import{C as ta}from"../chunks/CopyLLMTxtMenu.0ff8411a.js";import{D as ea,C as c}from"../chunks/DocNotebookDropdown.316c3715.js";import{H as h,E as la}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.0eecd2bb.js";function sa(Ll){let M,se,ee,ae,y,ne,T,ie,w,pe,J,Ql='作者: <a href="https://huggingface.co/aravindputrevu" rel="nofollow">Aravind Putrevu</a>',de,_,ql='在这个 5 分钟的快速入门教程中，我们将使用 Cleanlab 检测一个由在线银行（文本）客户服务请求组成的意图分类数据集中的各种问题。我们考虑的是 <a href="https://arxiv.org/abs/2106.04564" rel="nofollow">Banking77-OOS数据集</a> 的一个子集，包含 1,000 个客户服务请求，根据它们的意图被分类为 10 个类别（你可以在任何文本分类数据集上运行相同的代码）。<a href="https://github.com/cleanlab/cleanlab" rel="nofollow">Cleanlab</a>自动识别我们数据集中的坏例子，包括错误标记的数据、范围外的示例（离群值）或其他模糊不清的示例。在深入建模你的数据之前，请考虑过滤或更正这样的坏例子！',re,x,El="<strong>本教程我们将要做的事情概述：</strong>",me,j,Pl="<li><p>使用预训练的 transformer 模型从客户服务请求中提取文本嵌入</p></li> <li><p>在文本嵌入上训练一个简单的逻辑回归模型，以计算样本外的预测概率</p></li> <li><p>使用这些预测和嵌入运行 Cleanlab 的 <code>Datalab</code> 审核，以识别数据集中的问题，如：标签问题、离群值和近重复项。</p></li>",be,g,ue,C,Sl="已经有一个模型在现有标签集上训练得到的（样本外）<code>pred_probs</code> 了吗？也许你还有一些数值<code>特征</code>？运行下面的代码来查找数据集中的任何潜在标签错误。",fe,v,Al="<strong>注意：</strong> 如果在 Colab 上运行，可能需要使用 GPU（选择：Runtime &gt; Change runtime type &gt; Hardware accelerator &gt; GPU）",oe,U,ce,Z,he,W,Dl="你可以使用 <code>pip</code> 按照以下方式安装本教程所需的所有包：",Me,G,$e,F,ye,B,Te,I,we,k,Je,V,_e,H,Kl=`This dataset has 7 classes.
Classes: &#123;32, 34, 36, 11, 13, 46, 17}
`,xe,R,Ol="让我们查看数据集中的第 i 个示例：",je,X,ge,Y,ts=`Example Label: 11
Example Text: What can I do if my card still hasn't arrived after 2 weeks?
`,Ce,N,es="数据以两个 numpy 数组的形式存储：",ve,z,ls="<li><code>raw_texts</code> 以文本格式存储客户服务请求的话语</li> <li><code>labels</code> 存储每个示例的意图类别（标签）</li>",Ue,$,ss="<p>自有数据？</p> <p>你可以轻松地将上述内容替换为你自己的文本数据集，并继续进行教程的其余部分。</p>",Ze,L,as="接下来，我们将文本字符串转换为更适合作为机器学习模型输入的向量。",We,Q,ns='我们将使用预训练的 Transformer 模型提供的数值表示作为我们文本的嵌入。<a href="https://huggingface.co/docs/hub/sentence-transformers" rel="nofollow">Sentence Transformers</a> 库提供了计算文本数据嵌入的简单方法。在这里，我们加载了预训练的 <code>electra-small-discriminator</code> 模型，然后通过网络运行我们的数据，以提取每个示例的向量嵌入。',Ge,q,Fe,E,is="我们后续的机器学习模型将直接在 <code>text_embeddings</code> 的元素上操作，以便对客户服务请求进行分类。",Be,P,Ie,S,ps="为了利用预训练网络进行特定的分类任务，一种典型的方法是添加一个线性输出层，并在新数据上微调网络参数。然而，这可能需要大量的计算资源。另一种方法是冻结网络的预训练权重，只训练输出层，而不依赖于 GPU。在这里，我们通过在提取的嵌入顶部拟合一个 scikit-learn 线性模型来方便地实现这一点。",ke,A,ds="为了识别标签问题，cleanlab 需要你的模型为每个数据点提供概率预测。然而，对于模型之前训练过的数据点，这些预测将是过拟合的（因此不可靠）。cleanlab 旨在仅与<strong>样本外</strong>的预测类概率一起使用，即在模型训练期间保持不变的数据点。",Ve,D,rs=`在这里，我们使用带有交叉验证的逻辑回归模型来获得数据集中每个示例的样本外预测类概率。
确保你的 <code>pred_probs</code> 列根据类的排序正确排序，对于 Datalab 来说，是：按类名字典顺序排序。`,He,K,Re,O,Xe,tt,ms="在给定来自你拥有的任何模型的特征嵌入和（样本外）预测类概率的情况下，cleanlab 可以帮助你快速识别数据中的低质量示例。",Ye,et,bs="在这里，我们使用 Cleanlab 的 <code>Datalab</code> 来查找数据中的问题。Datalab 提供了几种加载数据的方式；我们将简单地在字典中包装训练特征和噪声标签。",Ne,lt,ze,st,us="审核你的数据所需的全部操作就是调用 <code>find_issues()</code>。我们传入上面获得的预测概率和特征嵌入，但你不一定需要提供所有这些信息，具体取决于你对哪些类型的问题感兴趣。你提供的输入越多，<code>Datalab</code> 就能在你的数据中检测到更多类型的问题。使用更好的模型来生成这些输入将确保 cleanlab 更准确地估计问题。",Le,at,Qe,nt,fs="输出看起来如下：",qe,it,Ee,pt,os="审计完成后，使用 <code>report</code> 方法来查看审计结果。",Pe,dt,Se,rt,cs=`Here is a summary of the different kinds of issues found in the data:

    issue_type  num_issues
       outlier          37
near_duplicate          14
         label          10
       non_iid           1

Dataset Information: num_examples: 1000, num_classes: 7


---------------------- outlier issues ----------------------

About this issue:
	Examples that are very different from the rest of the dataset 
    (i.e. potentially out-of-distribution or rare/anomalous instances).
    

Number of examples with this issue: 37
Overall dataset quality in terms of this issue: 0.3671

Examples representing most severe instances of this issue:
     is_outlier_issue  outlier_score
791              True       0.024866
601              True       0.031162
863              True       0.060738
355              True       0.064199
157              True       0.065075


------------------ near_duplicate issues -------------------

About this issue:
	A (near) duplicate issue refers to two or more examples in
    a dataset that are extremely similar to each other, relative
    to the rest of the dataset.  The examples flagged with this issue
    may be exactly duplicated, or lie atypically close together when
    represented as vectors (i.e. feature embeddings).
    

Number of examples with this issue: 14
Overall dataset quality in terms of this issue: 0.5961

Examples representing most severe instances of this issue:
     is_near_duplicate_issue  near_duplicate_score near_duplicate_sets  distance_to_nearest_neighbor
459                     True              0.009544               [429]                      0.000566
429                     True              0.009544               [459]                      0.000566
501                     True              0.046044          [412, 517]                      0.002781
412                     True              0.046044               [501]                      0.002781
698                     True              0.054626               [607]                      0.003314


----------------------- label issues -----------------------

About this issue:
	Examples whose given label is estimated to be potentially incorrect
    (e.g. due to annotation error) are flagged as having label issues.
    

Number of examples with this issue: 10
Overall dataset quality in terms of this issue: 0.9930

Examples representing most severe instances of this issue:
     is_label_issue  label_score  given_label  predicted_label
379           False     0.025486           32               11
100           False     0.032102           11               36
300           False     0.037742           32               46
485            True     0.057666           17               34
159            True     0.059408           13               11


---------------------- non_iid issues ----------------------

About this issue:
	Whether the dataset exhibits statistically significant
    violations of the IID assumption like:
    changepoints or shift, drift, autocorrelation, etc.
    The specific violation considered is whether the
    examples are ordered such that almost adjacent examples
    tend to have more similar feature values.
    

Number of examples with this issue: 1
Overall dataset quality in terms of this issue: 0.0000

Examples representing most severe instances of this issue:
     is_non_iid_issue  non_iid_score
988              True       0.563774
975             False       0.570179
997             False       0.571891
967             False       0.572357
956             False       0.577413

Additional Information: 
p-value: 0.0
`,Ae,mt,De,bt,hs="报告显示 cleanlab 在我们的数据集中识别出了许多标签问题。我们可以使用 <code>get_issues</code> 方法来查看哪些示例被标记为可能标签错误，以及每个示例的标签质量分数，通过指定 <code>label</code> 作为参数来关注数据中的标签问题。",Ke,ut,Oe,ft,Ms="<thead><tr><th></th> <th>is_label_issue</th> <th>label_score</th> <th>given_label</th> <th>predicted_label</th></tr></thead> <tbody><tr><td>0</td> <td>False</td> <td>0.903926</td> <td>11</td> <td>11</td></tr> <tr><td>1</td> <td>False</td> <td>0.860544</td> <td>11</td> <td>11</td></tr> <tr><td>2</td> <td>False</td> <td>0.658309</td> <td>11</td> <td>11</td></tr> <tr><td>3</td> <td>False</td> <td>0.697085</td> <td>11</td> <td>11</td></tr> <tr><td>4</td> <td>False</td> <td>0.434934</td> <td>11</td> <td>11</td></tr></tbody>",tl,ot,$s="此方法返回一个包含每个示例的标签质量分数的数据框。这些数值分数介于 0 和 1 之间，其中较低的分数表示更可能是错误标记的示例。数据框还包含一个布尔列，指定是否将每个示例识别为具有标签问题（表明它可能是错误标记的）。",el,ct,ys="我们可以获取标记有标签问题的示例的子集，并且还可以按标签质量分数排序，以找到数据集中最可能错误标记的 5 个示例的索引。",ll,ht,sl,Mt,Ts=`cleanlab found 10 potential label errors in the dataset.
Here are indices of the top 5 most likely errors: 
 [379 100 300 485 159]
`,al,$t,ws="让我们查看一些最可能的标签错误。",nl,yt,Js="这里我们展示了数据集中被识别为最可能的标签错误的前 5 个示例，以及它们的给定（原始）标签和 cleanlab 提供的建议替代标签。",il,Tt,pl,wt,_s="上面命令的输出如下所示：",dl,Jt,xs="<thead><tr><th></th> <th>text</th> <th>given_label</th> <th>suggested_label</th></tr></thead> <tbody><tr><td>379</td> <td>Is there a specific source that the exchange rate for the transfer I’m planning on making is pulled from?</td> <td>32</td> <td>11</td></tr> <tr><td>100</td> <td>can you share card tracking number?</td> <td>11</td> <td>36</td></tr> <tr><td>300</td> <td>If I need to cash foreign transfers, how does that work?</td> <td>32</td> <td>46</td></tr> <tr><td>485</td> <td>Was I charged more than I should of been for a currency exchange?</td> <td>17</td> <td>34</td></tr> <tr><td>159</td> <td>Is there any way to see my card in the app?</td> <td>13</td> <td>11</td></tr></tbody>",rl,_t,js="这些是 cleanlab 在此数据中识别的非常清晰的标签错误！请注意，<code>given_label</code> 并没有正确反映这些请求的意图，无论谁制作了这个数据集，在建模数据之前都需要解决许多错误。",ml,xt,bl,jt,gs="根据报告，我们的数据集中包含一些离群值。",ul,gt,Cs="我们可以通过 <code>get_issues</code> 查看哪些示例是离群值（以及一个数值质量分数，量化每个示例看起来有多么典型）。我们将结果数据框按照 cleanlab 的离群值质量分数排序，以查看数据集中最严重的离群值。",fl,Ct,ol,vt,vs="输出如下所示：",cl,Ut,Us="<thead><tr><th></th> <th>is_outlier_issue</th> <th>outlier_score</th></tr></thead> <tbody><tr><td>791</td> <td>True</td> <td>0.024866</td></tr> <tr><td>601</td> <td>True</td> <td>0.031162</td></tr> <tr><td>863</td> <td>True</td> <td>0.060738</td></tr> <tr><td>355</td> <td>True</td> <td>0.064199</td></tr> <tr><td>157</td> <td>True</td> <td>0.065075</td></tr></tbody>",hl,Zt,Ml,Wt,Zs="对于质量最低的离群值，样本输出将如下所示：",$l,Gt,Ws="<thead><tr><th>index</th> <th>text</th> <th>label</th></tr></thead> <tbody><tr><td>791</td> <td>withdrawal pending meaning?</td> <td>46</td></tr> <tr><td>601</td> <td>$1 charge in transaction.</td> <td>34</td></tr> <tr><td>863</td> <td>My atm withdraw is stillpending</td> <td>46</td></tr> <tr><td>355</td> <td>explain the interbank exchange rate</td> <td>32</td></tr> <tr><td>157</td> <td>lost card found, want to put it back in app</td> <td>13</td></tr></tbody>",yl,Ft,Gs="我们看到 cleanlab 已经识别出这个数据集中的条目，这些条目看起来并不是正确的客户请求。此数据集中的离群值似乎是不在范围内的客户请求和其他对意图分类没有意义的非语义文本。仔细考虑这些离群值是否可能对你的数据建模产生不利影响，如果有可能的话，考虑从数据集中移除它们。",Tl,Bt,wl,It,Fs=`根据报告，我们的数据集中包含一些几乎重复的示例集。
我们可以通过 <code>get_issues</code> 查看哪些示例是（几乎）重复的（以及一个数值质量分数，量化每个示例与数据集中最近邻的相似程度）。我们将结果数据框按照 cleanlab 的近重复质量分数排序，以查看数据集中最接近重复的文本示例。`,Jl,kt,_l,Vt,Bs="上面的结果显示了 cleanlab 认为哪些示例是近重复的（<code>is_near_duplicate_issue == True</code> 的行）。在这里，我们看到示例 459 和 429 是近重复的，示例 501 和 412 也是近重复的。",xl,Ht,Is="让我们查看这些示例，看看它们有多么相似。",jl,Rt,gl,Xt,ks="样本输出：",Cl,Yt,Vs="<thead><tr><th>index</th> <th>text</th> <th>label</th></tr></thead> <tbody><tr><td>459</td> <td>I purchased something abroad and the incorrect exchange rate was applied.</td> <td>17</td></tr> <tr><td>429</td> <td>I purchased something overseas and the incorrect exchange rate was applied.</td> <td>17</td></tr></tbody>",vl,Nt,Ul,zt,Hs="样本输出：",Zl,Lt,Rs="<thead><tr><th>index</th> <th>text</th> <th>label</th></tr></thead> <tbody><tr><td>501</td> <td>The exchange rate you are using is really bad.This can’t be the official interbank exchange rate.</td> <td>17</td></tr> <tr><td>412</td> <td>The exchange rate you are using is bad.This can’t be the official interbank exchange rate.</td> <td>17</td></tr></tbody>",Wl,Qt,Xs='我们看到这两组请求确实非常相似！在数据集中包含近重复项可能会对模型产生意想不到的影响，并且要小心不要将它们分割到训练/测试集中。从<a href="../faq.html#How-to-handle-near-duplicate-data-identified-by-cleanlab?">常见问题解答</a>中了解更多关于处理数据集中的近重复数据的信息。',Gl,qt,Fl,Et,Ys="根据报告，我们的数据集似乎不是独立同分布的（IID）。数据集的整体非 IID 分数（如下所示）对应于一个统计测试的 <code>p 值</code>，该测试用于判断数据集中样本的排序是否与它们特征值之间的相似性有关。一个低的 <code>p 值</code>强烈表明数据集违反了 IID 假设，这是从数据集产生的结论（模型）推广到更大总体所需的关键假设。",Bl,Pt,Il,St,Ns="在这里，我们的数据集被标记为非 IID，因为原始数据中的行恰好是按类别标签排序的。如果我们记得在模型训练和数据拆分之前打乱行，这可能是不重要的。但是，如果你不知道为什么你的数据被标记为非IID，那么你应该担心可能的数据漂移或数据点之间的意外交互（它们的价值可能不是统计独立的）。仔细考虑未来的测试数据可能看起来如何（以及你的数据是否代表你关心的人群）。在非 IID 测试运行之前，你不应该打乱数据（这将使结论无效）。",kl,At,zs="如上所示，cleanlab 可以自动筛选出数据集中最可能的问题，帮助你更好地为后续建模整理数据集。有了这个短名单，你可以选择修复这些标签问题，或者从数据集中移除非语义或重复的示例，以获得更高质量的数据集来训练你的下一个机器学习模型。cleanlab 的问题检测可以与你最初训练的<em>任何</em>类型的模型的输出一起运行。",Vl,Dt,Hl,Kt,Ls='<a href="https://github.com/cleanlab/cleanlab" rel="nofollow">Cleanlab</a> 是一个标准的以数据为中心的人工智能包，旨在解决混乱的现实世界数据的质量问题。',Rl,Ot,Qs='请考虑给 Cleanlab Github 仓库一个星标，如果你有兴趣，也可以参与到这个<a href="https://github.com/cleanlab/cleanlab/issues?q=is:issue+is:open+label:%22good+first+issue%22" rel="nofollow">项目</a>中来，比如帮助解决一些简单的问题。。',Xl,te,Yl,le,Nl;return y=new ea({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/issues_in_text_dataset.ipynb"}]}}),T=new ta({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),w=new h({props:{title:"使用 Cleanlab 检测文本数据集中的问题",local:"使用-cleanlab-检测文本数据集中的问题",headingTag:"h1"}}),g=new h({props:{title:"快速入门",local:"快速入门",headingTag:"h2"}}),U=new c({props:{code:"ZnJvbSUyMGNsZWFubGFiJTIwaW1wb3J0JTIwRGF0YWxhYiUwQSUwQWxhYiUyMCUzRCUyMERhdGFsYWIoZGF0YSUzRHlvdXJfZGF0YXNldCUyQyUyMGxhYmVsX25hbWUlM0QlMjJjb2x1bW5fbmFtZV9vZl9sYWJlbHMlMjIpJTBBbGFiLmZpbmRfaXNzdWVzKHByZWRfcHJvYnMlM0R5b3VyX3ByZWRfcHJvYnMlMkMlMjBmZWF0dXJlcyUzRHlvdXJfZmVhdHVyZXMpJTBBJTBBbGFiLnJlcG9ydCgpJTBBbGFiLmdldF9pc3N1ZXMoKQ==",highlighted:`<span class="hljs-keyword">from</span> cleanlab <span class="hljs-keyword">import</span> Datalab

lab = Datalab(data=your_dataset, label_name=<span class="hljs-string">&quot;column_name_of_labels&quot;</span>)
lab.find_issues(pred_probs=your_pred_probs, features=your_features)

lab.report()
lab.get_issues()`,wrap:!1}}),Z=new h({props:{title:"安装需要的依赖",local:"安装需要的依赖",headingTag:"h2"}}),G=new c({props:{code:"IXBpcCUyMGluc3RhbGwlMjAtVSUyMHNjaWtpdC1sZWFybiUyMHNlbnRlbmNlLXRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTBBIXBpcCUyMGluc3RhbGwlMjAtVSUyMCUyMmNsZWFubGFiJTVCZGF0YWxhYiU1RCUyMg==",highlighted:`!pip install -U scikit-learn sentence-transformers datasets
!pip install -U <span class="hljs-string">&quot;cleanlab[datalab]&quot;</span>`,wrap:!1}}),F=new c({props:{code:"aW1wb3J0JTIwcmUlMEFpbXBvcnQlMjBzdHJpbmclMEFpbXBvcnQlMjBwYW5kYXMlMjBhcyUyMHBkJTBBZnJvbSUyMHNrbGVhcm4ubWV0cmljcyUyMGltcG9ydCUyMGFjY3VyYWN5X3Njb3JlJTJDJTIwbG9nX2xvc3MlMEFmcm9tJTIwc2tsZWFybi5tb2RlbF9zZWxlY3Rpb24lMjBpbXBvcnQlMjBjcm9zc192YWxfcHJlZGljdCUwQWZyb20lMjBza2xlYXJuLmxpbmVhcl9tb2RlbCUyMGltcG9ydCUyMExvZ2lzdGljUmVncmVzc2lvbiUwQWZyb20lMjBzZW50ZW5jZV90cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBTZW50ZW5jZVRyYW5zZm9ybWVyJTBBJTBBZnJvbSUyMGNsZWFubGFiJTIwaW1wb3J0JTIwRGF0YWxhYg==",highlighted:`<span class="hljs-keyword">import</span> re
<span class="hljs-keyword">import</span> string
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">from</span> sklearn.metrics <span class="hljs-keyword">import</span> accuracy_score, log_loss
<span class="hljs-keyword">from</span> sklearn.model_selection <span class="hljs-keyword">import</span> cross_val_predict
<span class="hljs-keyword">from</span> sklearn.linear_model <span class="hljs-keyword">import</span> LogisticRegression
<span class="hljs-keyword">from</span> sentence_transformers <span class="hljs-keyword">import</span> SentenceTransformer

<span class="hljs-keyword">from</span> cleanlab <span class="hljs-keyword">import</span> Datalab`,wrap:!1}}),B=new c({props:{code:"aW1wb3J0JTIwcmFuZG9tJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGQuc2V0X29wdGlvbiglMjJkaXNwbGF5Lm1heF9jb2x3aWR0aCUyMiUyQyUyME5vbmUpJTBBJTBBU0VFRCUyMCUzRCUyMDEyMzQ1NiUyMCUyMCUyMyUyMGZvciUyMHJlcHJvZHVjaWJpbGl0eSUwQW5wLnJhbmRvbS5zZWVkKFNFRUQpJTBBcmFuZG9tLnNlZWQoU0VFRCk=",highlighted:`<span class="hljs-keyword">import</span> random
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

pd.set_option(<span class="hljs-string">&quot;display.max_colwidth&quot;</span>, <span class="hljs-literal">None</span>)

SEED = <span class="hljs-number">123456</span>  <span class="hljs-comment"># for reproducibility</span>
np.random.seed(SEED)
random.seed(SEED)`,wrap:!1}}),I=new h({props:{title:"加载和格式化文本数据集",local:"加载和格式化文本数据集",headingTag:"h2"}}),k=new c({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJQb2x5QUklMkZiYW5raW5nNzclMjIlMkMlMjBzcGxpdCUzRCUyMnRyYWluJTIyKSUwQWRhdGElMjAlM0QlMjBwZC5EYXRhRnJhbWUoZGF0YXNldCU1QiUzQTEwMDAlNUQpJTBBZGF0YS5oZWFkKCk=",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

dataset = load_dataset(<span class="hljs-string">&quot;PolyAI/banking77&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
data = pd.DataFrame(dataset[:<span class="hljs-number">1000</span>])
data.head()`,wrap:!1}}),V=new c({props:{code:"cmF3X3RleHRzJTJDJTIwbGFiZWxzJTIwJTNEJTIwZGF0YSU1QiUyMnRleHQlMjIlNUQudmFsdWVzJTJDJTIwZGF0YSU1QiUyMmxhYmVsJTIyJTVELnZhbHVlcyUwQW51bV9jbGFzc2VzJTIwJTNEJTIwbGVuKHNldChsYWJlbHMpKSUwQSUwQXByaW50KGYlMjJUaGlzJTIwZGF0YXNldCUyMGhhcyUyMCU3Qm51bV9jbGFzc2VzJTdEJTIwY2xhc3Nlcy4lMjIpJTBBcHJpbnQoZiUyMkNsYXNzZXMlM0ElMjAlN0JzZXQobGFiZWxzKSU3RCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>raw_texts, labels = data[<span class="hljs-string">&quot;text&quot;</span>].values, data[<span class="hljs-string">&quot;label&quot;</span>].values
<span class="hljs-meta">&gt;&gt;&gt; </span>num_classes = <span class="hljs-built_in">len</span>(<span class="hljs-built_in">set</span>(labels))

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;This dataset has <span class="hljs-subst">{num_classes}</span> classes.&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Classes: <span class="hljs-subst">{<span class="hljs-built_in">set</span>(labels)}</span>&quot;</span>)`,wrap:!1}}),X=new c({props:{code:"aSUyMCUzRCUyMDElMjAlMjAlMjMlMjBjaGFuZ2UlMjB0aGlzJTIwdG8lMjB2aWV3JTIwb3RoZXIlMjBleGFtcGxlcyUyMGZyb20lMjB0aGUlMjBkYXRhc2V0JTBBcHJpbnQoZiUyMkV4YW1wbGUlMjBMYWJlbCUzQSUyMCU3QmxhYmVscyU1QmklNUQlN0QlMjIpJTBBcHJpbnQoZiUyMkV4YW1wbGUlMjBUZXh0JTNBJTIwJTdCcmF3X3RleHRzJTVCaSU1RCU3RCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>i = <span class="hljs-number">1</span>  <span class="hljs-comment"># change this to view other examples from the dataset</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Example Label: <span class="hljs-subst">{labels[i]}</span>&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Example Text: <span class="hljs-subst">{raw_texts[i]}</span>&quot;</span>)`,wrap:!1}}),q=new c({props:{code:"dHJhbnNmb3JtZXIlMjAlM0QlMjBTZW50ZW5jZVRyYW5zZm9ybWVyKCdnb29nbGUlMkZlbGVjdHJhLXNtYWxsLWRpc2NyaW1pbmF0b3InKSUwQXRleHRfZW1iZWRkaW5ncyUyMCUzRCUyMHRyYW5zZm9ybWVyLmVuY29kZShyYXdfdGV4dHMp",highlighted:`transformer = SentenceTransformer(<span class="hljs-string">&#x27;google/electra-small-discriminator&#x27;</span>)
text_embeddings = transformer.encode(raw_texts)`,wrap:!1}}),P=new h({props:{title:"定义一个分类模型并计算样本外的预测概率",local:"定义一个分类模型并计算样本外的预测概率",headingTag:"h2"}}),K=new c({props:{code:"bW9kZWwlMjAlM0QlMjBMb2dpc3RpY1JlZ3Jlc3Npb24obWF4X2l0ZXIlM0Q0MDApJTBBJTBBcHJlZF9wcm9icyUyMCUzRCUyMGNyb3NzX3ZhbF9wcmVkaWN0KG1vZGVsJTJDJTIwdGV4dF9lbWJlZGRpbmdzJTJDJTIwbGFiZWxzJTJDJTIwbWV0aG9kJTNEJTIycHJlZGljdF9wcm9iYSUyMik=",highlighted:`model = LogisticRegression(max_iter=<span class="hljs-number">400</span>)

pred_probs = cross_val_predict(model, text_embeddings, labels, method=<span class="hljs-string">&quot;predict_proba&quot;</span>)`,wrap:!1}}),O=new h({props:{title:"使用 Cleanlab 查找数据集中的问题",local:"使用-cleanlab-查找数据集中的问题",headingTag:"h2"}}),lt=new c({props:{code:"ZGF0YV9kaWN0JTIwJTNEJTIwJTdCJTIydGV4dHMlMjIlM0ElMjByYXdfdGV4dHMlMkMlMjAlMjJsYWJlbHMlMjIlM0ElMjBsYWJlbHMlN0Q=",highlighted:'data_dict = {<span class="hljs-string">&quot;texts&quot;</span>: raw_texts, <span class="hljs-string">&quot;labels&quot;</span>: labels}',wrap:!1}}),at=new c({props:{code:"bGFiJTIwJTNEJTIwRGF0YWxhYihkYXRhX2RpY3QlMkMlMjBsYWJlbF9uYW1lJTNEJTIybGFiZWxzJTIyKSUwQWxhYi5maW5kX2lzc3VlcyhwcmVkX3Byb2JzJTNEcHJlZF9wcm9icyUyQyUyMGZlYXR1cmVzJTNEdGV4dF9lbWJlZGRpbmdzKQ==",highlighted:`lab = Datalab(data_dict, label_name=<span class="hljs-string">&quot;labels&quot;</span>)
lab.find_issues(pred_probs=pred_probs, features=text_embeddings)`,wrap:!1}}),it=new c({props:{code:"RmluZGluZyUyMG51bGwlMjBpc3N1ZXMlMjAuLi4lMEFGaW5kaW5nJTIwbGFiZWwlMjBpc3N1ZXMlMjAuLi4lMEFGaW5kaW5nJTIwb3V0bGllciUyMGlzc3VlcyUyMC4uLiUwQUZpdHRpbmclMjBPT0QlMjBlc3RpbWF0b3IlMjBiYXNlZCUyMG9uJTIwcHJvdmlkZWQlMjBmZWF0dXJlcyUyMC4uLiUwQUZpbmRpbmclMjBuZWFyX2R1cGxpY2F0ZSUyMGlzc3VlcyUyMC4uLiUwQUZpbmRpbmclMjBub25faWlkJTIwaXNzdWVzJTIwLi4uJTBBRmluZGluZyUyMGNsYXNzX2ltYmFsYW5jZSUyMGlzc3VlcyUyMC4uLiUwQUZpbmRpbmclMjB1bmRlcnBlcmZvcm1pbmdfZ3JvdXAlMjBpc3N1ZXMlMjAuLi4lMEElMEFBdWRpdCUyMGNvbXBsZXRlLiUyMDYyJTIwaXNzdWVzJTIwZm91bmQlMjBpbiUyMHRoZSUyMGRhdGFzZXQu",highlighted:`Finding null issues ...
Finding label issues ...
Finding outlier issues ...
Fitting OOD estimator based on provided features ...
Finding near_duplicate issues ...
Finding non_iid issues ...
Finding class_imbalance issues ...
Finding underperforming_group issues ...

Audit complete. 62 issues found <span class="hljs-keyword">in</span> the dataset.`,wrap:!1}}),dt=new c({props:{code:"bGFiLnJlcG9ydCgp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>lab.report()',wrap:!1}}),mt=new h({props:{title:"标签问题",local:"标签问题",headingTag:"h3"}}),ut=new c({props:{code:"bGFiZWxfaXNzdWVzJTIwJTNEJTIwbGFiLmdldF9pc3N1ZXMoJTIybGFiZWwlMjIpJTBBbGFiZWxfaXNzdWVzLmhlYWQoKQ==",highlighted:`label_issues = lab.get_issues(<span class="hljs-string">&quot;label&quot;</span>)
label_issues.head()`,wrap:!1}}),ht=new c({props:{code:"aWRlbnRpZmllZF9sYWJlbF9pc3N1ZXMlMjAlM0QlMjBsYWJlbF9pc3N1ZXMlNUJsYWJlbF9pc3N1ZXMlNUIlMjJpc19sYWJlbF9pc3N1ZSUyMiU1RCUyMCUzRCUzRCUyMFRydWUlNUQlMEFsb3dlc3RfcXVhbGl0eV9sYWJlbHMlMjAlM0QlMjBsYWJlbF9pc3N1ZXMlNUIlMjJsYWJlbF9zY29yZSUyMiU1RC5hcmdzb3J0KCklNUIlM0E1JTVELnRvX251bXB5KCklMEElMEFwcmludCglMEElMjAlMjAlMjAlMjBmJTIyY2xlYW5sYWIlMjBmb3VuZCUyMCU3QmxlbihpZGVudGlmaWVkX2xhYmVsX2lzc3VlcyklN0QlMjBwb3RlbnRpYWwlMjBsYWJlbCUyMGVycm9ycyUyMGluJTIwdGhlJTIwZGF0YXNldC4lNUNuJTIyJTBBJTIwJTIwJTIwJTIwZiUyMkhlcmUlMjBhcmUlMjBpbmRpY2VzJTIwb2YlMjB0aGUlMjB0b3AlMjA1JTIwbW9zdCUyMGxpa2VseSUyMGVycm9ycyUzQSUyMCU1Q24lMjAlN0Jsb3dlc3RfcXVhbGl0eV9sYWJlbHMlN0QlMjIlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>identified_label_issues = label_issues[label_issues[<span class="hljs-string">&quot;is_label_issue&quot;</span>] == <span class="hljs-literal">True</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>lowest_quality_labels = label_issues[<span class="hljs-string">&quot;label_score&quot;</span>].argsort()[:<span class="hljs-number">5</span>].to_numpy()

<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;cleanlab found <span class="hljs-subst">{<span class="hljs-built_in">len</span>(identified_label_issues)}</span> potential label errors in the dataset.\\n&quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">f&quot;Here are indices of the top 5 most likely errors: \\n <span class="hljs-subst">{lowest_quality_labels}</span>&quot;</span>
<span class="hljs-meta">... </span>)`,wrap:!1}}),Tt=new c({props:{code:"ZGF0YV93aXRoX3N1Z2dlc3RlZF9sYWJlbHMlMjAlM0QlMjBwZC5EYXRhRnJhbWUoJTBBJTIwJTIwJTIwJTIwJTdCJTIydGV4dCUyMiUzQSUyMHJhd190ZXh0cyUyQyUyMCUyMmdpdmVuX2xhYmVsJTIyJTNBJTIwbGFiZWxzJTJDJTIwJTIyc3VnZ2VzdGVkX2xhYmVsJTIyJTNBJTIwbGFiZWxfaXNzdWVzJTVCJTIycHJlZGljdGVkX2xhYmVsJTIyJTVEJTdEJTBBKSUwQWRhdGFfd2l0aF9zdWdnZXN0ZWRfbGFiZWxzLmlsb2MlNUJsb3dlc3RfcXVhbGl0eV9sYWJlbHMlNUQ=",highlighted:`data_with_suggested_labels = pd.DataFrame(
    {<span class="hljs-string">&quot;text&quot;</span>: raw_texts, <span class="hljs-string">&quot;given_label&quot;</span>: labels, <span class="hljs-string">&quot;suggested_label&quot;</span>: label_issues[<span class="hljs-string">&quot;predicted_label&quot;</span>]}
)
data_with_suggested_labels.iloc[lowest_quality_labels]`,wrap:!1}}),xt=new h({props:{title:"离群值问题",local:"离群值问题",headingTag:"h3"}}),Ct=new c({props:{code:"b3V0bGllcl9pc3N1ZXMlMjAlM0QlMjBsYWIuZ2V0X2lzc3VlcyglMjJvdXRsaWVyJTIyKSUwQW91dGxpZXJfaXNzdWVzLnNvcnRfdmFsdWVzKCUyMm91dGxpZXJfc2NvcmUlMjIpLmhlYWQoKQ==",highlighted:`outlier_issues = lab.get_issues(<span class="hljs-string">&quot;outlier&quot;</span>)
outlier_issues.sort_values(<span class="hljs-string">&quot;outlier_score&quot;</span>).head()`,wrap:!1}}),Zt=new c({props:{code:"bG93ZXN0X3F1YWxpdHlfb3V0bGllcnMlMjAlM0QlMjBvdXRsaWVyX2lzc3VlcyU1QiUyMm91dGxpZXJfc2NvcmUlMjIlNUQuYXJnc29ydCgpJTVCJTNBNSU1RCUwQSUwQWRhdGEuaWxvYyU1Qmxvd2VzdF9xdWFsaXR5X291dGxpZXJzJTVE",highlighted:`lowest_quality_outliers = outlier_issues[<span class="hljs-string">&quot;outlier_score&quot;</span>].argsort()[:<span class="hljs-number">5</span>]

data.iloc[lowest_quality_outliers]`,wrap:!1}}),Bt=new h({props:{title:"近重复问题",local:"近重复问题",headingTag:"h3"}}),kt=new c({props:{code:"ZHVwbGljYXRlX2lzc3VlcyUyMCUzRCUyMGxhYi5nZXRfaXNzdWVzKCUyMm5lYXJfZHVwbGljYXRlJTIyKSUwQWR1cGxpY2F0ZV9pc3N1ZXMuc29ydF92YWx1ZXMoJTIybmVhcl9kdXBsaWNhdGVfc2NvcmUlMjIpLmhlYWQoKQ==",highlighted:`duplicate_issues = lab.get_issues(<span class="hljs-string">&quot;near_duplicate&quot;</span>)
duplicate_issues.sort_values(<span class="hljs-string">&quot;near_duplicate_score&quot;</span>).head()`,wrap:!1}}),Rt=new c({props:{code:"ZGF0YS5pbG9jJTVCJTVCNDU5JTJDJTIwNDI5JTVEJTVE",highlighted:'data.iloc[[<span class="hljs-number">459</span>, <span class="hljs-number">429</span>]]',wrap:!1}}),Nt=new c({props:{code:"ZGF0YS5pbG9jJTVCJTVCNTAxJTJDJTIwNDEyJTVEJTVE",highlighted:'data.iloc[[<span class="hljs-number">501</span>, <span class="hljs-number">412</span>]]',wrap:!1}}),qt=new h({props:{title:"非独立同分布问题（数据漂移）",local:"非独立同分布问题数据漂移",headingTag:"h3"}}),Pt=new c({props:{code:"cF92YWx1ZSUyMCUzRCUyMGxhYi5nZXRfaW5mbygnbm9uX2lpZCcpJTVCJ3AtdmFsdWUnJTVEJTBBcF92YWx1ZQ==",highlighted:`p_value = lab.get_info(<span class="hljs-string">&#x27;non_iid&#x27;</span>)[<span class="hljs-string">&#x27;p-value&#x27;</span>]
p_value`,wrap:!1}}),Dt=new h({props:{title:"Cleanlab 开源项目",local:"cleanlab-开源项目",headingTag:"h3"}}),te=new la({props:{source:"https://github.com/huggingface/cookbook/blob/main/notebooks/zh-CN/issues_in_text_dataset.md"}}),{c(){M=i("meta"),se=a(),ee=i("p"),ae=a(),r(y.$$.fragment),ne=a(),r(T.$$.fragment),ie=a(),r(w.$$.fragment),pe=a(),J=i("p"),J.innerHTML=Ql,de=a(),_=i("p"),_.innerHTML=ql,re=a(),x=i("p"),x.innerHTML=El,me=a(),j=i("ul"),j.innerHTML=Pl,be=a(),r(g.$$.fragment),ue=a(),C=i("p"),C.innerHTML=Sl,fe=a(),v=i("p"),v.innerHTML=Al,oe=a(),r(U.$$.fragment),ce=a(),r(Z.$$.fragment),he=a(),W=i("p"),W.innerHTML=Dl,Me=a(),r(G.$$.fragment),$e=a(),r(F.$$.fragment),ye=a(),r(B.$$.fragment),Te=a(),r(I.$$.fragment),we=a(),r(k.$$.fragment),Je=a(),r(V.$$.fragment),_e=a(),H=i("pre"),H.textContent=Kl,xe=a(),R=i("p"),R.textContent=Ol,je=a(),r(X.$$.fragment),ge=a(),Y=i("pre"),Y.textContent=ts,Ce=a(),N=i("p"),N.textContent=es,ve=a(),z=i("ol"),z.innerHTML=ls,Ue=a(),$=i("div"),$.innerHTML=ss,Ze=a(),L=i("p"),L.textContent=as,We=a(),Q=i("p"),Q.innerHTML=ns,Ge=a(),r(q.$$.fragment),Fe=a(),E=i("p"),E.innerHTML=is,Be=a(),r(P.$$.fragment),Ie=a(),S=i("p"),S.textContent=ps,ke=a(),A=i("p"),A.innerHTML=ds,Ve=a(),D=i("p"),D.innerHTML=rs,He=a(),r(K.$$.fragment),Re=a(),r(O.$$.fragment),Xe=a(),tt=i("p"),tt.textContent=ms,Ye=a(),et=i("p"),et.innerHTML=bs,Ne=a(),r(lt.$$.fragment),ze=a(),st=i("p"),st.innerHTML=us,Le=a(),r(at.$$.fragment),Qe=a(),nt=i("p"),nt.textContent=fs,qe=a(),r(it.$$.fragment),Ee=a(),pt=i("p"),pt.innerHTML=os,Pe=a(),r(dt.$$.fragment),Se=a(),rt=i("pre"),rt.textContent=cs,Ae=a(),r(mt.$$.fragment),De=a(),bt=i("p"),bt.innerHTML=hs,Ke=a(),r(ut.$$.fragment),Oe=a(),ft=i("table"),ft.innerHTML=Ms,tl=a(),ot=i("p"),ot.textContent=$s,el=a(),ct=i("p"),ct.textContent=ys,ll=a(),r(ht.$$.fragment),sl=a(),Mt=i("pre"),Mt.textContent=Ts,al=a(),$t=i("p"),$t.textContent=ws,nl=a(),yt=i("p"),yt.textContent=Js,il=a(),r(Tt.$$.fragment),pl=a(),wt=i("p"),wt.textContent=_s,dl=a(),Jt=i("table"),Jt.innerHTML=xs,rl=a(),_t=i("p"),_t.innerHTML=js,ml=a(),r(xt.$$.fragment),bl=a(),jt=i("p"),jt.textContent=gs,ul=a(),gt=i("p"),gt.innerHTML=Cs,fl=a(),r(Ct.$$.fragment),ol=a(),vt=i("p"),vt.textContent=vs,cl=a(),Ut=i("table"),Ut.innerHTML=Us,hl=a(),r(Zt.$$.fragment),Ml=a(),Wt=i("p"),Wt.textContent=Zs,$l=a(),Gt=i("table"),Gt.innerHTML=Ws,yl=a(),Ft=i("p"),Ft.textContent=Gs,Tl=a(),r(Bt.$$.fragment),wl=a(),It=i("p"),It.innerHTML=Fs,Jl=a(),r(kt.$$.fragment),_l=a(),Vt=i("p"),Vt.innerHTML=Bs,xl=a(),Ht=i("p"),Ht.textContent=Is,jl=a(),r(Rt.$$.fragment),gl=a(),Xt=i("p"),Xt.textContent=ks,Cl=a(),Yt=i("table"),Yt.innerHTML=Vs,vl=a(),r(Nt.$$.fragment),Ul=a(),zt=i("p"),zt.textContent=Hs,Zl=a(),Lt=i("table"),Lt.innerHTML=Rs,Wl=a(),Qt=i("p"),Qt.innerHTML=Xs,Gl=a(),r(qt.$$.fragment),Fl=a(),Et=i("p"),Et.innerHTML=Ys,Bl=a(),r(Pt.$$.fragment),Il=a(),St=i("p"),St.textContent=Ns,kl=a(),At=i("p"),At.innerHTML=zs,Vl=a(),r(Dt.$$.fragment),Hl=a(),Kt=i("p"),Kt.innerHTML=Ls,Rl=a(),Ot=i("p"),Ot.innerHTML=Qs,Xl=a(),r(te.$$.fragment),Yl=a(),le=i("p"),this.h()},l(t){const e=Ks("svelte-u9bgzb",document.head);M=p(e,"META",{name:!0,content:!0}),e.forEach(l),se=n(t),ee=p(t,"P",{}),qs(ee).forEach(l),ae=n(t),m(y.$$.fragment,t),ne=n(t),m(T.$$.fragment,t),ie=n(t),m(w.$$.fragment,t),pe=n(t),J=p(t,"P",{"data-svelte-h":!0}),d(J)!=="svelte-1cqt7cs"&&(J.innerHTML=Ql),de=n(t),_=p(t,"P",{"data-svelte-h":!0}),d(_)!=="svelte-q54i4l"&&(_.innerHTML=ql),re=n(t),x=p(t,"P",{"data-svelte-h":!0}),d(x)!=="svelte-sya77"&&(x.innerHTML=El),me=n(t),j=p(t,"UL",{"data-svelte-h":!0}),d(j)!=="svelte-1fq4kjo"&&(j.innerHTML=Pl),be=n(t),m(g.$$.fragment,t),ue=n(t),C=p(t,"P",{"data-svelte-h":!0}),d(C)!=="svelte-1g9kg3k"&&(C.innerHTML=Sl),fe=n(t),v=p(t,"P",{"data-svelte-h":!0}),d(v)!=="svelte-xpkf6n"&&(v.innerHTML=Al),oe=n(t),m(U.$$.fragment,t),ce=n(t),m(Z.$$.fragment,t),he=n(t),W=p(t,"P",{"data-svelte-h":!0}),d(W)!=="svelte-1puhpjh"&&(W.innerHTML=Dl),Me=n(t),m(G.$$.fragment,t),$e=n(t),m(F.$$.fragment,t),ye=n(t),m(B.$$.fragment,t),Te=n(t),m(I.$$.fragment,t),we=n(t),m(k.$$.fragment,t),Je=n(t),m(V.$$.fragment,t),_e=n(t),H=p(t,"PRE",{"data-svelte-h":!0}),d(H)!=="svelte-1baoe44"&&(H.textContent=Kl),xe=n(t),R=p(t,"P",{"data-svelte-h":!0}),d(R)!=="svelte-1or2o6l"&&(R.textContent=Ol),je=n(t),m(X.$$.fragment,t),ge=n(t),Y=p(t,"PRE",{"data-svelte-h":!0}),d(Y)!=="svelte-17yipnq"&&(Y.textContent=ts),Ce=n(t),N=p(t,"P",{"data-svelte-h":!0}),d(N)!=="svelte-1jrvbcd"&&(N.textContent=es),ve=n(t),z=p(t,"OL",{"data-svelte-h":!0}),d(z)!=="svelte-2fb4k8"&&(z.innerHTML=ls),Ue=n(t),$=p(t,"DIV",{class:!0,"data-svelte-h":!0}),d($)!=="svelte-1l1cd4w"&&($.innerHTML=ss),Ze=n(t),L=p(t,"P",{"data-svelte-h":!0}),d(L)!=="svelte-v3vdg8"&&(L.textContent=as),We=n(t),Q=p(t,"P",{"data-svelte-h":!0}),d(Q)!=="svelte-z7vswy"&&(Q.innerHTML=ns),Ge=n(t),m(q.$$.fragment,t),Fe=n(t),E=p(t,"P",{"data-svelte-h":!0}),d(E)!=="svelte-vgzg2b"&&(E.innerHTML=is),Be=n(t),m(P.$$.fragment,t),Ie=n(t),S=p(t,"P",{"data-svelte-h":!0}),d(S)!=="svelte-etxtq8"&&(S.textContent=ps),ke=n(t),A=p(t,"P",{"data-svelte-h":!0}),d(A)!=="svelte-1u7nn5a"&&(A.innerHTML=ds),Ve=n(t),D=p(t,"P",{"data-svelte-h":!0}),d(D)!=="svelte-140lqqw"&&(D.innerHTML=rs),He=n(t),m(K.$$.fragment,t),Re=n(t),m(O.$$.fragment,t),Xe=n(t),tt=p(t,"P",{"data-svelte-h":!0}),d(tt)!=="svelte-1f85ppw"&&(tt.textContent=ms),Ye=n(t),et=p(t,"P",{"data-svelte-h":!0}),d(et)!=="svelte-1agumzq"&&(et.innerHTML=bs),Ne=n(t),m(lt.$$.fragment,t),ze=n(t),st=p(t,"P",{"data-svelte-h":!0}),d(st)!=="svelte-1fnlj30"&&(st.innerHTML=us),Le=n(t),m(at.$$.fragment,t),Qe=n(t),nt=p(t,"P",{"data-svelte-h":!0}),d(nt)!=="svelte-1qztnx7"&&(nt.textContent=fs),qe=n(t),m(it.$$.fragment,t),Ee=n(t),pt=p(t,"P",{"data-svelte-h":!0}),d(pt)!=="svelte-91zih2"&&(pt.innerHTML=os),Pe=n(t),m(dt.$$.fragment,t),Se=n(t),rt=p(t,"PRE",{"data-svelte-h":!0}),d(rt)!=="svelte-1uushu"&&(rt.textContent=cs),Ae=n(t),m(mt.$$.fragment,t),De=n(t),bt=p(t,"P",{"data-svelte-h":!0}),d(bt)!=="svelte-c99j95"&&(bt.innerHTML=hs),Ke=n(t),m(ut.$$.fragment,t),Oe=n(t),ft=p(t,"TABLE",{"data-svelte-h":!0}),d(ft)!=="svelte-1xd6s59"&&(ft.innerHTML=Ms),tl=n(t),ot=p(t,"P",{"data-svelte-h":!0}),d(ot)!=="svelte-11ozylm"&&(ot.textContent=$s),el=n(t),ct=p(t,"P",{"data-svelte-h":!0}),d(ct)!=="svelte-1xrihou"&&(ct.textContent=ys),ll=n(t),m(ht.$$.fragment,t),sl=n(t),Mt=p(t,"PRE",{"data-svelte-h":!0}),d(Mt)!=="svelte-ku705s"&&(Mt.textContent=Ts),al=n(t),$t=p(t,"P",{"data-svelte-h":!0}),d($t)!=="svelte-10bwoeg"&&($t.textContent=ws),nl=n(t),yt=p(t,"P",{"data-svelte-h":!0}),d(yt)!=="svelte-17n43qd"&&(yt.textContent=Js),il=n(t),m(Tt.$$.fragment,t),pl=n(t),wt=p(t,"P",{"data-svelte-h":!0}),d(wt)!=="svelte-30eiy9"&&(wt.textContent=_s),dl=n(t),Jt=p(t,"TABLE",{"data-svelte-h":!0}),d(Jt)!=="svelte-15w938v"&&(Jt.innerHTML=xs),rl=n(t),_t=p(t,"P",{"data-svelte-h":!0}),d(_t)!=="svelte-1qr4up6"&&(_t.innerHTML=js),ml=n(t),m(xt.$$.fragment,t),bl=n(t),jt=p(t,"P",{"data-svelte-h":!0}),d(jt)!=="svelte-1iv0468"&&(jt.textContent=gs),ul=n(t),gt=p(t,"P",{"data-svelte-h":!0}),d(gt)!=="svelte-1e82i7b"&&(gt.innerHTML=Cs),fl=n(t),m(Ct.$$.fragment,t),ol=n(t),vt=p(t,"P",{"data-svelte-h":!0}),d(vt)!=="svelte-ikolsi"&&(vt.textContent=vs),cl=n(t),Ut=p(t,"TABLE",{"data-svelte-h":!0}),d(Ut)!=="svelte-1u55nqa"&&(Ut.innerHTML=Us),hl=n(t),m(Zt.$$.fragment,t),Ml=n(t),Wt=p(t,"P",{"data-svelte-h":!0}),d(Wt)!=="svelte-zhf6bu"&&(Wt.textContent=Zs),$l=n(t),Gt=p(t,"TABLE",{"data-svelte-h":!0}),d(Gt)!=="svelte-1n860xg"&&(Gt.innerHTML=Ws),yl=n(t),Ft=p(t,"P",{"data-svelte-h":!0}),d(Ft)!=="svelte-85tsbj"&&(Ft.textContent=Gs),Tl=n(t),m(Bt.$$.fragment,t),wl=n(t),It=p(t,"P",{"data-svelte-h":!0}),d(It)!=="svelte-r9woaz"&&(It.innerHTML=Fs),Jl=n(t),m(kt.$$.fragment,t),_l=n(t),Vt=p(t,"P",{"data-svelte-h":!0}),d(Vt)!=="svelte-y0hvck"&&(Vt.innerHTML=Bs),xl=n(t),Ht=p(t,"P",{"data-svelte-h":!0}),d(Ht)!=="svelte-ojzyjd"&&(Ht.textContent=Is),jl=n(t),m(Rt.$$.fragment,t),gl=n(t),Xt=p(t,"P",{"data-svelte-h":!0}),d(Xt)!=="svelte-so706c"&&(Xt.textContent=ks),Cl=n(t),Yt=p(t,"TABLE",{"data-svelte-h":!0}),d(Yt)!=="svelte-1hzopql"&&(Yt.innerHTML=Vs),vl=n(t),m(Nt.$$.fragment,t),Ul=n(t),zt=p(t,"P",{"data-svelte-h":!0}),d(zt)!=="svelte-so706c"&&(zt.textContent=Hs),Zl=n(t),Lt=p(t,"TABLE",{"data-svelte-h":!0}),d(Lt)!=="svelte-6cycax"&&(Lt.innerHTML=Rs),Wl=n(t),Qt=p(t,"P",{"data-svelte-h":!0}),d(Qt)!=="svelte-jajwya"&&(Qt.innerHTML=Xs),Gl=n(t),m(qt.$$.fragment,t),Fl=n(t),Et=p(t,"P",{"data-svelte-h":!0}),d(Et)!=="svelte-1qpqvfm"&&(Et.innerHTML=Ys),Bl=n(t),m(Pt.$$.fragment,t),Il=n(t),St=p(t,"P",{"data-svelte-h":!0}),d(St)!=="svelte-1oiyg2i"&&(St.textContent=Ns),kl=n(t),At=p(t,"P",{"data-svelte-h":!0}),d(At)!=="svelte-1yrcnad"&&(At.innerHTML=zs),Vl=n(t),m(Dt.$$.fragment,t),Hl=n(t),Kt=p(t,"P",{"data-svelte-h":!0}),d(Kt)!=="svelte-1t798br"&&(Kt.innerHTML=Ls),Rl=n(t),Ot=p(t,"P",{"data-svelte-h":!0}),d(Ot)!=="svelte-12rvpvg"&&(Ot.innerHTML=Qs),Xl=n(t),m(te.$$.fragment,t),Yl=n(t),le=p(t,"P",{}),qs(le).forEach(l),this.h()},h(){zl(M,"name","hf:doc:metadata"),zl(M,"content",aa),zl($,"class","alert alert-info")},m(t,e){Os(document.head,M),s(t,se,e),s(t,ee,e),s(t,ae,e),b(y,t,e),s(t,ne,e),b(T,t,e),s(t,ie,e),b(w,t,e),s(t,pe,e),s(t,J,e),s(t,de,e),s(t,_,e),s(t,re,e),s(t,x,e),s(t,me,e),s(t,j,e),s(t,be,e),b(g,t,e),s(t,ue,e),s(t,C,e),s(t,fe,e),s(t,v,e),s(t,oe,e),b(U,t,e),s(t,ce,e),b(Z,t,e),s(t,he,e),s(t,W,e),s(t,Me,e),b(G,t,e),s(t,$e,e),b(F,t,e),s(t,ye,e),b(B,t,e),s(t,Te,e),b(I,t,e),s(t,we,e),b(k,t,e),s(t,Je,e),b(V,t,e),s(t,_e,e),s(t,H,e),s(t,xe,e),s(t,R,e),s(t,je,e),b(X,t,e),s(t,ge,e),s(t,Y,e),s(t,Ce,e),s(t,N,e),s(t,ve,e),s(t,z,e),s(t,Ue,e),s(t,$,e),s(t,Ze,e),s(t,L,e),s(t,We,e),s(t,Q,e),s(t,Ge,e),b(q,t,e),s(t,Fe,e),s(t,E,e),s(t,Be,e),b(P,t,e),s(t,Ie,e),s(t,S,e),s(t,ke,e),s(t,A,e),s(t,Ve,e),s(t,D,e),s(t,He,e),b(K,t,e),s(t,Re,e),b(O,t,e),s(t,Xe,e),s(t,tt,e),s(t,Ye,e),s(t,et,e),s(t,Ne,e),b(lt,t,e),s(t,ze,e),s(t,st,e),s(t,Le,e),b(at,t,e),s(t,Qe,e),s(t,nt,e),s(t,qe,e),b(it,t,e),s(t,Ee,e),s(t,pt,e),s(t,Pe,e),b(dt,t,e),s(t,Se,e),s(t,rt,e),s(t,Ae,e),b(mt,t,e),s(t,De,e),s(t,bt,e),s(t,Ke,e),b(ut,t,e),s(t,Oe,e),s(t,ft,e),s(t,tl,e),s(t,ot,e),s(t,el,e),s(t,ct,e),s(t,ll,e),b(ht,t,e),s(t,sl,e),s(t,Mt,e),s(t,al,e),s(t,$t,e),s(t,nl,e),s(t,yt,e),s(t,il,e),b(Tt,t,e),s(t,pl,e),s(t,wt,e),s(t,dl,e),s(t,Jt,e),s(t,rl,e),s(t,_t,e),s(t,ml,e),b(xt,t,e),s(t,bl,e),s(t,jt,e),s(t,ul,e),s(t,gt,e),s(t,fl,e),b(Ct,t,e),s(t,ol,e),s(t,vt,e),s(t,cl,e),s(t,Ut,e),s(t,hl,e),b(Zt,t,e),s(t,Ml,e),s(t,Wt,e),s(t,$l,e),s(t,Gt,e),s(t,yl,e),s(t,Ft,e),s(t,Tl,e),b(Bt,t,e),s(t,wl,e),s(t,It,e),s(t,Jl,e),b(kt,t,e),s(t,_l,e),s(t,Vt,e),s(t,xl,e),s(t,Ht,e),s(t,jl,e),b(Rt,t,e),s(t,gl,e),s(t,Xt,e),s(t,Cl,e),s(t,Yt,e),s(t,vl,e),b(Nt,t,e),s(t,Ul,e),s(t,zt,e),s(t,Zl,e),s(t,Lt,e),s(t,Wl,e),s(t,Qt,e),s(t,Gl,e),b(qt,t,e),s(t,Fl,e),s(t,Et,e),s(t,Bl,e),b(Pt,t,e),s(t,Il,e),s(t,St,e),s(t,kl,e),s(t,At,e),s(t,Vl,e),b(Dt,t,e),s(t,Hl,e),s(t,Kt,e),s(t,Rl,e),s(t,Ot,e),s(t,Xl,e),b(te,t,e),s(t,Yl,e),s(t,le,e),Nl=!0},p:Ps,i(t){Nl||(u(y.$$.fragment,t),u(T.$$.fragment,t),u(w.$$.fragment,t),u(g.$$.fragment,t),u(U.$$.fragment,t),u(Z.$$.fragment,t),u(G.$$.fragment,t),u(F.$$.fragment,t),u(B.$$.fragment,t),u(I.$$.fragment,t),u(k.$$.fragment,t),u(V.$$.fragment,t),u(X.$$.fragment,t),u(q.$$.fragment,t),u(P.$$.fragment,t),u(K.$$.fragment,t),u(O.$$.fragment,t),u(lt.$$.fragment,t),u(at.$$.fragment,t),u(it.$$.fragment,t),u(dt.$$.fragment,t),u(mt.$$.fragment,t),u(ut.$$.fragment,t),u(ht.$$.fragment,t),u(Tt.$$.fragment,t),u(xt.$$.fragment,t),u(Ct.$$.fragment,t),u(Zt.$$.fragment,t),u(Bt.$$.fragment,t),u(kt.$$.fragment,t),u(Rt.$$.fragment,t),u(Nt.$$.fragment,t),u(qt.$$.fragment,t),u(Pt.$$.fragment,t),u(Dt.$$.fragment,t),u(te.$$.fragment,t),Nl=!0)},o(t){f(y.$$.fragment,t),f(T.$$.fragment,t),f(w.$$.fragment,t),f(g.$$.fragment,t),f(U.$$.fragment,t),f(Z.$$.fragment,t),f(G.$$.fragment,t),f(F.$$.fragment,t),f(B.$$.fragment,t),f(I.$$.fragment,t),f(k.$$.fragment,t),f(V.$$.fragment,t),f(X.$$.fragment,t),f(q.$$.fragment,t),f(P.$$.fragment,t),f(K.$$.fragment,t),f(O.$$.fragment,t),f(lt.$$.fragment,t),f(at.$$.fragment,t),f(it.$$.fragment,t),f(dt.$$.fragment,t),f(mt.$$.fragment,t),f(ut.$$.fragment,t),f(ht.$$.fragment,t),f(Tt.$$.fragment,t),f(xt.$$.fragment,t),f(Ct.$$.fragment,t),f(Zt.$$.fragment,t),f(Bt.$$.fragment,t),f(kt.$$.fragment,t),f(Rt.$$.fragment,t),f(Nt.$$.fragment,t),f(qt.$$.fragment,t),f(Pt.$$.fragment,t),f(Dt.$$.fragment,t),f(te.$$.fragment,t),Nl=!1},d(t){t&&(l(se),l(ee),l(ae),l(ne),l(ie),l(pe),l(J),l(de),l(_),l(re),l(x),l(me),l(j),l(be),l(ue),l(C),l(fe),l(v),l(oe),l(ce),l(he),l(W),l(Me),l($e),l(ye),l(Te),l(we),l(Je),l(_e),l(H),l(xe),l(R),l(je),l(ge),l(Y),l(Ce),l(N),l(ve),l(z),l(Ue),l($),l(Ze),l(L),l(We),l(Q),l(Ge),l(Fe),l(E),l(Be),l(Ie),l(S),l(ke),l(A),l(Ve),l(D),l(He),l(Re),l(Xe),l(tt),l(Ye),l(et),l(Ne),l(ze),l(st),l(Le),l(Qe),l(nt),l(qe),l(Ee),l(pt),l(Pe),l(Se),l(rt),l(Ae),l(De),l(bt),l(Ke),l(Oe),l(ft),l(tl),l(ot),l(el),l(ct),l(ll),l(sl),l(Mt),l(al),l($t),l(nl),l(yt),l(il),l(pl),l(wt),l(dl),l(Jt),l(rl),l(_t),l(ml),l(bl),l(jt),l(ul),l(gt),l(fl),l(ol),l(vt),l(cl),l(Ut),l(hl),l(Ml),l(Wt),l($l),l(Gt),l(yl),l(Ft),l(Tl),l(wl),l(It),l(Jl),l(_l),l(Vt),l(xl),l(Ht),l(jl),l(gl),l(Xt),l(Cl),l(Yt),l(vl),l(Ul),l(zt),l(Zl),l(Lt),l(Wl),l(Qt),l(Gl),l(Fl),l(Et),l(Bl),l(Il),l(St),l(kl),l(At),l(Vl),l(Hl),l(Kt),l(Rl),l(Ot),l(Xl),l(Yl),l(le)),l(M),o(y,t),o(T,t),o(w,t),o(g,t),o(U,t),o(Z,t),o(G,t),o(F,t),o(B,t),o(I,t),o(k,t),o(V,t),o(X,t),o(q,t),o(P,t),o(K,t),o(O,t),o(lt,t),o(at,t),o(it,t),o(dt,t),o(mt,t),o(ut,t),o(ht,t),o(Tt,t),o(xt,t),o(Ct,t),o(Zt,t),o(Bt,t),o(kt,t),o(Rt,t),o(Nt,t),o(qt,t),o(Pt,t),o(Dt,t),o(te,t)}}}const aa='{"title":"使用 Cleanlab 检测文本数据集中的问题","local":"使用-cleanlab-检测文本数据集中的问题","sections":[{"title":"快速入门","local":"快速入门","sections":[],"depth":2},{"title":"安装需要的依赖","local":"安装需要的依赖","sections":[],"depth":2},{"title":"加载和格式化文本数据集","local":"加载和格式化文本数据集","sections":[],"depth":2},{"title":"定义一个分类模型并计算样本外的预测概率","local":"定义一个分类模型并计算样本外的预测概率","sections":[],"depth":2},{"title":"使用 Cleanlab 查找数据集中的问题","local":"使用-cleanlab-查找数据集中的问题","sections":[{"title":"标签问题","local":"标签问题","sections":[],"depth":3},{"title":"离群值问题","local":"离群值问题","sections":[],"depth":3},{"title":"近重复问题","local":"近重复问题","sections":[],"depth":3},{"title":"非独立同分布问题（数据漂移）","local":"非独立同分布问题数据漂移","sections":[],"depth":3},{"title":"Cleanlab 开源项目","local":"cleanlab-开源项目","sections":[],"depth":3}],"depth":2}],"depth":1}';function na(Ll){return Ss(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ba extends As{constructor(M){super(),Ds(this,M,na,sa,Es,{})}}export{ba as component};
