import{s as qs,n as Qs,o as Es}from"../chunks/scheduler.39a43cde.js";import{S as Ps,i as Ss,g as i,s as a,r,A as As,h as p,f as l,c as n,j as Ls,u as m,x as d,k as Nl,y as Ds,a as s,v as u,d as b,t as f,w as o}from"../chunks/index.23ec2204.js";import{D as Ks,C as c}from"../chunks/DocNotebookDropdown.21a75b74.js";import{H as h,E as Os}from"../chunks/EditOnGithub.f2d09226.js";function ta(Yl){let M,le,te,se,y,ae,T,ne,w,zl='作者: <a href="https://huggingface.co/aravindputrevu" rel="nofollow">Aravind Putrevu</a>',ie,_,Ll='在这个 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>自动识别我们数据集中的坏例子，包括错误标记的数据、范围外的示例（离群值）或其他模糊不清的示例。在深入建模你的数据之前，请考虑过滤或更正这样的坏例子！',pe,J,ql="<strong>本教程我们将要做的事情概述：</strong>",de,j,Ql="<li><p>使用预训练的 transformer 模型从客户服务请求中提取文本嵌入</p></li> <li><p>在文本嵌入上训练一个简单的逻辑回归模型，以计算样本外的预测概率</p></li> <li><p>使用这些预测和嵌入运行 Cleanlab 的 <code>Datalab</code> 审核，以识别数据集中的问题，如：标签问题、离群值和近重复项。</p></li>",re,x,me,g,El="已经有一个模型在现有标签集上训练得到的（样本外）<code>pred_probs</code> 了吗？也许你还有一些数值<code>特征</code>？运行下面的代码来查找数据集中的任何潜在标签错误。",ue,v,Pl="<strong>注意：</strong> 如果在 Colab 上运行，可能需要使用 GPU（选择：Runtime &gt; Change runtime type &gt; Hardware accelerator &gt; GPU）",be,C,fe,U,oe,Z,Sl="你可以使用 <code>pip</code> 按照以下方式安装本教程所需的所有包：",ce,G,he,W,Me,F,$e,B,ye,I,Te,k,we,V,Al=`This dataset has 7 classes.
Classes: &#123;32, 34, 36, 11, 13, 46, 17}
`,_e,H,Dl="让我们查看数据集中的第 i 个示例：",Je,X,je,R,Kl=`Example Label: 11
Example Text: What can I do if my card still hasn't arrived after 2 weeks?
`,xe,N,Ol="数据以两个 numpy 数组的形式存储：",ge,Y,ts="<li><code>raw_texts</code> 以文本格式存储客户服务请求的话语</li> <li><code>labels</code> 存储每个示例的意图类别（标签）</li>",ve,$,es="<p>自有数据？</p> <p>你可以轻松地将上述内容替换为你自己的文本数据集，并继续进行教程的其余部分。</p>",Ce,z,ls="接下来，我们将文本字符串转换为更适合作为机器学习模型输入的向量。",Ue,L,ss='我们将使用预训练的 Transformer 模型提供的数值表示作为我们文本的嵌入。<a href="https://huggingface.co/docs/hub/sentence-transformers" rel="nofollow">Sentence Transformers</a> 库提供了计算文本数据嵌入的简单方法。在这里，我们加载了预训练的 <code>electra-small-discriminator</code> 模型，然后通过网络运行我们的数据，以提取每个示例的向量嵌入。',Ze,q,Ge,Q,as="我们后续的机器学习模型将直接在 <code>text_embeddings</code> 的元素上操作，以便对客户服务请求进行分类。",We,E,Fe,P,ns="为了利用预训练网络进行特定的分类任务，一种典型的方法是添加一个线性输出层，并在新数据上微调网络参数。然而，这可能需要大量的计算资源。另一种方法是冻结网络的预训练权重，只训练输出层，而不依赖于 GPU。在这里，我们通过在提取的嵌入顶部拟合一个 scikit-learn 线性模型来方便地实现这一点。",Be,S,is="为了识别标签问题，cleanlab 需要你的模型为每个数据点提供概率预测。然而，对于模型之前训练过的数据点，这些预测将是过拟合的（因此不可靠）。cleanlab 旨在仅与<strong>样本外</strong>的预测类概率一起使用，即在模型训练期间保持不变的数据点。",Ie,A,ps=`在这里，我们使用带有交叉验证的逻辑回归模型来获得数据集中每个示例的样本外预测类概率。
确保你的 <code>pred_probs</code> 列根据类的排序正确排序，对于 Datalab 来说，是：按类名字典顺序排序。`,ke,D,Ve,K,He,O,ds="在给定来自你拥有的任何模型的特征嵌入和（样本外）预测类概率的情况下，cleanlab 可以帮助你快速识别数据中的低质量示例。",Xe,tt,rs="在这里，我们使用 Cleanlab 的 <code>Datalab</code> 来查找数据中的问题。Datalab 提供了几种加载数据的方式；我们将简单地在字典中包装训练特征和噪声标签。",Re,et,Ne,lt,ms="审核你的数据所需的全部操作就是调用 <code>find_issues()</code>。我们传入上面获得的预测概率和特征嵌入，但你不一定需要提供所有这些信息，具体取决于你对哪些类型的问题感兴趣。你提供的输入越多，<code>Datalab</code> 就能在你的数据中检测到更多类型的问题。使用更好的模型来生成这些输入将确保 cleanlab 更准确地估计问题。",Ye,st,ze,at,us="输出看起来如下：",Le,nt,qe,it,bs="审计完成后，使用 <code>report</code> 方法来查看审计结果。",Qe,pt,Ee,dt,fs=`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
`,Pe,rt,Se,mt,os="报告显示 cleanlab 在我们的数据集中识别出了许多标签问题。我们可以使用 <code>get_issues</code> 方法来查看哪些示例被标记为可能标签错误，以及每个示例的标签质量分数，通过指定 <code>label</code> 作为参数来关注数据中的标签问题。",Ae,ut,De,bt,cs="<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>",Ke,ft,hs="此方法返回一个包含每个示例的标签质量分数的数据框。这些数值分数介于 0 和 1 之间，其中较低的分数表示更可能是错误标记的示例。数据框还包含一个布尔列，指定是否将每个示例识别为具有标签问题（表明它可能是错误标记的）。",Oe,ot,Ms="我们可以获取标记有标签问题的示例的子集，并且还可以按标签质量分数排序，以找到数据集中最可能错误标记的 5 个示例的索引。",tl,ct,el,ht,$s=`cleanlab found 10 potential label errors in the dataset.
Here are indices of the top 5 most likely errors: 
 [379 100 300 485 159]
`,ll,Mt,ys="让我们查看一些最可能的标签错误。",sl,$t,Ts="这里我们展示了数据集中被识别为最可能的标签错误的前 5 个示例，以及它们的给定（原始）标签和 cleanlab 提供的建议替代标签。",al,yt,nl,Tt,ws="上面命令的输出如下所示：",il,wt,_s="<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>",pl,_t,Js="这些是 cleanlab 在此数据中识别的非常清晰的标签错误！请注意，<code>given_label</code> 并没有正确反映这些请求的意图，无论谁制作了这个数据集，在建模数据之前都需要解决许多错误。",dl,Jt,rl,jt,js="根据报告，我们的数据集中包含一些离群值。",ml,xt,xs="我们可以通过 <code>get_issues</code> 查看哪些示例是离群值（以及一个数值质量分数，量化每个示例看起来有多么典型）。我们将结果数据框按照 cleanlab 的离群值质量分数排序，以查看数据集中最严重的离群值。",ul,gt,bl,vt,gs="输出如下所示：",fl,Ct,vs="<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>",ol,Ut,cl,Zt,Cs="对于质量最低的离群值，样本输出将如下所示：",hl,Gt,Us="<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>",Ml,Wt,Zs="我们看到 cleanlab 已经识别出这个数据集中的条目，这些条目看起来并不是正确的客户请求。此数据集中的离群值似乎是不在范围内的客户请求和其他对意图分类没有意义的非语义文本。仔细考虑这些离群值是否可能对你的数据建模产生不利影响，如果有可能的话，考虑从数据集中移除它们。",$l,Ft,yl,Bt,Gs=`根据报告，我们的数据集中包含一些几乎重复的示例集。
我们可以通过 <code>get_issues</code> 查看哪些示例是（几乎）重复的（以及一个数值质量分数，量化每个示例与数据集中最近邻的相似程度）。我们将结果数据框按照 cleanlab 的近重复质量分数排序，以查看数据集中最接近重复的文本示例。`,Tl,It,wl,kt,Ws="上面的结果显示了 cleanlab 认为哪些示例是近重复的（<code>is_near_duplicate_issue == True</code> 的行）。在这里，我们看到示例 459 和 429 是近重复的，示例 501 和 412 也是近重复的。",_l,Vt,Fs="让我们查看这些示例，看看它们有多么相似。",Jl,Ht,jl,Xt,Bs="样本输出：",xl,Rt,Is="<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>",gl,Nt,vl,Yt,ks="样本输出：",Cl,zt,Vs="<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>",Ul,Lt,Hs='我们看到这两组请求确实非常相似！在数据集中包含近重复项可能会对模型产生意想不到的影响，并且要小心不要将它们分割到训练/测试集中。从<a href="../faq.html#How-to-handle-near-duplicate-data-identified-by-cleanlab?">常见问题解答</a>中了解更多关于处理数据集中的近重复数据的信息。',Zl,qt,Gl,Qt,Xs="根据报告，我们的数据集似乎不是独立同分布的（IID）。数据集的整体非 IID 分数（如下所示）对应于一个统计测试的 <code>p 值</code>，该测试用于判断数据集中样本的排序是否与它们特征值之间的相似性有关。一个低的 <code>p 值</code>强烈表明数据集违反了 IID 假设，这是从数据集产生的结论（模型）推广到更大总体所需的关键假设。",Wl,Et,Fl,Pt,Rs="在这里，我们的数据集被标记为非 IID，因为原始数据中的行恰好是按类别标签排序的。如果我们记得在模型训练和数据拆分之前打乱行，这可能是不重要的。但是，如果你不知道为什么你的数据被标记为非IID，那么你应该担心可能的数据漂移或数据点之间的意外交互（它们的价值可能不是统计独立的）。仔细考虑未来的测试数据可能看起来如何（以及你的数据是否代表你关心的人群）。在非 IID 测试运行之前，你不应该打乱数据（这将使结论无效）。",Bl,St,Ns="如上所示，cleanlab 可以自动筛选出数据集中最可能的问题，帮助你更好地为后续建模整理数据集。有了这个短名单，你可以选择修复这些标签问题，或者从数据集中移除非语义或重复的示例，以获得更高质量的数据集来训练你的下一个机器学习模型。cleanlab 的问题检测可以与你最初训练的<em>任何</em>类型的模型的输出一起运行。",Il,At,kl,Dt,Ys='<a href="https://github.com/cleanlab/cleanlab" rel="nofollow">Cleanlab</a> 是一个标准的以数据为中心的人工智能包，旨在解决混乱的现实世界数据的质量问题。',Vl,Kt,zs='请考虑给 Cleanlab Github 仓库一个星标，如果你有兴趣，也可以参与到这个<a href="https://github.com/cleanlab/cleanlab/issues?q=is:issue+is:open+label:%22good+first+issue%22" rel="nofollow">项目</a>中来，比如帮助解决一些简单的问题。。',Hl,Ot,Xl,ee,Rl;return y=new Ks({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 h({props:{title:"使用 Cleanlab 检测文本数据集中的问题",local:"使用-cleanlab-检测文本数据集中的问题",headingTag:"h1"}}),x=new h({props:{title:"快速入门",local:"快速入门",headingTag:"h2"}}),C=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}}),U=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}}),W=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}}),F=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}}),B=new h({props:{title:"加载和格式化文本数据集",local:"加载和格式化文本数据集",headingTag:"h2"}}),I=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}}),k=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:"dHJhbnNmb3JtZXIlMjAlM0QlMjBTZW50ZW5jZVRyYW5zZm9ybWVyKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZGlzY3JpbWluYXRvciUyMiklMEF0ZXh0X2VtYmVkZGluZ3MlMjAlM0QlMjB0cmFuc2Zvcm1lci5lbmNvZGUocmF3X3RleHRzKQ==",highlighted:`transformer = SentenceTransformer(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
text_embeddings = transformer.encode(raw_texts)`,wrap:!1}}),E=new h({props:{title:"定义一个分类模型并计算样本外的预测概率",local:"定义一个分类模型并计算样本外的预测概率",headingTag:"h2"}}),D=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}}),K=new h({props:{title:"使用 Cleanlab 查找数据集中的问题",local:"使用-cleanlab-查找数据集中的问题",headingTag:"h2"}}),et=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}}),st=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}}),nt=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}}),pt=new c({props:{code:"bGFiLnJlcG9ydCgp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>lab.report()',wrap:!1}}),rt=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}}),ct=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}}),yt=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}}),Jt=new h({props:{title:"离群值问题",local:"离群值问题",headingTag:"h3"}}),gt=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}}),Ut=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}}),Ft=new h({props:{title:"近重复问题",local:"近重复问题",headingTag:"h3"}}),It=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}}),Ht=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"}}),Et=new c({props:{code:"cF92YWx1ZSUyMCUzRCUyMGxhYi5nZXRfaW5mbyglMjJub25faWlkJTIyKSU1QiUyMnAtdmFsdWUlMjIlNUQlMEFwX3ZhbHVl",highlighted:`p_value = lab.get_info(<span class="hljs-string">&quot;non_iid&quot;</span>)[<span class="hljs-string">&quot;p-value&quot;</span>]
p_value`,wrap:!1}}),At=new h({props:{title:"Cleanlab 开源项目",local:"cleanlab-开源项目",headingTag:"h3"}}),Ot=new Os({props:{source:"https://github.com/huggingface/cookbook/blob/main/notebooks/zh-CN/issues_in_text_dataset.md"}}),{c(){M=i("meta"),le=a(),te=i("p"),se=a(),r(y.$$.fragment),ae=a(),r(T.$$.fragment),ne=a(),w=i("p"),w.innerHTML=zl,ie=a(),_=i("p"),_.innerHTML=Ll,pe=a(),J=i("p"),J.innerHTML=ql,de=a(),j=i("ul"),j.innerHTML=Ql,re=a(),r(x.$$.fragment),me=a(),g=i("p"),g.innerHTML=El,ue=a(),v=i("p"),v.innerHTML=Pl,be=a(),r(C.$$.fragment),fe=a(),r(U.$$.fragment),oe=a(),Z=i("p"),Z.innerHTML=Sl,ce=a(),r(G.$$.fragment),he=a(),r(W.$$.fragment),Me=a(),r(F.$$.fragment),$e=a(),r(B.$$.fragment),ye=a(),r(I.$$.fragment),Te=a(),r(k.$$.fragment),we=a(),V=i("pre"),V.textContent=Al,_e=a(),H=i("p"),H.textContent=Dl,Je=a(),r(X.$$.fragment),je=a(),R=i("pre"),R.textContent=Kl,xe=a(),N=i("p"),N.textContent=Ol,ge=a(),Y=i("ol"),Y.innerHTML=ts,ve=a(),$=i("div"),$.innerHTML=es,Ce=a(),z=i("p"),z.textContent=ls,Ue=a(),L=i("p"),L.innerHTML=ss,Ze=a(),r(q.$$.fragment),Ge=a(),Q=i("p"),Q.innerHTML=as,We=a(),r(E.$$.fragment),Fe=a(),P=i("p"),P.textContent=ns,Be=a(),S=i("p"),S.innerHTML=is,Ie=a(),A=i("p"),A.innerHTML=ps,ke=a(),r(D.$$.fragment),Ve=a(),r(K.$$.fragment),He=a(),O=i("p"),O.textContent=ds,Xe=a(),tt=i("p"),tt.innerHTML=rs,Re=a(),r(et.$$.fragment),Ne=a(),lt=i("p"),lt.innerHTML=ms,Ye=a(),r(st.$$.fragment),ze=a(),at=i("p"),at.textContent=us,Le=a(),r(nt.$$.fragment),qe=a(),it=i("p"),it.innerHTML=bs,Qe=a(),r(pt.$$.fragment),Ee=a(),dt=i("pre"),dt.textContent=fs,Pe=a(),r(rt.$$.fragment),Se=a(),mt=i("p"),mt.innerHTML=os,Ae=a(),r(ut.$$.fragment),De=a(),bt=i("table"),bt.innerHTML=cs,Ke=a(),ft=i("p"),ft.textContent=hs,Oe=a(),ot=i("p"),ot.textContent=Ms,tl=a(),r(ct.$$.fragment),el=a(),ht=i("pre"),ht.textContent=$s,ll=a(),Mt=i("p"),Mt.textContent=ys,sl=a(),$t=i("p"),$t.textContent=Ts,al=a(),r(yt.$$.fragment),nl=a(),Tt=i("p"),Tt.textContent=ws,il=a(),wt=i("table"),wt.innerHTML=_s,pl=a(),_t=i("p"),_t.innerHTML=Js,dl=a(),r(Jt.$$.fragment),rl=a(),jt=i("p"),jt.textContent=js,ml=a(),xt=i("p"),xt.innerHTML=xs,ul=a(),r(gt.$$.fragment),bl=a(),vt=i("p"),vt.textContent=gs,fl=a(),Ct=i("table"),Ct.innerHTML=vs,ol=a(),r(Ut.$$.fragment),cl=a(),Zt=i("p"),Zt.textContent=Cs,hl=a(),Gt=i("table"),Gt.innerHTML=Us,Ml=a(),Wt=i("p"),Wt.textContent=Zs,$l=a(),r(Ft.$$.fragment),yl=a(),Bt=i("p"),Bt.innerHTML=Gs,Tl=a(),r(It.$$.fragment),wl=a(),kt=i("p"),kt.innerHTML=Ws,_l=a(),Vt=i("p"),Vt.textContent=Fs,Jl=a(),r(Ht.$$.fragment),jl=a(),Xt=i("p"),Xt.textContent=Bs,xl=a(),Rt=i("table"),Rt.innerHTML=Is,gl=a(),r(Nt.$$.fragment),vl=a(),Yt=i("p"),Yt.textContent=ks,Cl=a(),zt=i("table"),zt.innerHTML=Vs,Ul=a(),Lt=i("p"),Lt.innerHTML=Hs,Zl=a(),r(qt.$$.fragment),Gl=a(),Qt=i("p"),Qt.innerHTML=Xs,Wl=a(),r(Et.$$.fragment),Fl=a(),Pt=i("p"),Pt.textContent=Rs,Bl=a(),St=i("p"),St.innerHTML=Ns,Il=a(),r(At.$$.fragment),kl=a(),Dt=i("p"),Dt.innerHTML=Ys,Vl=a(),Kt=i("p"),Kt.innerHTML=zs,Hl=a(),r(Ot.$$.fragment),Xl=a(),ee=i("p"),this.h()},l(t){const e=As("svelte-u9bgzb",document.head);M=p(e,"META",{name:!0,content:!0}),e.forEach(l),le=n(t),te=p(t,"P",{}),Ls(te).forEach(l),se=n(t),m(y.$$.fragment,t),ae=n(t),m(T.$$.fragment,t),ne=n(t),w=p(t,"P",{"data-svelte-h":!0}),d(w)!=="svelte-1cqt7cs"&&(w.innerHTML=zl),ie=n(t),_=p(t,"P",{"data-svelte-h":!0}),d(_)!=="svelte-q54i4l"&&(_.innerHTML=Ll),pe=n(t),J=p(t,"P",{"data-svelte-h":!0}),d(J)!=="svelte-sya77"&&(J.innerHTML=ql),de=n(t),j=p(t,"UL",{"data-svelte-h":!0}),d(j)!=="svelte-1fq4kjo"&&(j.innerHTML=Ql),re=n(t),m(x.$$.fragment,t),me=n(t),g=p(t,"P",{"data-svelte-h":!0}),d(g)!=="svelte-1g9kg3k"&&(g.innerHTML=El),ue=n(t),v=p(t,"P",{"data-svelte-h":!0}),d(v)!=="svelte-xpkf6n"&&(v.innerHTML=Pl),be=n(t),m(C.$$.fragment,t),fe=n(t),m(U.$$.fragment,t),oe=n(t),Z=p(t,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-1puhpjh"&&(Z.innerHTML=Sl),ce=n(t),m(G.$$.fragment,t),he=n(t),m(W.$$.fragment,t),Me=n(t),m(F.$$.fragment,t),$e=n(t),m(B.$$.fragment,t),ye=n(t),m(I.$$.fragment,t),Te=n(t),m(k.$$.fragment,t),we=n(t),V=p(t,"PRE",{"data-svelte-h":!0}),d(V)!=="svelte-1baoe44"&&(V.textContent=Al),_e=n(t),H=p(t,"P",{"data-svelte-h":!0}),d(H)!=="svelte-1or2o6l"&&(H.textContent=Dl),Je=n(t),m(X.$$.fragment,t),je=n(t),R=p(t,"PRE",{"data-svelte-h":!0}),d(R)!=="svelte-17yipnq"&&(R.textContent=Kl),xe=n(t),N=p(t,"P",{"data-svelte-h":!0}),d(N)!=="svelte-1jrvbcd"&&(N.textContent=Ol),ge=n(t),Y=p(t,"OL",{"data-svelte-h":!0}),d(Y)!=="svelte-2fb4k8"&&(Y.innerHTML=ts),ve=n(t),$=p(t,"DIV",{class:!0,"data-svelte-h":!0}),d($)!=="svelte-1l1cd4w"&&($.innerHTML=es),Ce=n(t),z=p(t,"P",{"data-svelte-h":!0}),d(z)!=="svelte-v3vdg8"&&(z.textContent=ls),Ue=n(t),L=p(t,"P",{"data-svelte-h":!0}),d(L)!=="svelte-z7vswy"&&(L.innerHTML=ss),Ze=n(t),m(q.$$.fragment,t),Ge=n(t),Q=p(t,"P",{"data-svelte-h":!0}),d(Q)!=="svelte-vgzg2b"&&(Q.innerHTML=as),We=n(t),m(E.$$.fragment,t),Fe=n(t),P=p(t,"P",{"data-svelte-h":!0}),d(P)!=="svelte-etxtq8"&&(P.textContent=ns),Be=n(t),S=p(t,"P",{"data-svelte-h":!0}),d(S)!=="svelte-1u7nn5a"&&(S.innerHTML=is),Ie=n(t),A=p(t,"P",{"data-svelte-h":!0}),d(A)!=="svelte-140lqqw"&&(A.innerHTML=ps),ke=n(t),m(D.$$.fragment,t),Ve=n(t),m(K.$$.fragment,t),He=n(t),O=p(t,"P",{"data-svelte-h":!0}),d(O)!=="svelte-1f85ppw"&&(O.textContent=ds),Xe=n(t),tt=p(t,"P",{"data-svelte-h":!0}),d(tt)!=="svelte-1agumzq"&&(tt.innerHTML=rs),Re=n(t),m(et.$$.fragment,t),Ne=n(t),lt=p(t,"P",{"data-svelte-h":!0}),d(lt)!=="svelte-1fnlj30"&&(lt.innerHTML=ms),Ye=n(t),m(st.$$.fragment,t),ze=n(t),at=p(t,"P",{"data-svelte-h":!0}),d(at)!=="svelte-1qztnx7"&&(at.textContent=us),Le=n(t),m(nt.$$.fragment,t),qe=n(t),it=p(t,"P",{"data-svelte-h":!0}),d(it)!=="svelte-91zih2"&&(it.innerHTML=bs),Qe=n(t),m(pt.$$.fragment,t),Ee=n(t),dt=p(t,"PRE",{"data-svelte-h":!0}),d(dt)!=="svelte-1uushu"&&(dt.textContent=fs),Pe=n(t),m(rt.$$.fragment,t),Se=n(t),mt=p(t,"P",{"data-svelte-h":!0}),d(mt)!=="svelte-c99j95"&&(mt.innerHTML=os),Ae=n(t),m(ut.$$.fragment,t),De=n(t),bt=p(t,"TABLE",{"data-svelte-h":!0}),d(bt)!=="svelte-1xd6s59"&&(bt.innerHTML=cs),Ke=n(t),ft=p(t,"P",{"data-svelte-h":!0}),d(ft)!=="svelte-11ozylm"&&(ft.textContent=hs),Oe=n(t),ot=p(t,"P",{"data-svelte-h":!0}),d(ot)!=="svelte-1xrihou"&&(ot.textContent=Ms),tl=n(t),m(ct.$$.fragment,t),el=n(t),ht=p(t,"PRE",{"data-svelte-h":!0}),d(ht)!=="svelte-ku705s"&&(ht.textContent=$s),ll=n(t),Mt=p(t,"P",{"data-svelte-h":!0}),d(Mt)!=="svelte-10bwoeg"&&(Mt.textContent=ys),sl=n(t),$t=p(t,"P",{"data-svelte-h":!0}),d($t)!=="svelte-17n43qd"&&($t.textContent=Ts),al=n(t),m(yt.$$.fragment,t),nl=n(t),Tt=p(t,"P",{"data-svelte-h":!0}),d(Tt)!=="svelte-30eiy9"&&(Tt.textContent=ws),il=n(t),wt=p(t,"TABLE",{"data-svelte-h":!0}),d(wt)!=="svelte-15w938v"&&(wt.innerHTML=_s),pl=n(t),_t=p(t,"P",{"data-svelte-h":!0}),d(_t)!=="svelte-1qr4up6"&&(_t.innerHTML=Js),dl=n(t),m(Jt.$$.fragment,t),rl=n(t),jt=p(t,"P",{"data-svelte-h":!0}),d(jt)!=="svelte-1iv0468"&&(jt.textContent=js),ml=n(t),xt=p(t,"P",{"data-svelte-h":!0}),d(xt)!=="svelte-1e82i7b"&&(xt.innerHTML=xs),ul=n(t),m(gt.$$.fragment,t),bl=n(t),vt=p(t,"P",{"data-svelte-h":!0}),d(vt)!=="svelte-ikolsi"&&(vt.textContent=gs),fl=n(t),Ct=p(t,"TABLE",{"data-svelte-h":!0}),d(Ct)!=="svelte-1u55nqa"&&(Ct.innerHTML=vs),ol=n(t),m(Ut.$$.fragment,t),cl=n(t),Zt=p(t,"P",{"data-svelte-h":!0}),d(Zt)!=="svelte-zhf6bu"&&(Zt.textContent=Cs),hl=n(t),Gt=p(t,"TABLE",{"data-svelte-h":!0}),d(Gt)!=="svelte-1n860xg"&&(Gt.innerHTML=Us),Ml=n(t),Wt=p(t,"P",{"data-svelte-h":!0}),d(Wt)!=="svelte-85tsbj"&&(Wt.textContent=Zs),$l=n(t),m(Ft.$$.fragment,t),yl=n(t),Bt=p(t,"P",{"data-svelte-h":!0}),d(Bt)!=="svelte-r9woaz"&&(Bt.innerHTML=Gs),Tl=n(t),m(It.$$.fragment,t),wl=n(t),kt=p(t,"P",{"data-svelte-h":!0}),d(kt)!=="svelte-y0hvck"&&(kt.innerHTML=Ws),_l=n(t),Vt=p(t,"P",{"data-svelte-h":!0}),d(Vt)!=="svelte-ojzyjd"&&(Vt.textContent=Fs),Jl=n(t),m(Ht.$$.fragment,t),jl=n(t),Xt=p(t,"P",{"data-svelte-h":!0}),d(Xt)!=="svelte-so706c"&&(Xt.textContent=Bs),xl=n(t),Rt=p(t,"TABLE",{"data-svelte-h":!0}),d(Rt)!=="svelte-1hzopql"&&(Rt.innerHTML=Is),gl=n(t),m(Nt.$$.fragment,t),vl=n(t),Yt=p(t,"P",{"data-svelte-h":!0}),d(Yt)!=="svelte-so706c"&&(Yt.textContent=ks),Cl=n(t),zt=p(t,"TABLE",{"data-svelte-h":!0}),d(zt)!=="svelte-6cycax"&&(zt.innerHTML=Vs),Ul=n(t),Lt=p(t,"P",{"data-svelte-h":!0}),d(Lt)!=="svelte-jajwya"&&(Lt.innerHTML=Hs),Zl=n(t),m(qt.$$.fragment,t),Gl=n(t),Qt=p(t,"P",{"data-svelte-h":!0}),d(Qt)!=="svelte-1qpqvfm"&&(Qt.innerHTML=Xs),Wl=n(t),m(Et.$$.fragment,t),Fl=n(t),Pt=p(t,"P",{"data-svelte-h":!0}),d(Pt)!=="svelte-1oiyg2i"&&(Pt.textContent=Rs),Bl=n(t),St=p(t,"P",{"data-svelte-h":!0}),d(St)!=="svelte-1yrcnad"&&(St.innerHTML=Ns),Il=n(t),m(At.$$.fragment,t),kl=n(t),Dt=p(t,"P",{"data-svelte-h":!0}),d(Dt)!=="svelte-1t798br"&&(Dt.innerHTML=Ys),Vl=n(t),Kt=p(t,"P",{"data-svelte-h":!0}),d(Kt)!=="svelte-12rvpvg"&&(Kt.innerHTML=zs),Hl=n(t),m(Ot.$$.fragment,t),Xl=n(t),ee=p(t,"P",{}),Ls(ee).forEach(l),this.h()},h(){Nl(M,"name","hf:doc:metadata"),Nl(M,"content",ea),Nl($,"class","alert alert-info")},m(t,e){Ds(document.head,M),s(t,le,e),s(t,te,e),s(t,se,e),u(y,t,e),s(t,ae,e),u(T,t,e),s(t,ne,e),s(t,w,e),s(t,ie,e),s(t,_,e),s(t,pe,e),s(t,J,e),s(t,de,e),s(t,j,e),s(t,re,e),u(x,t,e),s(t,me,e),s(t,g,e),s(t,ue,e),s(t,v,e),s(t,be,e),u(C,t,e),s(t,fe,e),u(U,t,e),s(t,oe,e),s(t,Z,e),s(t,ce,e),u(G,t,e),s(t,he,e),u(W,t,e),s(t,Me,e),u(F,t,e),s(t,$e,e),u(B,t,e),s(t,ye,e),u(I,t,e),s(t,Te,e),u(k,t,e),s(t,we,e),s(t,V,e),s(t,_e,e),s(t,H,e),s(t,Je,e),u(X,t,e),s(t,je,e),s(t,R,e),s(t,xe,e),s(t,N,e),s(t,ge,e),s(t,Y,e),s(t,ve,e),s(t,$,e),s(t,Ce,e),s(t,z,e),s(t,Ue,e),s(t,L,e),s(t,Ze,e),u(q,t,e),s(t,Ge,e),s(t,Q,e),s(t,We,e),u(E,t,e),s(t,Fe,e),s(t,P,e),s(t,Be,e),s(t,S,e),s(t,Ie,e),s(t,A,e),s(t,ke,e),u(D,t,e),s(t,Ve,e),u(K,t,e),s(t,He,e),s(t,O,e),s(t,Xe,e),s(t,tt,e),s(t,Re,e),u(et,t,e),s(t,Ne,e),s(t,lt,e),s(t,Ye,e),u(st,t,e),s(t,ze,e),s(t,at,e),s(t,Le,e),u(nt,t,e),s(t,qe,e),s(t,it,e),s(t,Qe,e),u(pt,t,e),s(t,Ee,e),s(t,dt,e),s(t,Pe,e),u(rt,t,e),s(t,Se,e),s(t,mt,e),s(t,Ae,e),u(ut,t,e),s(t,De,e),s(t,bt,e),s(t,Ke,e),s(t,ft,e),s(t,Oe,e),s(t,ot,e),s(t,tl,e),u(ct,t,e),s(t,el,e),s(t,ht,e),s(t,ll,e),s(t,Mt,e),s(t,sl,e),s(t,$t,e),s(t,al,e),u(yt,t,e),s(t,nl,e),s(t,Tt,e),s(t,il,e),s(t,wt,e),s(t,pl,e),s(t,_t,e),s(t,dl,e),u(Jt,t,e),s(t,rl,e),s(t,jt,e),s(t,ml,e),s(t,xt,e),s(t,ul,e),u(gt,t,e),s(t,bl,e),s(t,vt,e),s(t,fl,e),s(t,Ct,e),s(t,ol,e),u(Ut,t,e),s(t,cl,e),s(t,Zt,e),s(t,hl,e),s(t,Gt,e),s(t,Ml,e),s(t,Wt,e),s(t,$l,e),u(Ft,t,e),s(t,yl,e),s(t,Bt,e),s(t,Tl,e),u(It,t,e),s(t,wl,e),s(t,kt,e),s(t,_l,e),s(t,Vt,e),s(t,Jl,e),u(Ht,t,e),s(t,jl,e),s(t,Xt,e),s(t,xl,e),s(t,Rt,e),s(t,gl,e),u(Nt,t,e),s(t,vl,e),s(t,Yt,e),s(t,Cl,e),s(t,zt,e),s(t,Ul,e),s(t,Lt,e),s(t,Zl,e),u(qt,t,e),s(t,Gl,e),s(t,Qt,e),s(t,Wl,e),u(Et,t,e),s(t,Fl,e),s(t,Pt,e),s(t,Bl,e),s(t,St,e),s(t,Il,e),u(At,t,e),s(t,kl,e),s(t,Dt,e),s(t,Vl,e),s(t,Kt,e),s(t,Hl,e),u(Ot,t,e),s(t,Xl,e),s(t,ee,e),Rl=!0},p:Qs,i(t){Rl||(b(y.$$.fragment,t),b(T.$$.fragment,t),b(x.$$.fragment,t),b(C.$$.fragment,t),b(U.$$.fragment,t),b(G.$$.fragment,t),b(W.$$.fragment,t),b(F.$$.fragment,t),b(B.$$.fragment,t),b(I.$$.fragment,t),b(k.$$.fragment,t),b(X.$$.fragment,t),b(q.$$.fragment,t),b(E.$$.fragment,t),b(D.$$.fragment,t),b(K.$$.fragment,t),b(et.$$.fragment,t),b(st.$$.fragment,t),b(nt.$$.fragment,t),b(pt.$$.fragment,t),b(rt.$$.fragment,t),b(ut.$$.fragment,t),b(ct.$$.fragment,t),b(yt.$$.fragment,t),b(Jt.$$.fragment,t),b(gt.$$.fragment,t),b(Ut.$$.fragment,t),b(Ft.$$.fragment,t),b(It.$$.fragment,t),b(Ht.$$.fragment,t),b(Nt.$$.fragment,t),b(qt.$$.fragment,t),b(Et.$$.fragment,t),b(At.$$.fragment,t),b(Ot.$$.fragment,t),Rl=!0)},o(t){f(y.$$.fragment,t),f(T.$$.fragment,t),f(x.$$.fragment,t),f(C.$$.fragment,t),f(U.$$.fragment,t),f(G.$$.fragment,t),f(W.$$.fragment,t),f(F.$$.fragment,t),f(B.$$.fragment,t),f(I.$$.fragment,t),f(k.$$.fragment,t),f(X.$$.fragment,t),f(q.$$.fragment,t),f(E.$$.fragment,t),f(D.$$.fragment,t),f(K.$$.fragment,t),f(et.$$.fragment,t),f(st.$$.fragment,t),f(nt.$$.fragment,t),f(pt.$$.fragment,t),f(rt.$$.fragment,t),f(ut.$$.fragment,t),f(ct.$$.fragment,t),f(yt.$$.fragment,t),f(Jt.$$.fragment,t),f(gt.$$.fragment,t),f(Ut.$$.fragment,t),f(Ft.$$.fragment,t),f(It.$$.fragment,t),f(Ht.$$.fragment,t),f(Nt.$$.fragment,t),f(qt.$$.fragment,t),f(Et.$$.fragment,t),f(At.$$.fragment,t),f(Ot.$$.fragment,t),Rl=!1},d(t){t&&(l(le),l(te),l(se),l(ae),l(ne),l(w),l(ie),l(_),l(pe),l(J),l(de),l(j),l(re),l(me),l(g),l(ue),l(v),l(be),l(fe),l(oe),l(Z),l(ce),l(he),l(Me),l($e),l(ye),l(Te),l(we),l(V),l(_e),l(H),l(Je),l(je),l(R),l(xe),l(N),l(ge),l(Y),l(ve),l($),l(Ce),l(z),l(Ue),l(L),l(Ze),l(Ge),l(Q),l(We),l(Fe),l(P),l(Be),l(S),l(Ie),l(A),l(ke),l(Ve),l(He),l(O),l(Xe),l(tt),l(Re),l(Ne),l(lt),l(Ye),l(ze),l(at),l(Le),l(qe),l(it),l(Qe),l(Ee),l(dt),l(Pe),l(Se),l(mt),l(Ae),l(De),l(bt),l(Ke),l(ft),l(Oe),l(ot),l(tl),l(el),l(ht),l(ll),l(Mt),l(sl),l($t),l(al),l(nl),l(Tt),l(il),l(wt),l(pl),l(_t),l(dl),l(rl),l(jt),l(ml),l(xt),l(ul),l(bl),l(vt),l(fl),l(Ct),l(ol),l(cl),l(Zt),l(hl),l(Gt),l(Ml),l(Wt),l($l),l(yl),l(Bt),l(Tl),l(wl),l(kt),l(_l),l(Vt),l(Jl),l(jl),l(Xt),l(xl),l(Rt),l(gl),l(vl),l(Yt),l(Cl),l(zt),l(Ul),l(Lt),l(Zl),l(Gl),l(Qt),l(Wl),l(Fl),l(Pt),l(Bl),l(St),l(Il),l(kl),l(Dt),l(Vl),l(Kt),l(Hl),l(Xl),l(ee)),l(M),o(y,t),o(T,t),o(x,t),o(C,t),o(U,t),o(G,t),o(W,t),o(F,t),o(B,t),o(I,t),o(k,t),o(X,t),o(q,t),o(E,t),o(D,t),o(K,t),o(et,t),o(st,t),o(nt,t),o(pt,t),o(rt,t),o(ut,t),o(ct,t),o(yt,t),o(Jt,t),o(gt,t),o(Ut,t),o(Ft,t),o(It,t),o(Ht,t),o(Nt,t),o(qt,t),o(Et,t),o(At,t),o(Ot,t)}}}const ea='{"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 la(Yl){return Es(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pa extends Ps{constructor(M){super(),Ss(this,M,la,ta,qs,{})}}export{pa as component};
