import{S as A2,i as M2,s as D2,e as r,k as c,w as d,t as a,M as L2,c as p,d as t,m as f,x as _,a as o,h as e,b as y,N as X2,G as n,g as i,y as b,o as h,p as Rl,q as x,B as $,v as V2,n as Ol}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ii}from"../../chunks/Tip-hf-doc-builder.js";import{Y as Tl}from"../../chunks/Youtube-hf-doc-builder.js";import{C as E}from"../../chunks/CodeBlock-hf-doc-builder.js";import{C as H2}from"../../chunks/CourseFloatingBanner-hf-doc-builder.js";import{F as Y2}from"../../chunks/FrameworkSwitchCourse-hf-doc-builder.js";import"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function Q2(O){let u,j;return u=new H2({props:{chapter:6,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/zh-CN/chapter6/section3_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/zh-CN/chapter6/section3_tf.ipynb"}]}}),{c(){d(u.$$.fragment)},l(g){_(u.$$.fragment,g)},m(g,k){b(u,g,k),j=!0},i(g){j||(x(u.$$.fragment,g),j=!0)},o(g){h(u.$$.fragment,g),j=!1},d(g){$(u,g)}}}function U2(O){let u,j;return u=new H2({props:{chapter:6,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/zh-CN/chapter6/section3_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/zh-CN/chapter6/section3_pt.ipynb"}]}}),{c(){d(u.$$.fragment)},l(g){_(u.$$.fragment,g)},m(g,k){b(u,g,k),j=!0},i(g){j||(x(u.$$.fragment,g),j=!0)},o(g){h(u.$$.fragment,g),j=!1},d(g){$(u,g)}}}function J2(O){let u,j;return{c(){u=r("p"),j=a("\u26A0\uFE0F \u5BF9\u5355\u4E2A\u53E5\u5B50\u8FDB\u884C\u5206\u8BCD\u65F6\uFF0C\u60A8\u4E0D\u4F1A\u603B\u662F\u770B\u5230\u76F8\u540C\u5206\u8BCD\u5668\u7684\u6162\u901F\u548C\u5FEB\u901F\u7248\u672C\u4E4B\u95F4\u7684\u901F\u5EA6\u5DEE\u5F02\u3002\u4E8B\u5B9E\u4E0A\uFF0C\u5FEB\u901F\u7248\u672C\u5B9E\u9645\u4E0A\u53EF\u80FD\u66F4\u6162\uFF01\u53EA\u6709\u540C\u65F6\u5BF9\u5927\u91CF\u6587\u672C\u8FDB\u884C\u6807\u8BB0\u65F6\uFF0C\u60A8\u624D\u80FD\u6E05\u695A\u5730\u770B\u5230\u5DEE\u5F02\u3002")},l(g){u=p(g,"P",{});var k=o(u);j=e(k,"\u26A0\uFE0F \u5BF9\u5355\u4E2A\u53E5\u5B50\u8FDB\u884C\u5206\u8BCD\u65F6\uFF0C\u60A8\u4E0D\u4F1A\u603B\u662F\u770B\u5230\u76F8\u540C\u5206\u8BCD\u5668\u7684\u6162\u901F\u548C\u5FEB\u901F\u7248\u672C\u4E4B\u95F4\u7684\u901F\u5EA6\u5DEE\u5F02\u3002\u4E8B\u5B9E\u4E0A\uFF0C\u5FEB\u901F\u7248\u672C\u5B9E\u9645\u4E0A\u53EF\u80FD\u66F4\u6162\uFF01\u53EA\u6709\u540C\u65F6\u5BF9\u5927\u91CF\u6587\u672C\u8FDB\u884C\u6807\u8BB0\u65F6\uFF0C\u60A8\u624D\u80FD\u6E05\u695A\u5730\u770B\u5230\u5DEE\u5F02\u3002"),k.forEach(t)},m(g,k){i(g,u,k),n(u,j)},d(g){g&&t(u)}}}function K2(O){let u,j,g,k,q;return{c(){u=r("p"),j=a("\u4E00\u4E2A\u8BCD\u662F\u4EC0\u4E48\u7684\u6982\u5FF5\u5F88\u590D\u6742\u3002\u4F8B\u5982\uFF0C\u201CI\u2019ll\u201D\uFF08\u201CI will\u201D\u7684\u7F29\u5199\uFF09\u7B97\u4E00\u4E24\u4E2A\u8BCD\u5417\uFF1F\u5B83\u5B9E\u9645\u4E0A\u53D6\u51B3\u4E8E\u5206\u8BCD\u5668\u548C\u5B83\u5E94\u7528\u7684\u9884\u5206\u8BCD\u64CD\u4F5C\u3002\u4E00\u4E9B\u6807\u8BB0\u5668\u53EA\u662F\u5728\u7A7A\u683C\u4E0A\u62C6\u5206\uFF0C\u56E0\u6B64\u4ED6\u4EEC\u4F1A\u5C06\u5176\u89C6\u4E3A\u4E00\u4E2A\u8BCD\u3002\u5176\u4ED6\u4EBA\u5728\u7A7A\u683C\u9876\u90E8\u4F7F\u7528\u6807\u70B9\u7B26\u53F7\uFF0C\u56E0\u6B64\u5C06\u5176\u89C6\u4E3A\u4E24\u4E2A\u8BCD\u3002"),g=c(),k=r("p"),q=a("\u270F\uFE0F \u8BD5\u8BD5\u770B\uFF01\u4ECEbert base cased\u548Croberta base\u68C0\u67E5\u70B9\u521B\u5EFA\u4E00\u4E2A\u6807\u8BB0\u5668\uFF0C\u5E76\u7528\u5B83\u4EEC\u6807\u8BB0\u201C81s\u201D\u3002\u4F60\u89C2\u5BDF\u5230\u4E86\u4EC0\u4E48\uFF1FID\u8FD9\u4E2A\u8BCD\u662F\u4EC0\u4E48\uFF1F")},l(R){u=p(R,"P",{});var B=o(u);j=e(B,"\u4E00\u4E2A\u8BCD\u662F\u4EC0\u4E48\u7684\u6982\u5FF5\u5F88\u590D\u6742\u3002\u4F8B\u5982\uFF0C\u201CI\u2019ll\u201D\uFF08\u201CI will\u201D\u7684\u7F29\u5199\uFF09\u7B97\u4E00\u4E24\u4E2A\u8BCD\u5417\uFF1F\u5B83\u5B9E\u9645\u4E0A\u53D6\u51B3\u4E8E\u5206\u8BCD\u5668\u548C\u5B83\u5E94\u7528\u7684\u9884\u5206\u8BCD\u64CD\u4F5C\u3002\u4E00\u4E9B\u6807\u8BB0\u5668\u53EA\u662F\u5728\u7A7A\u683C\u4E0A\u62C6\u5206\uFF0C\u56E0\u6B64\u4ED6\u4EEC\u4F1A\u5C06\u5176\u89C6\u4E3A\u4E00\u4E2A\u8BCD\u3002\u5176\u4ED6\u4EBA\u5728\u7A7A\u683C\u9876\u90E8\u4F7F\u7528\u6807\u70B9\u7B26\u53F7\uFF0C\u56E0\u6B64\u5C06\u5176\u89C6\u4E3A\u4E24\u4E2A\u8BCD\u3002"),B.forEach(t),g=f(R),k=p(R,"P",{});var I=o(k);q=e(I,"\u270F\uFE0F \u8BD5\u8BD5\u770B\uFF01\u4ECEbert base cased\u548Croberta base\u68C0\u67E5\u70B9\u521B\u5EFA\u4E00\u4E2A\u6807\u8BB0\u5668\uFF0C\u5E76\u7528\u5B83\u4EEC\u6807\u8BB0\u201C81s\u201D\u3002\u4F60\u89C2\u5BDF\u5230\u4E86\u4EC0\u4E48\uFF1FID\u8FD9\u4E2A\u8BCD\u662F\u4EC0\u4E48\uFF1F"),I.forEach(t)},m(R,B){i(R,u,B),n(u,j),i(R,g,B),i(R,k,B),n(k,q)},d(R){R&&t(u),R&&t(g),R&&t(k)}}}function W2(O){let u,j;return{c(){u=r("p"),j=a("\u270F\uFE0F \u8BD5\u8BD5\u770B\uFF01\u521B\u5EFA\u60A8\u81EA\u5DF1\u7684\u793A\u4F8B\u6587\u672C\uFF0C\u770B\u770B\u60A8\u662F\u5426\u80FD\u7406\u89E3\u54EA\u4E9B\u6807\u8BB0\u4E0E\u5355\u8BCD ID \u76F8\u5173\u8054\uFF0C\u4EE5\u53CA\u5982\u4F55\u63D0\u53D6\u5355\u4E2A\u5355\u8BCD\u7684\u5B57\u7B26\u8DE8\u5EA6\u3002\u5BF9\u4E8E\u5956\u52B1\u79EF\u5206\uFF0C\u8BF7\u5C1D\u8BD5\u4F7F\u7528\u4E24\u4E2A\u53E5\u5B50\u4F5C\u4E3A\u8F93\u5165\uFF0C\u770B\u770B\u53E5\u5B50 ID \u662F\u5426\u5BF9\u60A8\u6709\u610F\u4E49\u3002")},l(g){u=p(g,"P",{});var k=o(u);j=e(k,"\u270F\uFE0F \u8BD5\u8BD5\u770B\uFF01\u521B\u5EFA\u60A8\u81EA\u5DF1\u7684\u793A\u4F8B\u6587\u672C\uFF0C\u770B\u770B\u60A8\u662F\u5426\u80FD\u7406\u89E3\u54EA\u4E9B\u6807\u8BB0\u4E0E\u5355\u8BCD ID \u76F8\u5173\u8054\uFF0C\u4EE5\u53CA\u5982\u4F55\u63D0\u53D6\u5355\u4E2A\u5355\u8BCD\u7684\u5B57\u7B26\u8DE8\u5EA6\u3002\u5BF9\u4E8E\u5956\u52B1\u79EF\u5206\uFF0C\u8BF7\u5C1D\u8BD5\u4F7F\u7528\u4E24\u4E2A\u53E5\u5B50\u4F5C\u4E3A\u8F93\u5165\uFF0C\u770B\u770B\u53E5\u5B50 ID \u662F\u5426\u5BF9\u60A8\u6709\u610F\u4E49\u3002"),k.forEach(t)},m(g,k){i(g,u,k),n(u,j)},d(g){g&&t(u)}}}function Z2(O){let u,j;return u=new Tl({props:{id:"PrX4CjrVnNc"}}),{c(){d(u.$$.fragment)},l(g){_(u.$$.fragment,g)},m(g,k){b(u,g,k),j=!0},i(g){j||(x(u.$$.fragment,g),j=!0)},o(g){h(u.$$.fragment,g),j=!1},d(g){$(u,g)}}}function sf(O){let u,j;return u=new Tl({props:{id:"0E7ltQB7fM8"}}),{c(){d(u.$$.fragment)},l(g){_(u.$$.fragment,g)},m(g,k){b(u,g,k),j=!0},i(g){j||(x(u.$$.fragment,g),j=!0)},o(g){h(u.$$.fragment,g),j=!1},d(g){$(u,g)}}}function nf(O){let u,j,g,k,q,R,B,I,N,G,T,P,ns,V,cs,ts,as,F,Y,C,es;return G=new E({props:{code:`from transformers import AutoTokenizer, TFAutoModelForTokenClassification

model_checkpoint = "dbmdz/bert-large-cased-finetuned-conll03-english"
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
model = TFAutoModelForTokenClassification.from_pretrained(model_checkpoint)

example = "My name is Sylvain and I work at Hugging Face in Brooklyn."
inputs = tokenizer(example, return_tensors="tf")
outputs = model(**inputs)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFAutoModelForTokenClassification

model_checkpoint = <span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
model = TFAutoModelForTokenClassification.from_pretrained(model_checkpoint)

example = <span class="hljs-string">&quot;My name is Sylvain and I work at Hugging Face in Brooklyn.&quot;</span>
inputs = tokenizer(example, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
outputs = model(**inputs)`}}),F=new E({props:{code:`print(inputs["input_ids"].shape)
print(outputs.logits.shape)`,highlighted:`<span class="hljs-built_in">print</span>(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>].shape)
<span class="hljs-built_in">print</span>(outputs.logits.shape)`}}),C=new E({props:{code:`(1, 19)
(1, 19, 9)`,highlighted:`(<span class="hljs-number">1</span>, <span class="hljs-number">19</span>)
(<span class="hljs-number">1</span>, <span class="hljs-number">19</span>, <span class="hljs-number">9</span>)`}}),{c(){u=r("p"),j=a("\u9996\u5148\uFF0C\u6211\u4EEC\u9700\u8981\u6807\u8BB0\u6211\u4EEC\u7684\u8F93\u5165\u5E76\u5C06\u5176\u4F20\u9012\u7ED9\u6A21\u578B\u3002\u8FD9\u662F\u5B8C\u5168\u6309\u7167"),g=r("a"),k=a("Chapter 2"),q=a(";\u6211\u4EEC\u4F7F\u7528 "),R=r("strong"),B=a("AutoXxx"),I=a(" \u7C7B\uFF0C\u7136\u540E\u5728\u6211\u4EEC\u7684\u793A\u4F8B\u4E2D\u4F7F\u7528\u5B83\u4EEC\uFF1A"),N=c(),d(G.$$.fragment),T=c(),P=r("p"),ns=a("\u4E8E\u6211\u4EEC\u6B63\u5728\u4F7F\u7528 "),V=r("strong"),cs=a("AutoModelForTokenClassification"),ts=a(" \u5728\u8FD9\u91CC\uFF0C\u6211\u4EEC\u4E3A\u8F93\u5165\u5E8F\u5217\u4E2D\u7684\u6BCF\u4E2A\u6807\u8BB0\u83B7\u5F97\u4E00\u7EC4 logits\uFF1A"),as=c(),d(F.$$.fragment),Y=c(),d(C.$$.fragment),this.h()},l(m){u=p(m,"P",{});var v=o(u);j=e(v,"\u9996\u5148\uFF0C\u6211\u4EEC\u9700\u8981\u6807\u8BB0\u6211\u4EEC\u7684\u8F93\u5165\u5E76\u5C06\u5176\u4F20\u9012\u7ED9\u6A21\u578B\u3002\u8FD9\u662F\u5B8C\u5168\u6309\u7167"),g=p(v,"A",{href:!0});var ys=o(g);k=e(ys,"Chapter 2"),ys.forEach(t),q=e(v,";\u6211\u4EEC\u4F7F\u7528 "),R=p(v,"STRONG",{});var js=o(R);B=e(js,"AutoXxx"),js.forEach(t),I=e(v," \u7C7B\uFF0C\u7136\u540E\u5728\u6211\u4EEC\u7684\u793A\u4F8B\u4E2D\u4F7F\u7528\u5B83\u4EEC\uFF1A"),v.forEach(t),N=f(m),_(G.$$.fragment,m),T=f(m),P=p(m,"P",{});var A=o(P);ns=e(A,"\u4E8E\u6211\u4EEC\u6B63\u5728\u4F7F\u7528 "),V=p(A,"STRONG",{});var ds=o(V);cs=e(ds,"AutoModelForTokenClassification"),ds.forEach(t),ts=e(A," \u5728\u8FD9\u91CC\uFF0C\u6211\u4EEC\u4E3A\u8F93\u5165\u5E8F\u5217\u4E2D\u7684\u6BCF\u4E2A\u6807\u8BB0\u83B7\u5F97\u4E00\u7EC4 logits\uFF1A"),A.forEach(t),as=f(m),_(F.$$.fragment,m),Y=f(m),_(C.$$.fragment,m),this.h()},h(){y(g,"href","/course/chapter2")},m(m,v){i(m,u,v),n(u,j),n(u,g),n(g,k),n(u,q),n(u,R),n(R,B),n(u,I),i(m,N,v),b(G,m,v),i(m,T,v),i(m,P,v),n(P,ns),n(P,V),n(V,cs),n(P,ts),i(m,as,v),b(F,m,v),i(m,Y,v),b(C,m,v),es=!0},i(m){es||(x(G.$$.fragment,m),x(F.$$.fragment,m),x(C.$$.fragment,m),es=!0)},o(m){h(G.$$.fragment,m),h(F.$$.fragment,m),h(C.$$.fragment,m),es=!1},d(m){m&&t(u),m&&t(N),$(G,m),m&&t(T),m&&t(P),m&&t(as),$(F,m),m&&t(Y),$(C,m)}}}function tf(O){let u,j,g,k,q,R,B,I,N,G,T,P,ns,V,cs,ts,as,F,Y,C,es;return G=new E({props:{code:`from transformers import AutoTokenizer, AutoModelForTokenClassification

model_checkpoint = "dbmdz/bert-large-cased-finetuned-conll03-english"
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
model = AutoModelForTokenClassification.from_pretrained(model_checkpoint)

example = "My name is Sylvain and I work at Hugging Face in Brooklyn."
inputs = tokenizer(example, return_tensors="pt")
outputs = model(**inputs)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForTokenClassification

model_checkpoint = <span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
model = AutoModelForTokenClassification.from_pretrained(model_checkpoint)

example = <span class="hljs-string">&quot;My name is Sylvain and I work at Hugging Face in Brooklyn.&quot;</span>
inputs = tokenizer(example, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
outputs = model(**inputs)`}}),F=new E({props:{code:`print(inputs["input_ids"].shape)
print(outputs.logits.shape)`,highlighted:`<span class="hljs-built_in">print</span>(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>].shape)
<span class="hljs-built_in">print</span>(outputs.logits.shape)`}}),C=new E({props:{code:`torch.Size([1, 19])
torch.Size([1, 19, 9])`,highlighted:`torch.Size([<span class="hljs-number">1</span>, <span class="hljs-number">19</span>])
torch.Size([<span class="hljs-number">1</span>, <span class="hljs-number">19</span>, <span class="hljs-number">9</span>])`}}),{c(){u=r("p"),j=a("\u9996\u5148\uFF0C\u6211\u4EEC\u9700\u8981\u6807\u8BB0\u6211\u4EEC\u7684\u8F93\u5165\u5E76\u5C06\u5176\u4F20\u9012\u7ED9\u6A21\u578B\u3002\u8FD9\u662F\u5B8C\u5168\u6309\u7167"),g=r("a"),k=a("Chapter 2"),q=a(";\u6211\u4EEC\u4F7F\u7528 "),R=r("strong"),B=a("AutoXxx"),I=a(" \u7C7B\uFF0C\u7136\u540E\u5728\u6211\u4EEC\u7684\u793A\u4F8B\u4E2D\u4F7F\u7528\u5B83\u4EEC\uFF1A"),N=c(),d(G.$$.fragment),T=c(),P=r("p"),ns=a("\u7531\u4E8E\u6211\u4EEC\u6B63\u5728\u4F7F\u7528 "),V=r("strong"),cs=a("AutoModelForTokenClassification"),ts=a(" \u5728\u8FD9\u91CC\uFF0C\u6211\u4EEC\u4E3A\u8F93\u5165\u5E8F\u5217\u4E2D\u7684\u6BCF\u4E2A\u6807\u8BB0\u83B7\u5F97\u4E00\u7EC4 logits\uFF1A"),as=c(),d(F.$$.fragment),Y=c(),d(C.$$.fragment),this.h()},l(m){u=p(m,"P",{});var v=o(u);j=e(v,"\u9996\u5148\uFF0C\u6211\u4EEC\u9700\u8981\u6807\u8BB0\u6211\u4EEC\u7684\u8F93\u5165\u5E76\u5C06\u5176\u4F20\u9012\u7ED9\u6A21\u578B\u3002\u8FD9\u662F\u5B8C\u5168\u6309\u7167"),g=p(v,"A",{href:!0});var ys=o(g);k=e(ys,"Chapter 2"),ys.forEach(t),q=e(v,";\u6211\u4EEC\u4F7F\u7528 "),R=p(v,"STRONG",{});var js=o(R);B=e(js,"AutoXxx"),js.forEach(t),I=e(v," \u7C7B\uFF0C\u7136\u540E\u5728\u6211\u4EEC\u7684\u793A\u4F8B\u4E2D\u4F7F\u7528\u5B83\u4EEC\uFF1A"),v.forEach(t),N=f(m),_(G.$$.fragment,m),T=f(m),P=p(m,"P",{});var A=o(P);ns=e(A,"\u7531\u4E8E\u6211\u4EEC\u6B63\u5728\u4F7F\u7528 "),V=p(A,"STRONG",{});var ds=o(V);cs=e(ds,"AutoModelForTokenClassification"),ds.forEach(t),ts=e(A," \u5728\u8FD9\u91CC\uFF0C\u6211\u4EEC\u4E3A\u8F93\u5165\u5E8F\u5217\u4E2D\u7684\u6BCF\u4E2A\u6807\u8BB0\u83B7\u5F97\u4E00\u7EC4 logits\uFF1A"),A.forEach(t),as=f(m),_(F.$$.fragment,m),Y=f(m),_(C.$$.fragment,m),this.h()},h(){y(g,"href","/course/chapter2")},m(m,v){i(m,u,v),n(u,j),n(u,g),n(g,k),n(u,q),n(u,R),n(R,B),n(u,I),i(m,N,v),b(G,m,v),i(m,T,v),i(m,P,v),n(P,ns),n(P,V),n(V,cs),n(P,ts),i(m,as,v),b(F,m,v),i(m,Y,v),b(C,m,v),es=!0},i(m){es||(x(G.$$.fragment,m),x(F.$$.fragment,m),x(C.$$.fragment,m),es=!0)},o(m){h(G.$$.fragment,m),h(F.$$.fragment,m),h(C.$$.fragment,m),es=!1},d(m){m&&t(u),m&&t(N),$(G,m),m&&t(T),m&&t(P),m&&t(as),$(F,m),m&&t(Y),$(C,m)}}}function af(O){let u,j;return u=new E({props:{code:`import tensorflow as tf

probabilities = tf.math.softmax(outputs.logits, axis=-1)[0]
probabilities = probabilities.numpy().tolist()
predictions = tf.math.argmax(outputs.logits, axis=-1)[0]
predictions = predictions.numpy().tolist()
print(predictions)`,highlighted:`<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

probabilities = tf.math.softmax(outputs.logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]
probabilities = probabilities.numpy().tolist()
predictions = tf.math.argmax(outputs.logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]
predictions = predictions.numpy().tolist()
<span class="hljs-built_in">print</span>(predictions)`}}),{c(){d(u.$$.fragment)},l(g){_(u.$$.fragment,g)},m(g,k){b(u,g,k),j=!0},i(g){j||(x(u.$$.fragment,g),j=!0)},o(g){h(u.$$.fragment,g),j=!1},d(g){$(u,g)}}}function ef(O){let u,j;return u=new E({props:{code:`import torch

probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)[0].tolist()
predictions = outputs.logits.argmax(dim=-1)[0].tolist()
print(predictions)`,highlighted:`<span class="hljs-keyword">import</span> torch

probabilities = torch.nn.functional.softmax(outputs.logits, dim=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>].tolist()
predictions = outputs.logits.argmax(dim=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>].tolist()
<span class="hljs-built_in">print</span>(predictions)`}}),{c(){d(u.$$.fragment)},l(g){_(u.$$.fragment,g)},m(g,k){b(u,g,k),j=!0},i(g){j||(x(u.$$.fragment,g),j=!0)},o(g){h(u.$$.fragment,g),j=!1},d(g){$(u,g)}}}function lf(O){let u,j,g,k,q,R,B,I,N,G,T,P,ns,V,cs,ts,as,F,Y,C,es,m,v,ys,js,A,ds,Ss,Sl,Cn,Il,Gl,Ja,Is,dt,ws,zn,Nl,Pl,Xn,ql,Bl,_t,Fl,Ls,Rs,Hn,bt,Cl,zl,An,Xl,Hl,Mn,Al,Ml,Os,Dn,$t,Dl,Ll,Ln,Vl,Yl,Vn,Ql,Ka,Gs,Wa,Vs,Ul,Za,Ys,se,Ns,Jl,kt,Kl,Wl,ne,Yn,Zl,te,Qs,ae,Ps,sr,Et,nr,tr,ee,Us,le,Q,ar,vt,er,lr,yt,rr,pr,wt,or,ir,Rt,cr,fr,re,Js,pe,Ks,oe,qs,gr,Ot,ur,mr,ie,Ws,ce,Zs,fe,Qn,hr,ge,sn,ue,nn,me,_s,xr,Tt,jr,dr,St,_r,br,he,tn,xe,an,je,U,$r,It,kr,Er,Gt,vr,yr,Nt,wr,Rr,Pt,Or,Tr,de,Bs,_e,bs,Sr,qt,Ir,Gr,Bt,Nr,Pr,be,z,qr,Ft,Br,Fr,Ct,Cr,zr,zt,Xr,Hr,Xt,Ar,Mr,Ht,Dr,Lr,At,Vr,Yr,$e,en,ke,ln,Ee,Fs,Qr,Mt,Ur,Jr,ve,Cs,ye,rn,Kr,we,J,Wr,Un,Zr,sp,Dt,np,tp,Jn,ap,ep,Lt,lp,rp,Re,fs,gs,Kn,pn,pp,Oe,zs,op,on,ip,cp,Te,cn,Se,fn,Ie,Wn,fp,Ge,gn,Ne,un,Pe,M,Vt,gp,up,Yt,mp,hp,Qt,xp,jp,Ut,dp,_p,Jt,bp,$p,Kt,kp,Ep,qe,$s,Wt,Zn,Zt,vp,yp,wp,sa,st,na,Rp,Op,Tp,ta,nt,aa,Sp,Ip,Be,tt,Gp,Fe,mn,Np,Ce,us,ms,at,et,Pp,ze,hs,xs,lt,hn,Xe,xn,ea,qp,Bp,He,jn,Ae,dn,Me,w,Fp,la,Cp,zp,ra,Xp,Hp,pa,Ap,Mp,oa,Dp,Lp,ia,Vp,Yp,ca,Qp,Up,fa,Jp,Kp,ga,Wp,Zp,ua,so,no,ma,to,ao,ha,eo,lo,De,X,ro,xa,po,oo,ja,io,co,da,fo,go,_a,uo,mo,ba,ho,xo,$a,jo,_o,Le,Ts,_n,Gi,bo,bn,Ni,Ve,Xs,$o,ka,ko,Eo,Ye,$n,Qe,kn,Ue,rs,vo,Ea,yo,wo,va,Ro,Oo,ya,To,So,Je,En,Ke,vn,We,ps,Io,wa,Go,No,Ra,Po,qo,Oa,Bo,Fo,Ze,yn,sl,Hs,Co,Ta,zo,Xo,nl,wn,tl,rt,Ho,al,Rn,el,On,ll,pt,Ao,rl,Tn,Mo,pl,H,Do,Sa,Lo,Vo,Ia,Yo,Qo,Ga,Uo,Jo,Na,Ko,Wo,Pa,Zo,si,qa,ni,ti,ol,D,ai,Ba,ei,li,Fa,ri,pi,Ca,oi,ii,za,ci,fi,Xa,gi,ui,il,Sn,cl,In,fl,L,mi,Ha,hi,xi,Aa,ji,di,Ma,_i,bi,Da,$i,ki,La,Ei,vi,gl,Gn,ul,ot,yi,ml,Nn,hl,it,wi,xl;g=new Y2({props:{fw:O[0]}});const Pi=[U2,Q2],Pn=[];function qi(s,l){return s[0]==="pt"?0:1}I=qi(O),N=Pn[I]=Pi[I](O),A=new Tl({props:{id:"g8quOxoqhHQ"}}),Gs=new Ii({props:{warning:!0,$$slots:{default:[J2]},$$scope:{ctx:O}}}),Ys=new Tl({props:{id:"3umI3tm27Vw"}}),Qs=new E({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
example = "My name is Sylvain and I work at Hugging Face in Brooklyn."
encoding = tokenizer(example)
print(type(encoding))`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
example = <span class="hljs-string">&quot;My name is Sylvain and I work at Hugging Face in Brooklyn.&quot;</span>
encoding = tokenizer(example)
<span class="hljs-built_in">print</span>(<span class="hljs-built_in">type</span>(encoding))`}}),Us=new E({props:{code:"<class 'transformers.tokenization_utils_base.BatchEncoding'>",highlighted:'&lt;<span class="hljs-keyword">class</span> <span class="hljs-string">&#x27;transformers.tokenization_utils_base.BatchEncoding&#x27;</span>&gt;'}}),Js=new E({props:{code:"tokenizer.is_fast",highlighted:"tokenizer.is_fast"}}),Ks=new E({props:{code:"True",highlighted:'<span class="hljs-literal">True</span>'}}),Ws=new E({props:{code:"encoding.is_fast",highlighted:"encoding.is_fast"}}),Zs=new E({props:{code:"True",highlighted:'<span class="hljs-literal">True</span>'}}),sn=new E({props:{code:"encoding.tokens()",highlighted:"encoding.tokens()"}}),nn=new E({props:{code:`['[CLS]', 'My', 'name', 'is', 'S', '##yl', '##va', '##in', 'and', 'I', 'work', 'at', 'Hu', '##gging', 'Face', 'in',
 'Brooklyn', '.', '[SEP]']`,highlighted:`[<span class="hljs-string">&#x27;[CLS]&#x27;</span>, <span class="hljs-string">&#x27;My&#x27;</span>, <span class="hljs-string">&#x27;name&#x27;</span>, <span class="hljs-string">&#x27;is&#x27;</span>, <span class="hljs-string">&#x27;S&#x27;</span>, <span class="hljs-string">&#x27;##yl&#x27;</span>, <span class="hljs-string">&#x27;##va&#x27;</span>, <span class="hljs-string">&#x27;##in&#x27;</span>, <span class="hljs-string">&#x27;and&#x27;</span>, <span class="hljs-string">&#x27;I&#x27;</span>, <span class="hljs-string">&#x27;work&#x27;</span>, <span class="hljs-string">&#x27;at&#x27;</span>, <span class="hljs-string">&#x27;Hu&#x27;</span>, <span class="hljs-string">&#x27;##gging&#x27;</span>, <span class="hljs-string">&#x27;Face&#x27;</span>, <span class="hljs-string">&#x27;in&#x27;</span>,
 <span class="hljs-string">&#x27;Brooklyn&#x27;</span>, <span class="hljs-string">&#x27;.&#x27;</span>, <span class="hljs-string">&#x27;[SEP]&#x27;</span>]`}}),tn=new E({props:{code:"encoding.word_ids()",highlighted:"encoding.word_ids()"}}),an=new E({props:{code:"[None, 0, 1, 2, 3, 3, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, None]",highlighted:'[<span class="hljs-literal">None</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>, <span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>, <span class="hljs-literal">None</span>]'}}),Bs=new Ii({props:{$$slots:{default:[K2]},$$scope:{ctx:O}}}),en=new E({props:{code:`start, end = encoding.word_to_chars(3)
example[start:end]`,highlighted:`start, end = encoding.word_to_chars(<span class="hljs-number">3</span>)
example[start:end]`}}),ln=new E({props:{code:"Sylvain",highlighted:"Sylvain"}}),Cs=new Ii({props:{$$slots:{default:[W2]},$$scope:{ctx:O}}});const Bi=[sf,Z2],qn=[];function Fi(s,l){return s[0]==="pt"?0:1}fs=Fi(O),gs=qn[fs]=Bi[fs](O),cn=new E({props:{code:`from transformers import pipeline

token_classifier = pipeline("token-classification")
token_classifier("My name is Sylvain and I work at Hugging Face in Brooklyn.")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

token_classifier = pipeline(<span class="hljs-string">&quot;token-classification&quot;</span>)
token_classifier(<span class="hljs-string">&quot;My name is Sylvain and I work at Hugging Face in Brooklyn.&quot;</span>)`}}),fn=new E({props:{code:`[{'entity': 'I-PER', 'score': 0.9993828, 'index': 4, 'word': 'S', 'start': 11, 'end': 12},
 {'entity': 'I-PER', 'score': 0.99815476, 'index': 5, 'word': '##yl', 'start': 12, 'end': 14},
 {'entity': 'I-PER', 'score': 0.99590725, 'index': 6, 'word': '##va', 'start': 14, 'end': 16},
 {'entity': 'I-PER', 'score': 0.9992327, 'index': 7, 'word': '##in', 'start': 16, 'end': 18},
 {'entity': 'I-ORG', 'score': 0.97389334, 'index': 12, 'word': 'Hu', 'start': 33, 'end': 35},
 {'entity': 'I-ORG', 'score': 0.976115, 'index': 13, 'word': '##gging', 'start': 35, 'end': 40},
 {'entity': 'I-ORG', 'score': 0.98879766, 'index': 14, 'word': 'Face', 'start': 41, 'end': 45},
 {'entity': 'I-LOC', 'score': 0.99321055, 'index': 16, 'word': 'Brooklyn', 'start': 49, 'end': 57}]`,highlighted:`[{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9993828</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">4</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;S&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">11</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">12</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99815476</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">5</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##yl&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">12</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">14</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99590725</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">6</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##va&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">14</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">16</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9992327</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">7</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##in&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">18</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.97389334</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">12</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Hu&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">33</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">35</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.976115</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">13</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##gging&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">35</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">40</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.98879766</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">14</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Face&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">41</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">45</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99321055</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Brooklyn&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">49</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">57</span>}]`}}),gn=new E({props:{code:`from transformers import pipeline

token_classifier = pipeline("token-classification", aggregation_strategy="simple")
token_classifier("My name is Sylvain and I work at Hugging Face in Brooklyn.")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

token_classifier = pipeline(<span class="hljs-string">&quot;token-classification&quot;</span>, aggregation_strategy=<span class="hljs-string">&quot;simple&quot;</span>)
token_classifier(<span class="hljs-string">&quot;My name is Sylvain and I work at Hugging Face in Brooklyn.&quot;</span>)`}}),un=new E({props:{code:`[{'entity_group': 'PER', 'score': 0.9981694, 'word': 'Sylvain', 'start': 11, 'end': 18},
 {'entity_group': 'ORG', 'score': 0.97960204, 'word': 'Hugging Face', 'start': 33, 'end': 45},
 {'entity_group': 'LOC', 'score': 0.99321055, 'word': 'Brooklyn', 'start': 49, 'end': 57}]`,highlighted:`[{<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9981694</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Sylvain&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">11</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">18</span>},
 {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.97960204</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Hugging Face&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">33</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">45</span>},
 {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99321055</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Brooklyn&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">49</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">57</span>}]`}});const Ci=[tf,nf],Bn=[];function zi(s,l){return s[0]==="pt"?0:1}us=zi(O),ms=Bn[us]=Ci[us](O);const Xi=[ef,af],Fn=[];function Hi(s,l){return s[0]==="pt"?0:1}return hs=Hi(O),xs=Fn[hs]=Xi[hs](O),hn=new E({props:{code:"[0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 6, 6, 6, 0, 8, 0, 0]",highlighted:'[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">4</span>, <span class="hljs-number">4</span>, <span class="hljs-number">4</span>, <span class="hljs-number">4</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">6</span>, <span class="hljs-number">6</span>, <span class="hljs-number">6</span>, <span class="hljs-number">0</span>, <span class="hljs-number">8</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>]'}}),jn=new E({props:{code:"model.config.id2label",highlighted:"model.config.id2label"}}),dn=new E({props:{code:`{0: 'O',
 1: 'B-MISC',
 2: 'I-MISC',
 3: 'B-PER',
 4: 'I-PER',
 5: 'B-ORG',
 6: 'I-ORG',
 7: 'B-LOC',
 8: 'I-LOC'}`,highlighted:`{<span class="hljs-number">0</span>: <span class="hljs-string">&#x27;O&#x27;</span>,
 <span class="hljs-number">1</span>: <span class="hljs-string">&#x27;B-MISC&#x27;</span>,
 <span class="hljs-number">2</span>: <span class="hljs-string">&#x27;I-MISC&#x27;</span>,
 <span class="hljs-number">3</span>: <span class="hljs-string">&#x27;B-PER&#x27;</span>,
 <span class="hljs-number">4</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>,
 <span class="hljs-number">5</span>: <span class="hljs-string">&#x27;B-ORG&#x27;</span>,
 <span class="hljs-number">6</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>,
 <span class="hljs-number">7</span>: <span class="hljs-string">&#x27;B-LOC&#x27;</span>,
 <span class="hljs-number">8</span>: <span class="hljs-string">&#x27;I-LOC&#x27;</span>}`}}),$n=new E({props:{code:`results = []
tokens = inputs.tokens()

for idx, pred in enumerate(predictions):
    label = model.config.id2label[pred]
    if label != "O":
        results.append(
            {"entity": label, "score": probabilities[idx][pred], "word": tokens[idx]}
        )

print(results)`,highlighted:`results = []
tokens = inputs.tokens()

<span class="hljs-keyword">for</span> idx, pred <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(predictions):
    label = model.config.id2label[pred]
    <span class="hljs-keyword">if</span> label != <span class="hljs-string">&quot;O&quot;</span>:
        results.append(
            {<span class="hljs-string">&quot;entity&quot;</span>: label, <span class="hljs-string">&quot;score&quot;</span>: probabilities[idx][pred], <span class="hljs-string">&quot;word&quot;</span>: tokens[idx]}
        )

<span class="hljs-built_in">print</span>(results)`}}),kn=new E({props:{code:`[{'entity': 'I-PER', 'score': 0.9993828, 'index': 4, 'word': 'S'},
 {'entity': 'I-PER', 'score': 0.99815476, 'index': 5, 'word': '##yl'},
 {'entity': 'I-PER', 'score': 0.99590725, 'index': 6, 'word': '##va'},
 {'entity': 'I-PER', 'score': 0.9992327, 'index': 7, 'word': '##in'},
 {'entity': 'I-ORG', 'score': 0.97389334, 'index': 12, 'word': 'Hu'},
 {'entity': 'I-ORG', 'score': 0.976115, 'index': 13, 'word': '##gging'},
 {'entity': 'I-ORG', 'score': 0.98879766, 'index': 14, 'word': 'Face'},
 {'entity': 'I-LOC', 'score': 0.99321055, 'index': 16, 'word': 'Brooklyn'}]`,highlighted:`[{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9993828</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">4</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;S&#x27;</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99815476</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">5</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##yl&#x27;</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99590725</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">6</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##va&#x27;</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9992327</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">7</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##in&#x27;</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.97389334</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">12</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Hu&#x27;</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.976115</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">13</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##gging&#x27;</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.98879766</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">14</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Face&#x27;</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99321055</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Brooklyn&#x27;</span>}]`}}),En=new E({props:{code:`inputs_with_offsets = tokenizer(example, return_offsets_mapping=True)
inputs_with_offsets["offset_mapping"]`,highlighted:`inputs_with_offsets = tokenizer(example, return_offsets_mapping=<span class="hljs-literal">True</span>)
inputs_with_offsets[<span class="hljs-string">&quot;offset_mapping&quot;</span>]`}}),vn=new E({props:{code:`[(0, 0), (0, 2), (3, 7), (8, 10), (11, 12), (12, 14), (14, 16), (16, 18), (19, 22), (23, 24), (25, 29), (30, 32),
 (33, 35), (35, 40), (41, 45), (46, 48), (49, 57), (57, 58), (0, 0)]`,highlighted:`[(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>), (<span class="hljs-number">0</span>, <span class="hljs-number">2</span>), (<span class="hljs-number">3</span>, <span class="hljs-number">7</span>), (<span class="hljs-number">8</span>, <span class="hljs-number">10</span>), (<span class="hljs-number">11</span>, <span class="hljs-number">12</span>), (<span class="hljs-number">12</span>, <span class="hljs-number">14</span>), (<span class="hljs-number">14</span>, <span class="hljs-number">16</span>), (<span class="hljs-number">16</span>, <span class="hljs-number">18</span>), (<span class="hljs-number">19</span>, <span class="hljs-number">22</span>), (<span class="hljs-number">23</span>, <span class="hljs-number">24</span>), (<span class="hljs-number">25</span>, <span class="hljs-number">29</span>), (<span class="hljs-number">30</span>, <span class="hljs-number">32</span>),
 (<span class="hljs-number">33</span>, <span class="hljs-number">35</span>), (<span class="hljs-number">35</span>, <span class="hljs-number">40</span>), (<span class="hljs-number">41</span>, <span class="hljs-number">45</span>), (<span class="hljs-number">46</span>, <span class="hljs-number">48</span>), (<span class="hljs-number">49</span>, <span class="hljs-number">57</span>), (<span class="hljs-number">57</span>, <span class="hljs-number">58</span>), (<span class="hljs-number">0</span>, <span class="hljs-number">0</span>)]`}}),yn=new E({props:{code:"example[12:14]",highlighted:'example[<span class="hljs-number">12</span>:<span class="hljs-number">14</span>]'}}),wn=new E({props:{code:"yl",highlighted:"yl"}}),Rn=new E({props:{code:`results = []
inputs_with_offsets = tokenizer(example, return_offsets_mapping=True)
tokens = inputs_with_offsets.tokens()
offsets = inputs_with_offsets["offset_mapping"]

for idx, pred in enumerate(predictions):
    label = model.config.id2label[pred]
    if label != "O":
        start, end = offsets[idx]
        results.append(
            {
                "entity": label,
                "score": probabilities[idx][pred],
                "word": tokens[idx],
                "start": start,
                "end": end,
            }
        )

print(results)`,highlighted:`results = []
inputs_with_offsets = tokenizer(example, return_offsets_mapping=<span class="hljs-literal">True</span>)
tokens = inputs_with_offsets.tokens()
offsets = inputs_with_offsets[<span class="hljs-string">&quot;offset_mapping&quot;</span>]

<span class="hljs-keyword">for</span> idx, pred <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(predictions):
    label = model.config.id2label[pred]
    <span class="hljs-keyword">if</span> label != <span class="hljs-string">&quot;O&quot;</span>:
        start, end = offsets[idx]
        results.append(
            {
                <span class="hljs-string">&quot;entity&quot;</span>: label,
                <span class="hljs-string">&quot;score&quot;</span>: probabilities[idx][pred],
                <span class="hljs-string">&quot;word&quot;</span>: tokens[idx],
                <span class="hljs-string">&quot;start&quot;</span>: start,
                <span class="hljs-string">&quot;end&quot;</span>: end,
            }
        )

<span class="hljs-built_in">print</span>(results)`}}),On=new E({props:{code:`[{'entity': 'I-PER', 'score': 0.9993828, 'index': 4, 'word': 'S', 'start': 11, 'end': 12},
 {'entity': 'I-PER', 'score': 0.99815476, 'index': 5, 'word': '##yl', 'start': 12, 'end': 14},
 {'entity': 'I-PER', 'score': 0.99590725, 'index': 6, 'word': '##va', 'start': 14, 'end': 16},
 {'entity': 'I-PER', 'score': 0.9992327, 'index': 7, 'word': '##in', 'start': 16, 'end': 18},
 {'entity': 'I-ORG', 'score': 0.97389334, 'index': 12, 'word': 'Hu', 'start': 33, 'end': 35},
 {'entity': 'I-ORG', 'score': 0.976115, 'index': 13, 'word': '##gging', 'start': 35, 'end': 40},
 {'entity': 'I-ORG', 'score': 0.98879766, 'index': 14, 'word': 'Face', 'start': 41, 'end': 45},
 {'entity': 'I-LOC', 'score': 0.99321055, 'index': 16, 'word': 'Brooklyn', 'start': 49, 'end': 57}]`,highlighted:`[{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9993828</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">4</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;S&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">11</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">12</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99815476</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">5</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##yl&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">12</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">14</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99590725</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">6</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##va&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">14</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">16</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9992327</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">7</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##in&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">18</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.97389334</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">12</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Hu&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">33</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">35</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.976115</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">13</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##gging&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">35</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">40</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.98879766</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">14</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Face&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">41</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">45</span>},
 {<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99321055</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Brooklyn&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">49</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">57</span>}]`}}),Sn=new E({props:{code:"example[33:45]",highlighted:'example[<span class="hljs-number">33</span>:<span class="hljs-number">45</span>]'}}),In=new E({props:{code:"Hugging Face",highlighted:"Hugging Face"}}),Gn=new E({props:{code:`import numpy as np

results = []
inputs_with_offsets = tokenizer(example, return_offsets_mapping=True)
tokens = inputs_with_offsets.tokens()
offsets = inputs_with_offsets["offset_mapping"]

idx = 0
while idx < len(predictions):
    pred = predictions[idx]
    label = model.config.id2label[pred]
    if label != "O":
        # Remove the B- or I-
        label = label[2:]
        start, _ = offsets[idx]

        # Grab all the tokens labeled with I-label
        all_scores = []
        while (
            idx < len(predictions)
            and model.config.id2label[predictions[idx]] == f"I-{label}"
        ):
            all_scores.append(probabilities[idx][pred])
            _, end = offsets[idx]
            idx += 1

        # The score is the mean of all the scores of the tokens in that grouped entity
        score = np.mean(all_scores).item()
        word = example[start:end]
        results.append(
            {
                "entity_group": label,
                "score": score,
                "word": word,
                "start": start,
                "end": end,
            }
        )
    idx += 1

print(results)`,highlighted:`<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

results = []
inputs_with_offsets = tokenizer(example, return_offsets_mapping=<span class="hljs-literal">True</span>)
tokens = inputs_with_offsets.tokens()
offsets = inputs_with_offsets[<span class="hljs-string">&quot;offset_mapping&quot;</span>]

idx = <span class="hljs-number">0</span>
<span class="hljs-keyword">while</span> idx &lt; <span class="hljs-built_in">len</span>(predictions):
    pred = predictions[idx]
    label = model.config.id2label[pred]
    <span class="hljs-keyword">if</span> label != <span class="hljs-string">&quot;O&quot;</span>:
        <span class="hljs-comment"># Remove the B- or I-</span>
        label = label[<span class="hljs-number">2</span>:]
        start, _ = offsets[idx]

        <span class="hljs-comment"># Grab all the tokens labeled with I-label</span>
        all_scores = []
        <span class="hljs-keyword">while</span> (
            idx &lt; <span class="hljs-built_in">len</span>(predictions)
            <span class="hljs-keyword">and</span> model.config.id2label[predictions[idx]] == <span class="hljs-string">f&quot;I-<span class="hljs-subst">{label}</span>&quot;</span>
        ):
            all_scores.append(probabilities[idx][pred])
            _, end = offsets[idx]
            idx += <span class="hljs-number">1</span>

        <span class="hljs-comment"># The score is the mean of all the scores of the tokens in that grouped entity</span>
        score = np.mean(all_scores).item()
        word = example[start:end]
        results.append(
            {
                <span class="hljs-string">&quot;entity_group&quot;</span>: label,
                <span class="hljs-string">&quot;score&quot;</span>: score,
                <span class="hljs-string">&quot;word&quot;</span>: word,
                <span class="hljs-string">&quot;start&quot;</span>: start,
                <span class="hljs-string">&quot;end&quot;</span>: end,
            }
        )
    idx += <span class="hljs-number">1</span>

<span class="hljs-built_in">print</span>(results)`}}),Nn=new E({props:{code:`[{'entity_group': 'PER', 'score': 0.9981694, 'word': 'Sylvain', 'start': 11, 'end': 18},
 {'entity_group': 'ORG', 'score': 0.97960204, 'word': 'Hugging Face', 'start': 33, 'end': 45},
 {'entity_group': 'LOC', 'score': 0.99321055, 'word': 'Brooklyn', 'start': 49, 'end': 57}]`,highlighted:`[{<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9981694</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Sylvain&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">11</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">18</span>},
 {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.97960204</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Hugging Face&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">33</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">45</span>},
 {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.99321055</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Brooklyn&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">49</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">57</span>}]`}}),{c(){u=r("meta"),j=c(),d(g.$$.fragment),k=c(),q=r("h1"),R=a("\u5FEB\u901F\u6807\u8BB0\u5668\u7684\u7279\u6B8A\u80FD\u529B"),B=c(),N.c(),G=c(),T=r("p"),P=a("\u5728\u672C\u8282\u4E2D\uFF0C\u6211\u4EEC\u5C06\u4ED4\u7EC6\u7814\u7A76 \u{1F917} Transformers \u4E2D\u6807\u8BB0\u5668\u7684\u529F\u80FD\u3002\u5230\u76EE\u524D\u4E3A\u6B62\uFF0C\u6211\u4EEC\u53EA\u4F7F\u7528\u5B83\u4EEC\u6765\u6807\u8BB0\u8F93\u5165\u6216\u5C06 ID \u89E3\u7801\u56DE\u6587\u672C\uFF0C\u4F46\u662F\u6807\u8BB0\u5668\u2014\u2014\u5C24\u5176\u662F\u90A3\u4E9B\u7531 \u{1F917} Tokenizers \u5E93\u652F\u6301\u7684\u2014\u2014\u53EF\u4EE5\u505A\u66F4\u591A\u7684\u4E8B\u60C5\u3002\u4E3A\u4E86\u8BF4\u660E\u8FD9\u4E9B\u9644\u52A0\u529F\u80FD\uFF0C\u6211\u4EEC\u5C06\u63A2\u7D22\u5982\u4F55\u91CD\u73B0\u7ED3\u679C "),ns=r("strong"),V=a("token-classification"),cs=a(" \uFF08\u6211\u4EEC\u79F0\u4E4B\u4E3A "),ts=r("strong"),as=a("ner"),F=a(" \uFF09 \u548C "),Y=r("strong"),C=a("question-answering"),es=a(" \u6211\u4EEC\u7B2C\u4E00\u6B21\u5728"),m=r("a"),v=a("Chapter 1"),ys=a("\u4E2D\u9047\u5230\u7684\u7BA1\u9053."),js=c(),d(A.$$.fragment),ds=c(),Ss=r("p"),Sl=a("\u5728\u63A5\u4E0B\u6765\u7684\u8BA8\u8BBA\u4E2D\uFF0C\u6211\u4EEC\u4F1A\u7ECF\u5E38\u533A\u5206\u201C\u6162\u201D\u548C\u201C\u5FEB\u201D\u5206\u8BCD\u5668\u3002\u6162\u901F\u5206\u8BCD\u5668\u662F\u5728 \u{1F917} Transformers \u5E93\u4E2D\u7528 Python \u7F16\u5199\u7684\uFF0C\u800C\u5FEB\u901F\u7248\u672C\u662F\u7531 \u{1F917} \u5206\u8BCD\u5668\u63D0\u4F9B\u7684\uFF0C\u5B83\u4EEC\u662F\u7528 Rust \u7F16\u5199\u7684\u3002\u5982\u679C\u4F60\u8FD8\u8BB0\u5F97\u5728"),Cn=r("a"),Il=a("Chapter 5"),Gl=a("\u4E2D\u62A5\u544A\u4E86\u5FEB\u901F\u548C\u6162\u901F\u5206\u8BCD\u5668\u5BF9\u836F\u7269\u5BA1\u67E5\u6570\u636E\u96C6\u8FDB\u884C\u5206\u8BCD\u6240\u9700\u7684\u65F6\u95F4\u7684\u8FD9\u5F20\u8868\uFF0C\u60A8\u5E94\u8BE5\u77E5\u9053\u4E3A\u4EC0\u4E48\u6211\u4EEC\u79F0\u5B83\u4EEC\u4E3A\u201C\u5FEB\u201D\u548C\u201C\u6162\u201D\uFF1A"),Ja=c(),Is=r("table"),dt=r("thead"),ws=r("tr"),zn=r("th"),Nl=a("Fast tokenizer"),Pl=c(),Xn=r("th"),ql=a("Slow tokenizer"),Bl=c(),_t=r("th"),Fl=c(),Ls=r("tbody"),Rs=r("tr"),Hn=r("td"),bt=r("code"),Cl=a("batched=True"),zl=c(),An=r("td"),Xl=a("10.8s"),Hl=c(),Mn=r("td"),Al=a("4min41s"),Ml=c(),Os=r("tr"),Dn=r("td"),$t=r("code"),Dl=a("batched=False"),Ll=c(),Ln=r("td"),Vl=a("59.2s"),Yl=c(),Vn=r("td"),Ql=a("5min3s"),Ka=c(),d(Gs.$$.fragment),Wa=c(),Vs=r("h2"),Ul=a("\u6279\u91CF\u7F16\u7801"),Za=c(),d(Ys.$$.fragment),se=c(),Ns=r("p"),Jl=a("\u5206\u8BCD\u5668\u7684\u8F93\u51FA\u4E0D\u662F\u7B80\u5355\u7684 Python \u5B57\u5178\uFF1B\u6211\u4EEC\u5F97\u5230\u7684\u5B9E\u9645\u4E0A\u662F\u4E00\u4E2A\u7279\u6B8A\u7684 "),kt=r("strong"),Kl=a("BatchEncoding"),Wl=a(" \u76EE\u7684\u3002\u5B83\u662F\u5B57\u5178\u7684\u5B50\u7C7B\uFF08\u8FD9\u5C31\u662F\u4E3A\u4EC0\u4E48\u6211\u4EEC\u4E4B\u524D\u80FD\u591F\u6BEB\u65E0\u95EE\u9898\u5730\u7D22\u5F15\u5230\u8BE5\u7ED3\u679C\u4E2D\u7684\u539F\u56E0\uFF09\uFF0C\u4F46\u5177\u6709\u4E3B\u8981\u7531\u5FEB\u901F\u6807\u8BB0\u5668\u4F7F\u7528\u7684\u9644\u52A0\u65B9\u6CD5\u3002"),ne=c(),Yn=r("p"),Zl=a("\u9664\u4E86\u5B83\u4EEC\u7684\u5E76\u884C\u5316\u80FD\u529B\u4E4B\u5916\uFF0C\u5FEB\u901F\u6807\u8BB0\u5668\u7684\u5173\u952E\u529F\u80FD\u662F\u5B83\u4EEC\u59CB\u7EC8\u8DDF\u8E2A\u6700\u7EC8\u6807\u8BB0\u6765\u81EA\u7684\u539F\u59CB\u6587\u672C\u8303\u56F4\u2014\u2014\u6211\u4EEC\u79F0\u4E4B\u4E3A\u504F\u79FB\u6620\u5C04.\u8FD9\u53CD\u8FC7\u6765\u53C8\u89E3\u9501\u4E86\u8BF8\u5982\u5C06\u6BCF\u4E2A\u5355\u8BCD\u6620\u5C04\u5230\u5B83\u751F\u6210\u7684\u6807\u8BB0\u6216\u5C06\u539F\u59CB\u6587\u672C\u7684\u6BCF\u4E2A\u5B57\u7B26\u6620\u5C04\u5230\u5B83\u5185\u90E8\u7684\u6807\u8BB0\u7B49\u529F\u80FD\uFF0C\u53CD\u4E4B\u4EA6\u7136\u3002\u8BA9\u6211\u4EEC\u770B\u4E00\u4E2A\u4F8B\u5B50\uFF1A"),te=c(),d(Qs.$$.fragment),ae=c(),Ps=r("p"),sr=a("\u5982\u524D\u6240\u8FF0\uFF0C\u6211\u4EEC\u5F97\u5230\u4E00\u4E2A "),Et=r("strong"),nr=a("BatchEncoding"),tr=a(" \u6807\u8BB0\u5668\u8F93\u51FA\u4E2D\u7684\u5BF9\u8C61\uFF1A"),ee=c(),d(Us.$$.fragment),le=c(),Q=r("p"),ar=a("\u7531\u4E8E "),vt=r("strong"),er=a("AutoTokenizer"),lr=a(" \u7C7B\u9ED8\u8BA4\u9009\u62E9\u5FEB\u901F\u6807\u8BB0\u5668\uFF0C\u6211\u4EEC\u53EF\u4EE5\u4F7F\u7528\u9644\u52A0\u65B9\u6CD5 this "),yt=r("strong"),rr=a("BatchEncoding"),pr=a(" \u5BF9\u8C61\u63D0\u4F9B\u3002\u6211\u4EEC\u6709\u4E24\u79CD\u65B9\u6CD5\u6765\u68C0\u67E5\u6211\u4EEC\u7684\u5206\u8BCD\u5668\u662F\u5FEB\u7684\u8FD8\u662F\u6162\u7684\u3002\u6211\u4EEC\u53EF\u4EE5\u68C0\u67E5 "),wt=r("strong"),or=a("is_fast"),ir=a(" \u7684\u5C5E\u6027 "),Rt=r("strong"),cr=a("tokenizer"),fr=a(" \uFF1A"),re=c(),d(Js.$$.fragment),pe=c(),d(Ks.$$.fragment),oe=c(),qs=r("p"),gr=a("\u6216\u68C0\u67E5\u6211\u4EEC\u7684\u76F8\u540C\u5C5E\u6027 "),Ot=r("strong"),ur=a("encoding"),mr=a(" \uFF1A"),ie=c(),d(Ws.$$.fragment),ce=c(),d(Zs.$$.fragment),fe=c(),Qn=r("p"),hr=a("\u8BA9\u6211\u4EEC\u770B\u770B\u5FEB\u901F\u6807\u8BB0\u5668\u4F7F\u6211\u4EEC\u80FD\u591F\u505A\u4EC0\u4E48\u3002\u9996\u5148\uFF0C\u6211\u4EEC\u53EF\u4EE5\u8BBF\u95EE\u4EE4\u724C\u800C\u65E0\u9700\u5C06 ID \u8F6C\u6362\u56DE\u4EE4\u724C\uFF1A"),ge=c(),d(sn.$$.fragment),ue=c(),d(nn.$$.fragment),me=c(),_s=r("p"),xr=a("\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C\u7D22\u5F15 5 \u5904\u7684\u4EE4\u724C\u662F "),Tt=r("strong"),jr=a("##yl"),dr=a(" \uFF0C\u5B83\u662F\u539F\u59CB\u53E5\u5B50\u4E2D\u201CSylvain\u201D\u4E00\u8BCD\u7684\u4E00\u90E8\u5206\u3002\u6211\u4EEC\u4E5F\u53EF\u4EE5\u4F7F\u7528 "),St=r("strong"),_r=a("word_ids()"),br=a(" \u83B7\u53D6\u6BCF\u4E2A\u6807\u8BB0\u6765\u81EA\u7684\u5355\u8BCD\u7D22\u5F15\u7684\u65B9\u6CD5\uFF1A"),he=c(),d(tn.$$.fragment),xe=c(),d(an.$$.fragment),je=c(),U=r("p"),$r=a("\u6211\u4EEC\u53EF\u4EE5\u770B\u5230\u5206\u8BCD\u5668\u7684\u7279\u6B8A\u6807\u8BB0 "),It=r("strong"),kr=a("[CLS]"),Er=a(" \u548C "),Gt=r("strong"),vr=a("[SEP]"),yr=a(" \u88AB\u6620\u5C04\u5230 "),Nt=r("strong"),wr=a("None"),Rr=a(" \uFF0C\u7136\u540E\u6BCF\u4E2A\u6807\u8BB0\u90FD\u6620\u5C04\u5230\u5B83\u8D77\u6E90\u7684\u5355\u8BCD\u3002\u8FD9\u5BF9\u4E8E\u786E\u5B9A\u4E00\u4E2A\u6807\u8BB0\u662F\u5426\u5728\u5355\u8BCD\u7684\u5F00\u5934\u6216\u4E24\u4E2A\u6807\u8BB0\u662F\u5426\u5728\u540C\u4E00\u4E2A\u5355\u8BCD\u4E2D\u7279\u522B\u6709\u7528\u3002\u6211\u4EEC\u53EF\u4EE5\u4F9D\u9760 "),Pt=r("strong"),Or=a("##"),Tr=a(" \u524D\u7F00\uFF0C\u4F46\u5B83\u4EC5\u9002\u7528\u4E8E\u7C7B\u4F3C BERT \u7684\u5206\u8BCD\u5668\uFF1B\u8FD9\u79CD\u65B9\u6CD5\u9002\u7528\u4E8E\u4EFB\u4F55\u7C7B\u578B\u7684\u6807\u8BB0\u5668\uFF0C\u53EA\u8981\u5B83\u662F\u5FEB\u901F\u7684\u3002\u5728\u4E0B\u4E00\u7AE0\u4E2D\uFF0C\u6211\u4EEC\u5C06\u770B\u5230\u5982\u4F55\u4F7F\u7528\u6B64\u529F\u80FD\u5C06\u6BCF\u4E2A\u5355\u8BCD\u7684\u6807\u7B7E\u6B63\u786E\u5E94\u7528\u4E8E\u547D\u540D\u5B9E\u4F53\u8BC6\u522B (NER) \u548C\u8BCD\u6027 (POS) \u6807\u8BB0\u7B49\u4EFB\u52A1\u4E2D\u7684\u6807\u8BB0\u3002\u6211\u4EEC\u8FD8\u53EF\u4EE5\u4F7F\u7528\u5B83\u6765\u5C4F\u853D\u6765\u81EA\u5C4F\u853D\u8BED\u8A00\u5EFA\u6A21\u4E2D\u6765\u81EA\u540C\u4E00\u5355\u8BCD\u7684\u6240\u6709\u6807\u8BB0\uFF08\u4E00\u79CD\u79F0\u4E3A\u5168\u8BCD\u63A9\u7801\uFF09\u3002"),de=c(),d(Bs.$$.fragment),_e=c(),bs=r("p"),Sr=a("\u540C\u6837\uFF0C\u6709\u4E00\u4E2A "),qt=r("strong"),Ir=a("sentence_ids()"),Gr=a(" \u6211\u4EEC\u53EF\u4EE5\u7528\u6765\u5C06\u6807\u8BB0\u6620\u5C04\u5230\u5B83\u6765\u81EA\u7684\u53E5\u5B50\u7684\u65B9\u6CD5\uFF08\u5C3D\u7BA1\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C "),Bt=r("strong"),Nr=a("token_type_ids"),Pr=a(" \u5206\u8BCD\u5668\u8FD4\u56DE\u7684\u4FE1\u606F\u53EF\u4EE5\u4E3A\u6211\u4EEC\u63D0\u4F9B\u76F8\u540C\u7684\u4FE1\u606F\uFF09\u3002"),be=c(),z=r("p"),qr=a("\u6700\u540E\uFF0C\u6211\u4EEC\u53EF\u4EE5\u5C06\u4EFB\u4F55\u5355\u8BCD\u6216\u6807\u8BB0\u6620\u5C04\u5230\u539F\u59CB\u6587\u672C\u4E2D\u7684\u5B57\u7B26\uFF0C\u53CD\u4E4B\u4EA6\u7136\uFF0C\u901A\u8FC7 "),Ft=r("strong"),Br=a("word_to_chars()"),Fr=a(" \u6216\u8005 "),Ct=r("strong"),Cr=a("token_to_chars()"),zr=a(" \u548C "),zt=r("strong"),Xr=a("char_to_word()"),Hr=a(" \u6216\u8005 "),Xt=r("strong"),Ar=a("char_to_token()"),Mr=a(" \u65B9\u6CD5\u3002\u4F8B\u5982\uFF0C "),Ht=r("strong"),Dr=a("word_ids()"),Lr=a(" \u65B9\u6CD5\u544A\u8BC9\u6211\u4EEC "),At=r("strong"),Vr=a("##yl"),Yr=a(" \u662F\u7D22\u5F15 3 \u5904\u5355\u8BCD\u7684\u4E00\u90E8\u5206\uFF0C\u4F46\u5B83\u662F\u53E5\u5B50\u4E2D\u7684\u54EA\u4E2A\u5355\u8BCD\uFF1F\u6211\u4EEC\u53EF\u4EE5\u8FD9\u6837\u53D1\u73B0\uFF1A"),$e=c(),d(en.$$.fragment),ke=c(),d(ln.$$.fragment),Ee=c(),Fs=r("p"),Qr=a("\u6B63\u5982\u6211\u4EEC\u4E4B\u524D\u63D0\u5230\u7684\uFF0C\u8FD9\u4E00\u5207\u90FD\u662F\u7531\u5FEB\u901F\u6807\u8BB0\u5668\u8DDF\u8E2A\u6BCF\u4E2A\u6807\u8BB0\u6765\u81EA\u5217\u8868\u4E2D\u7684\u6587\u672C\u8DE8\u5EA6\u8FD9\u4E00\u4E8B\u5B9E\u63D0\u4F9B\u652F\u6301\u7684\u62B5\u6D88.\u4E3A\u4E86\u8BF4\u660E\u5B83\u4EEC\u7684\u7528\u9014\uFF0C\u63A5\u4E0B\u6765\u6211\u4EEC\u5C06\u5411\u60A8\u5C55\u793A\u5982\u4F55\u590D\u5236\u7ED3\u679C "),Mt=r("strong"),Ur=a("token-classification"),Jr=a(" \u624B\u52A8\u7BA1\u9053\u3002"),ve=c(),d(Cs.$$.fragment),ye=c(),rn=r("h2"),Kr=a("\u5728\u4EE4\u724C\u5206\u7C7B\u7BA1\u9053\u5185"),we=c(),J=r("p"),Wr=a("\u5728"),Un=r("a"),Zr=a("Chapter 1"),sp=a("\u6211\u4EEC\u7B2C\u4E00\u6B21\u5C1D\u8BD5\u4F7F\u7528 NER\u2014\u2014\u4EFB\u52A1\u662F\u8BC6\u522B\u6587\u672C\u7684\u54EA\u4E9B\u90E8\u5206\u5BF9\u5E94\u4E8E\u4E2A\u4EBA\u3001\u5730\u70B9\u6216\u7EC4\u7EC7\u7B49\u5B9E\u4F53\u2014\u2014\u4F7F\u7528 \u{1F917} Transformers "),Dt=r("strong"),np=a("pipeline()"),tp=a(" \u529F\u80FD\u3002\u7136\u540E\uFF0C\u5728"),Jn=r("a"),ap=a("Chapter 2"),ep=a("\uFF0C\u6211\u4EEC\u770B\u5230\u4E86\u7BA1\u9053\u5982\u4F55\u5C06\u4ECE\u539F\u59CB\u6587\u672C\u4E2D\u83B7\u53D6\u9884\u6D4B\u6240\u9700\u7684\u4E09\u4E2A\u9636\u6BB5\u7EC4\u5408\u5728\u4E00\u8D77\uFF1A\u6807\u8BB0\u5316\u3001\u901A\u8FC7\u6A21\u578B\u4F20\u9012\u8F93\u5165\u548C\u540E\u5904\u7406\u3002\u524D\u4E24\u6B65 "),Lt=r("strong"),lp=a("token-classification"),rp=a(" \u7BA1\u9053\u4E0E\u4EFB\u4F55\u5176\u4ED6\u7BA1\u9053\u76F8\u540C\uFF0C\u4F46\u540E\u5904\u7406\u7A0D\u5FAE\u590D\u6742\u4E00\u4E9B - \u8BA9\u6211\u4EEC\u770B\u770B\u5982\u4F55\uFF01"),Re=c(),gs.c(),Kn=c(),pn=r("h3"),pp=a("\u901A\u8FC7\u7BA1\u9053\u83B7\u5F97\u57FA\u672C\u7ED3\u679C"),Oe=c(),zs=r("p"),op=a("\u9996\u5148\uFF0C\u8BA9\u6211\u4EEC\u83B7\u53D6\u4E00\u4E2A\u6807\u8BB0\u5206\u7C7B\u7BA1\u9053\uFF0C\u4EE5\u4FBF\u6211\u4EEC\u53EF\u4EE5\u624B\u52A8\u6BD4\u8F83\u4E00\u4E9B\u7ED3\u679C\u3002\u9ED8\u8BA4\u4F7F\u7528\u7684\u6A21\u578B\u662F"),on=r("a"),ip=a("dbmdz/bert-large-cased-finetuned-conll03-english"),cp=a(";\u5B83\u5BF9\u53E5\u5B50\u6267\u884C NER\uFF1A"),Te=c(),d(cn.$$.fragment),Se=c(),d(fn.$$.fragment),Ie=c(),Wn=r("p"),fp=a("\u8BE5\u6A21\u578B\u6B63\u786E\u5730\u5C06\u201CSylvain\u201D\u751F\u6210\u7684\u6BCF\u4E2A\u6807\u8BB0\u8BC6\u522B\u4E3A\u4E00\u4E2A\u4EBA\uFF0C\u5C06\u201CHugging Face\u201D\u751F\u6210\u7684\u6BCF\u4E2A\u6807\u8BB0\u8BC6\u522B\u4E3A\u4E00\u4E2A\u7EC4\u7EC7\uFF0C\u5C06\u201CBrooklyn\u201D\u751F\u6210\u7684\u6807\u8BB0\u8BC6\u522B\u4E3A\u4E00\u4E2A\u4F4D\u7F6E\u3002\u6211\u4EEC\u8FD8\u53EF\u4EE5\u8981\u6C42\u7BA1\u9053\u5C06\u5BF9\u5E94\u4E8E\u540C\u4E00\u5B9E\u4F53\u7684\u4EE4\u724C\u7EC4\u5408\u5728\u4E00\u8D77\uFF1A"),Ge=c(),d(gn.$$.fragment),Ne=c(),d(un.$$.fragment),Pe=c(),M=r("p"),Vt=r("strong"),gp=a("aggregation_strategy"),up=a(" \u9009\u62E9\u5C06\u66F4\u6539\u4E3A\u6BCF\u4E2A\u5206\u7EC4\u5B9E\u4F53\u8BA1\u7B97\u7684\u5206\u6570\u3002\u548C "),Yt=r("strong"),mp=a("simple"),hp=a(" \u5206\u6570\u53EA\u662F\u7ED9\u5B9A\u5B9E\u4F53\u4E2D\u6BCF\u4E2A\u6807\u8BB0\u7684\u5206\u6570\u7684\u5E73\u5747\u503C\uFF1A\u4F8B\u5982\uFF0C\u201CSylvain\u201D\u7684\u5206\u6570\u662F\u6211\u4EEC\u5728\u524D\u9762\u7684\u793A\u4F8B\u4E2D\u770B\u5230\u7684\u6807\u8BB0\u5206\u6570\u7684\u5E73\u5747\u503C "),Qt=r("strong"),xp=a("S"),jp=a(" , "),Ut=r("strong"),dp=a("##yl"),_p=a(" , "),Jt=r("strong"),bp=a("##va"),$p=a(" \uFF0C \u548C "),Kt=r("strong"),kp=a("##in"),Ep=a(" .\u5176\u4ED6\u53EF\u7528\u7684\u7B56\u7565\u662F\uFF1A"),qe=c(),$s=r("ul"),Wt=r("li"),Zn=r("p"),Zt=r("code"),vp=a('"first"'),yp=a(", \u5176\u4E2D\u6BCF\u4E2A\u5B9E\u4F53\u7684\u5206\u6570\u662F\u8BE5\u5B9E\u4F53\u7684\u7B2C\u4E00\u4E2A\u6807\u8BB0\u7684\u5206\u6570\uFF08\u56E0\u6B64\u5BF9\u4E8E\u201CSylvain\u201D\uFF0C\u5B83\u5C06\u662F 0.993828\uFF0C\u6807\u8BB0\u7684\u5206\u6570)"),wp=c(),sa=r("li"),st=r("p"),na=r("code"),Rp=a('"max"'),Op=a(",\u5176\u4E2D\u6BCF\u4E2A\u5B9E\u4F53\u7684\u5206\u6570\u662F\u8BE5\u5B9E\u4F53\u4E2D\u6807\u8BB0\u7684\u6700\u5927\u5206\u6570\uFF08\u56E0\u6B64\u5BF9\u4E8E\u201CHugging Face\u201D\uFF0C\u5B83\u5C06\u662F 0.98879766\uFF0C\u5373\u201CFace\u201D\u7684\u5206\u6570\uFF09"),Tp=c(),ta=r("li"),nt=r("p"),aa=r("code"),Sp=a('"average"'),Ip=a(", \u5176\u4E2D\u6BCF\u4E2A\u5B9E\u4F53\u7684\u5206\u6570\u662F\u7EC4\u6210\u8BE5\u5B9E\u4F53\u7684\u5355\u8BCD\u5206\u6570\u7684\u5E73\u5747\u503C\uFF08\u56E0\u6B64\u5BF9\u4E8E\u201CSylvain\u201D\uFF0C\u4E0E\u201Csimple\u201D\u7B56\u7565\uFF0C\u4F46\u201CHugging Face\u201D\u7684\u5F97\u5206\u4E3A 0.9819\uFF0C\u201CHugging\u201D\u5F97\u5206\u7684\u5E73\u5747\u503C\u4E3A 0.975\uFF0C\u201CFace\u201D\u5F97\u5206\u4E3A 0.98879\uFF09"),Be=c(),tt=r("p"),Gp=a("\u73B0\u5728\u8BA9\u6211\u4EEC\u770B\u770B\u5982\u4F55\u5728\u4E0D\u4F7F\u7528pipeline\uFF08\uFF09\u51FD\u6570\u7684\u60C5\u51B5\u4E0B\u83B7\u5F97\u8FD9\u4E9B\u7ED3\u679C\uFF01"),Fe=c(),mn=r("h3"),Np=a("\u4ECE\u8F93\u5165\u5230\u9884\u6D4B"),Ce=c(),ms.c(),at=c(),et=r("p"),Pp=a("\u6211\u4EEC\u6709\u4E00\u4E2A\u5305\u542B 19 \u4E2A\u6807\u8BB0\u7684 1 \u4E2A\u5E8F\u5217\u7684\u6279\u6B21\uFF0C\u6A21\u578B\u6709 9 \u4E2A\u4E0D\u540C\u7684\u6807\u7B7E\uFF0C\u56E0\u6B64\u6A21\u578B\u7684\u8F93\u51FA\u5177\u6709 1 x 19 x 9 \u7684\u5F62\u72B6\u3002\u4E0E\u6587\u672C\u5206\u7C7B\u7BA1\u9053\u4E00\u6837\uFF0C\u6211\u4EEC\u4F7F\u7528 softmax \u51FD\u6570\u6765\u8F6C\u6362\u8FD9\u4E9B logits\u5230\u6982\u7387\uFF0C\u6211\u4EEC\u91C7\u7528 argmax \u6765\u83B7\u5F97\u9884\u6D4B\uFF08\u8BF7\u6CE8\u610F\uFF0C\u6211\u4EEC\u53EF\u4EE5\u5728 logits \u4E0A\u91C7\u7528 argmax\uFF0C\u56E0\u4E3A softmax \u4E0D\u4F1A\u6539\u53D8\u987A\u5E8F\uFF09\uFF1A"),ze=c(),xs.c(),lt=c(),d(hn.$$.fragment),Xe=c(),xn=r("p"),ea=r("strong"),qp=a("model.config.id2label"),Bp=a(" \u5C5E\u6027\u5305\u542B\u7D22\u5F15\u5230\u6807\u7B7E\u7684\u6620\u5C04\uFF0C\u6211\u4EEC\u53EF\u4EE5\u7528\u5B83\u6765\u7406\u89E3\u9884\u6D4B\uFF1A"),He=c(),d(jn.$$.fragment),Ae=c(),d(dn.$$.fragment),Me=c(),w=r("p"),Fp=a("\u6B63\u5982\u6211\u4EEC\u4E4B\u524D\u770B\u5230\u7684\uFF0C\u6709 9 \u4E2A\u6807\u7B7E\uFF1A "),la=r("strong"),Cp=a("O"),zp=a(" \u662F\u4E0D\u5728\u4EFB\u4F55\u547D\u540D\u5B9E\u4F53\u4E2D\u7684\u6807\u8BB0\u7684\u6807\u7B7E\uFF08\u5B83\u4EE3\u8868\u201C\u5916\u90E8\u201D\uFF09\uFF0C\u7136\u540E\u6211\u4EEC\u4E3A\u6BCF\u79CD\u7C7B\u578B\u7684\u5B9E\u4F53\uFF08\u6742\u9879\u3001\u4EBA\u5458\u3001\u7EC4\u7EC7\u548C\u4F4D\u7F6E\uFF09\u63D0\u4F9B\u4E24\u4E2A\u6807\u7B7E\u3002\u6807\u7B7E "),ra=r("strong"),Xp=a("B-XXX"),Hp=a(" \u8868\u793A\u4EE4\u724C\u5728\u5B9E\u4F53\u7684\u5F00\u5934 "),pa=r("strong"),Ap=a("XXX"),Mp=a(" \u548C\u6807\u7B7E "),oa=r("strong"),Dp=a("I-XXX"),Lp=a(" \u8868\u793A\u4EE4\u724C\u5728\u5B9E\u4F53\u5185 "),ia=r("strong"),Vp=a("XXX"),Yp=a(" .\u4F8B\u5982\uFF0C\u5728\u5F53\u524D\u793A\u4F8B\u4E2D\uFF0C\u6211\u4EEC\u5E0C\u671B\u6211\u4EEC\u7684\u6A21\u578B\u5BF9\u4EE4\u724C\u8FDB\u884C\u5206\u7C7B "),ca=r("strong"),Qp=a("S"),Up=a(" \u4F5C\u4E3A "),fa=r("strong"),Jp=a("B-PER"),Kp=a(" \uFF08\u4E00\u4E2A\u4EBA\u5B9E\u4F53\u7684\u5F00\u59CB\uFF09\u548C\u4EE4\u724C "),ga=r("strong"),Wp=a("##yl"),Zp=a(" , "),ua=r("strong"),so=a("##va"),no=a(" \u548C "),ma=r("strong"),to=a("##in"),ao=a(" \u4F5C\u4E3A "),ha=r("strong"),eo=a("I-PER"),lo=a(" \uFF08\u5728\u4E2A\u4EBA\u5B9E\u4F53\u5185\uFF09"),De=c(),X=r("p"),ro=a("\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C\u60A8\u53EF\u80FD\u8BA4\u4E3A\u6A21\u578B\u662F\u9519\u8BEF\u7684\uFF0C\u56E0\u4E3A\u5B83\u7ED9\u51FA\u4E86\u6807\u7B7E "),xa=r("strong"),po=a("I-PER"),oo=a(" \u5BF9\u6240\u6709\u8FD9\u56DB\u4E2A\u4EE4\u724C\uFF0C\u4F46\u8FD9\u5E76\u4E0D\u5B8C\u5168\u6B63\u786E\u3002\u5B9E\u9645\u4E0A\u6709\u4E24\u79CD\u683C\u5F0F "),ja=r("strong"),io=a("B-"),co=a(" \u548C "),da=r("strong"),fo=a("I-"),go=a(" \u6807\u7B7E\uFF1AIOB1\u548CIOB2. IOB2 \u683C\u5F0F\uFF08\u4E0B\u9762\u7C89\u7EA2\u8272\uFF09\u662F\u6211\u4EEC\u4ECB\u7ECD\u7684\u683C\u5F0F\uFF0C\u800C\u5728 IOB1 \u683C\u5F0F\uFF08\u84DD\u8272\uFF09\u4E2D\uFF0C\u6807\u7B7E\u4EE5 "),_a=r("strong"),uo=a("B-"),mo=a(" \u4EC5\u7528\u4E8E\u5206\u9694\u76F8\u540C\u7C7B\u578B\u7684\u4E24\u4E2A\u76F8\u90BB\u5B9E\u4F53\u3002\u6211\u4EEC\u4F7F\u7528\u7684\u6A21\u578B\u5728\u4F7F\u7528\u8BE5\u683C\u5F0F\u7684\u6570\u636E\u96C6\u4E0A\u8FDB\u884C\u4E86\u5FAE\u8C03\uFF0C\u8FD9\u5C31\u662F\u5B83\u5206\u914D\u6807\u7B7E\u7684\u539F\u56E0 "),ba=r("strong"),ho=a("I-PER"),xo=a(" \u5230 "),$a=r("strong"),jo=a("S"),_o=a(" \u4EE4\u724C\u3002"),Le=c(),Ts=r("div"),_n=r("img"),bo=c(),bn=r("img"),Ve=c(),Xs=r("p"),$o=a("\u4E86\u8FD9\u5F20\u5730\u56FE\uFF0C\u6211\u4EEC\u5DF2\u7ECF\u51C6\u5907\u597D\uFF08\u51E0\u4E4E\u5B8C\u5168\uFF09\u91CD\u73B0\u7B2C\u4E00\u4E2A\u7BA1\u9053\u7684\u7ED3\u679C\u2014\u2014\u6211\u4EEC\u53EF\u4EE5\u83B7\u53D6\u6BCF\u4E2A\u672A\u88AB\u5F52\u7C7B\u4E3A\u7684\u6807\u8BB0\u7684\u5206\u6570\u548C\u6807\u7B7E "),ka=r("strong"),ko=a("O"),Eo=a(" \uFF1A"),Ye=c(),d($n.$$.fragment),Qe=c(),d(kn.$$.fragment),Ue=c(),rs=r("p"),vo=a("\u8FD9\u4E0E\u6211\u4EEC\u4E4B\u524D\u7684\u60C5\u51B5\u975E\u5E38\u76F8\u4F3C\uFF0C\u53EA\u6709\u4E00\u4E2A\u4F8B\u5916\uFF1A\u7BA1\u9053\u8FD8\u4E3A\u6211\u4EEC\u63D0\u4F9B\u4E86\u6709\u5173 "),Ea=r("strong"),yo=a("start"),wo=a(" \u548C "),va=r("strong"),Ro=a("end"),Oo=a(" \u539F\u59CB\u53E5\u5B50\u4E2D\u7684\u6BCF\u4E2A\u5B9E\u4F53\u3002\u8FD9\u662F\u6211\u4EEC\u7684\u504F\u79FB\u6620\u5C04\u5C06\u53D1\u6325\u4F5C\u7528\u7684\u5730\u65B9\u3002\u8981\u83B7\u5F97\u504F\u79FB\u91CF\uFF0C\u6211\u4EEC\u53EA\u9700\u8981\u8BBE\u7F6E "),ya=r("strong"),To=a("return_offsets_mapping=True"),So=a(" \u5F53\u6211\u4EEC\u5C06\u5206\u8BCD\u5668\u5E94\u7528\u4E8E\u6211\u4EEC\u7684\u8F93\u5165\u65F6\uFF1A"),Je=c(),d(En.$$.fragment),Ke=c(),d(vn.$$.fragment),We=c(),ps=r("p"),Io=a("\u6BCF\u4E2A\u5143\u7EC4\u662F\u5BF9\u5E94\u4E8E\u6BCF\u4E2A\u6807\u8BB0\u7684\u6587\u672C\u8DE8\u5EA6\uFF0C\u5176\u4E2D "),wa=r("strong"),Go=a("(0, 0)"),No=a(" \u4FDD\u7559\u7528\u4E8E\u7279\u6B8A\u4EE4\u724C\u3002\u6211\u4EEC\u4E4B\u524D\u770B\u5230\u7D22\u5F15 5 \u5904\u7684\u4EE4\u724C\u662F "),Ra=r("strong"),Po=a("##yl"),qo=a(" \uFF0C \u5176\u4E2D\u6709 "),Oa=r("strong"),Bo=a("(12, 14)"),Fo=a(" \u4F5C\u4E3A\u8FD9\u91CC\u7684\u62B5\u6D88\u3002\u5982\u679C\u6211\u4EEC\u5728\u793A\u4F8B\u4E2D\u6293\u53D6\u76F8\u5E94\u7684\u5207\u7247\uFF1A"),Ze=c(),d(yn.$$.fragment),sl=c(),Hs=r("p"),Co=a("\u6211\u4EEC\u5F97\u5230\u4E86\u6B63\u786E\u7684\u6587\u672C\u8DE8\u5EA6\uFF0C\u800C\u6CA1\u6709 "),Ta=r("strong"),zo=a("##"),Xo=a(" \uFF1A"),nl=c(),d(wn.$$.fragment),tl=c(),rt=r("p"),Ho=a("\u4F7F\u7528\u8FD9\u4E2A\uFF0C\u6211\u4EEC\u73B0\u5728\u53EF\u4EE5\u5B8C\u6210\u4E4B\u524D\u7684\u7ED3\u679C\uFF1A"),al=c(),d(Rn.$$.fragment),el=c(),d(On.$$.fragment),ll=c(),pt=r("p"),Ao=a("\u8FD9\u548C\u6211\u4EEC\u4ECE\u7B2C\u4E00\u4E2A\u7BA1\u9053\u4E2D\u5F97\u5230\u7684\u4E00\u6837\uFF01"),rl=c(),Tn=r("h3"),Mo=a("\u5206\u7EC4\u5B9E\u4F53"),pl=c(),H=r("p"),Do=a("\u4F7F\u7528\u504F\u79FB\u91CF\u6765\u786E\u5B9A\u6BCF\u4E2A\u5B9E\u4F53\u7684\u5F00\u59CB\u548C\u7ED3\u675F\u952E\u5F88\u65B9\u4FBF\uFF0C\u4F46\u8BE5\u4FE1\u606F\u5E76\u4E0D\u662F\u7EDD\u5BF9\u5FC5\u8981\u7684\u3002\u7136\u800C\uFF0C\u5F53\u6211\u4EEC\u60F3\u8981\u5C06\u5B9E\u4F53\u7EC4\u5408\u5728\u4E00\u8D77\u65F6\uFF0C\u504F\u79FB\u91CF\u5C06\u4E3A\u6211\u4EEC\u8282\u7701\u5927\u91CF\u6DF7\u4E71\u7684\u4EE3\u7801\u3002\u4F8B\u5982\uFF0C\u5982\u679C\u6211\u4EEC\u60F3\u5C06\u4EE4\u724C\u7EC4\u5408\u5728\u4E00\u8D77 "),Sa=r("strong"),Lo=a("Hu"),Vo=a(" , "),Ia=r("strong"),Yo=a("##gging"),Qo=a(" \uFF0C \u548C "),Ga=r("strong"),Uo=a("Face"),Jo=a(" \uFF0C\u6211\u4EEC\u53EF\u4EE5\u5236\u5B9A\u7279\u6B8A\u7684\u89C4\u5219\uFF0C\u8BF4\u524D\u4E24\u4E2A\u5E94\u8BE5\u9644\u52A0\uFF0C\u540C\u65F6\u5220\u9664 "),Na=r("strong"),Ko=a("##"),Wo=a(" \uFF0C\u4EE5\u53CA "),Pa=r("strong"),Zo=a("Face"),si=a(" \u5E94\u8BE5\u6DFB\u52A0\u4E00\u4E2A\u7A7A\u683C\uFF0C\u56E0\u4E3A\u5B83\u4E0D\u4EE5 "),qa=r("strong"),ni=a("##"),ti=a(" \u2014 \u4F46\u8FD9\u4EC5\u9002\u7528\u4E8E\u8FD9\u79CD\u7279\u5B9A\u7C7B\u578B\u7684\u6807\u8BB0\u5668\u3002\u6211\u4EEC\u5FC5\u987B\u4E3A SentencePiece \u6216 Byte-Pair-Encoding \u5206\u8BCD\u5668\uFF08\u672C\u7AE0\u7A0D\u540E\u8BA8\u8BBA\uFF09\u3002"),ol=c(),D=r("p"),ai=a("\u7F16\u5199\u53E6\u4E00\u7EC4\u89C4\u5219\u3002\u4F7F\u7528\u504F\u79FB\u91CF\uFF0C\u6240\u6709\u81EA\u5B9A\u4E49\u4EE3\u7801\u90FD\u6D88\u5931\u4E86\uFF1A\u6211\u4EEC\u53EF\u4EE5\u5728\u539F\u59CB\u6587\u672C\u4E2D\u83B7\u53D6\u4ECE\u7B2C\u4E00\u4E2A\u6807\u8BB0\u5F00\u59CB\u5230\u6700\u540E\u4E00\u4E2A\u6807\u8BB0\u7ED3\u675F\u7684\u8DE8\u5EA6\u3002\u6240\u4EE5\uFF0C\u5728\u4EE4\u724C\u7684\u60C5\u51B5\u4E0B "),Ba=r("strong"),ei=a("Hu"),li=a(" , "),Fa=r("strong"),ri=a("##gging"),pi=a(" \uFF0C \u548C "),Ca=r("strong"),oi=a("Face"),ii=a(" \uFF0C\u6211\u4EEC\u5E94\u8BE5\u4ECE\u5B57\u7B26 33\uFF08\u5F00\u59CB "),za=r("strong"),ci=a("Hu"),fi=a(" ) \u5E76\u5728\u5B57\u7B26 45 \u4E4B\u524D\u7ED3\u675F\uFF08\u7ED3\u675F "),Xa=r("strong"),gi=a("Face"),ui=a(" )\uFF1A"),il=c(),d(Sn.$$.fragment),cl=c(),d(In.$$.fragment),fl=c(),L=r("p"),mi=a("\u4E3A\u4E86\u7F16\u5199\u5728\u5BF9\u5B9E\u4F53\u8FDB\u884C\u5206\u7EC4\u7684\u540C\u65F6\u5BF9\u9884\u6D4B\u8FDB\u884C\u540E\u5904\u7406\u7684\u4EE3\u7801\uFF0C\u6211\u4EEC\u5C06\u8FDE\u7EED\u5E76\u6807\u8BB0\u4E3A\u7684\u5B9E\u4F53\u5206\u7EC4\u5728\u4E00\u8D77 "),Ha=r("strong"),hi=a("I-XXX"),xi=a(" \uFF0C\u9664\u4E86\u7B2C\u4E00\u4E2A\uFF0C\u53EF\u4EE5\u6807\u8BB0\u4E3A "),Aa=r("strong"),ji=a("B-XXX"),di=a(" \u6216\u8005 "),Ma=r("strong"),_i=a("I-XXX"),bi=a(" \uFF08\u56E0\u6B64\uFF0C\u5F53\u6211\u4EEC\u5F97\u5230\u4E00\u4E2A\u5B9E\u4F53\u65F6\uFF0C\u6211\u4EEC\u505C\u6B62\u5BF9\u5B9E\u4F53\u8FDB\u884C\u5206\u7EC4 "),Da=r("strong"),$i=a("O"),ki=a(" \uFF0C\u4E00\u79CD\u65B0\u578B\u5B9E\u4F53\uFF0C\u6216 "),La=r("strong"),Ei=a("B-XXX"),vi=a(" \u8FD9\u544A\u8BC9\u6211\u4EEC\u4E00\u4E2A\u76F8\u540C\u7C7B\u578B\u7684\u5B9E\u4F53\u6B63\u5728\u542F\u52A8\uFF09\uFF1A"),gl=c(),d(Gn.$$.fragment),ul=c(),ot=r("p"),yi=a("\u6211\u4EEC\u5F97\u5230\u4E86\u4E0E\u7B2C\u4E8C\u6761\u7BA1\u9053\u76F8\u540C\u7684\u7ED3\u679C\uFF01"),ml=c(),d(Nn.$$.fragment),hl=c(),it=r("p"),wi=a("\u8FD9\u4E9B\u504F\u79FB\u91CF\u975E\u5E38\u6709\u7528\u7684\u53E6\u4E00\u4E2A\u4EFB\u52A1\u793A\u4F8B\u662F\u95EE\u7B54\u3002\u6DF1\u5165\u7814\u7A76\u8FD9\u4E2A\u7BA1\u9053\uFF0C\u6211\u4EEC\u5C06\u5728\u4E0B\u4E00\u8282\u4E2D\u8FDB\u884C\uFF0C\u4E5F\u5C06\u4F7F\u6211\u4EEC\u80FD\u591F\u4E86\u89E3 \u{1F917} Transformers \u5E93\u4E2D\u6807\u8BB0\u5668\u7684\u6700\u540E\u4E00\u4E2A\u529F\u80FD\uFF1A\u5F53\u6211\u4EEC\u5C06\u8F93\u5165\u622A\u65AD\u4E3A\u7ED9\u5B9A\u957F\u5EA6\u65F6\u5904\u7406\u6EA2\u51FA\u7684\u6807\u8BB0\u3002"),this.h()},l(s){const l=L2('[data-svelte="svelte-1phssyn"]',document.head);u=p(l,"META",{name:!0,content:!0}),l.forEach(t),j=f(s),_(g.$$.fragment,s),k=f(s),q=p(s,"H1",{id:!0});var Va=o(q);R=e(Va,"\u5FEB\u901F\u6807\u8BB0\u5668\u7684\u7279\u6B8A\u80FD\u529B"),Va.forEach(t),B=f(s),N.l(s),G=f(s),T=p(s,"P",{});var K=o(T);P=e(K,"\u5728\u672C\u8282\u4E2D\uFF0C\u6211\u4EEC\u5C06\u4ED4\u7EC6\u7814\u7A76 \u{1F917} Transformers \u4E2D\u6807\u8BB0\u5668\u7684\u529F\u80FD\u3002\u5230\u76EE\u524D\u4E3A\u6B62\uFF0C\u6211\u4EEC\u53EA\u4F7F\u7528\u5B83\u4EEC\u6765\u6807\u8BB0\u8F93\u5165\u6216\u5C06 ID \u89E3\u7801\u56DE\u6587\u672C\uFF0C\u4F46\u662F\u6807\u8BB0\u5668\u2014\u2014\u5C24\u5176\u662F\u90A3\u4E9B\u7531 \u{1F917} Tokenizers \u5E93\u652F\u6301\u7684\u2014\u2014\u53EF\u4EE5\u505A\u66F4\u591A\u7684\u4E8B\u60C5\u3002\u4E3A\u4E86\u8BF4\u660E\u8FD9\u4E9B\u9644\u52A0\u529F\u80FD\uFF0C\u6211\u4EEC\u5C06\u63A2\u7D22\u5982\u4F55\u91CD\u73B0\u7ED3\u679C "),ns=p(K,"STRONG",{});var Ya=o(ns);V=e(Ya,"token-classification"),Ya.forEach(t),cs=e(K," \uFF08\u6211\u4EEC\u79F0\u4E4B\u4E3A "),ts=p(K,"STRONG",{});var Qa=o(ts);as=e(Qa,"ner"),Qa.forEach(t),F=e(K," \uFF09 \u548C "),Y=p(K,"STRONG",{});var Ua=o(Y);C=e(Ua,"question-answering"),Ua.forEach(t),es=e(K," \u6211\u4EEC\u7B2C\u4E00\u6B21\u5728"),m=p(K,"A",{href:!0});var ct=o(m);v=e(ct,"Chapter 1"),ct.forEach(t),ys=e(K,"\u4E2D\u9047\u5230\u7684\u7BA1\u9053."),K.forEach(t),js=f(s),_(A.$$.fragment,s),ds=f(s),Ss=p(s,"P",{});var As=o(Ss);Sl=e(As,"\u5728\u63A5\u4E0B\u6765\u7684\u8BA8\u8BBA\u4E2D\uFF0C\u6211\u4EEC\u4F1A\u7ECF\u5E38\u533A\u5206\u201C\u6162\u201D\u548C\u201C\u5FEB\u201D\u5206\u8BCD\u5668\u3002\u6162\u901F\u5206\u8BCD\u5668\u662F\u5728 \u{1F917} Transformers \u5E93\u4E2D\u7528 Python \u7F16\u5199\u7684\uFF0C\u800C\u5FEB\u901F\u7248\u672C\u662F\u7531 \u{1F917} \u5206\u8BCD\u5668\u63D0\u4F9B\u7684\uFF0C\u5B83\u4EEC\u662F\u7528 Rust \u7F16\u5199\u7684\u3002\u5982\u679C\u4F60\u8FD8\u8BB0\u5F97\u5728"),Cn=p(As,"A",{href:!0});var ft=o(Cn);Il=e(ft,"Chapter 5"),ft.forEach(t),Gl=e(As,"\u4E2D\u62A5\u544A\u4E86\u5FEB\u901F\u548C\u6162\u901F\u5206\u8BCD\u5668\u5BF9\u836F\u7269\u5BA1\u67E5\u6570\u636E\u96C6\u8FDB\u884C\u5206\u8BCD\u6240\u9700\u7684\u65F6\u95F4\u7684\u8FD9\u5F20\u8868\uFF0C\u60A8\u5E94\u8BE5\u77E5\u9053\u4E3A\u4EC0\u4E48\u6211\u4EEC\u79F0\u5B83\u4EEC\u4E3A\u201C\u5FEB\u201D\u548C\u201C\u6162\u201D\uFF1A"),As.forEach(t),Ja=f(s),Is=p(s,"TABLE",{});var jl=o(Is);dt=p(jl,"THEAD",{});var Ai=o(dt);ws=p(Ai,"TR",{});var gt=o(ws);zn=p(gt,"TH",{align:!0});var Mi=o(zn);Nl=e(Mi,"Fast tokenizer"),Mi.forEach(t),Pl=f(gt),Xn=p(gt,"TH",{align:!0});var Di=o(Xn);ql=e(Di,"Slow tokenizer"),Di.forEach(t),Bl=f(gt),_t=p(gt,"TH",{align:!0}),o(_t).forEach(t),gt.forEach(t),Ai.forEach(t),Fl=f(jl),Ls=p(jl,"TBODY",{});var dl=o(Ls);Rs=p(dl,"TR",{});var ut=o(Rs);Hn=p(ut,"TD",{align:!0});var Li=o(Hn);bt=p(Li,"CODE",{});var Vi=o(bt);Cl=e(Vi,"batched=True"),Vi.forEach(t),Li.forEach(t),zl=f(ut),An=p(ut,"TD",{align:!0});var Yi=o(An);Xl=e(Yi,"10.8s"),Yi.forEach(t),Hl=f(ut),Mn=p(ut,"TD",{align:!0});var Qi=o(Mn);Al=e(Qi,"4min41s"),Qi.forEach(t),ut.forEach(t),Ml=f(dl),Os=p(dl,"TR",{});var mt=o(Os);Dn=p(mt,"TD",{align:!0});var Ui=o(Dn);$t=p(Ui,"CODE",{});var Ji=o($t);Dl=e(Ji,"batched=False"),Ji.forEach(t),Ui.forEach(t),Ll=f(mt),Ln=p(mt,"TD",{align:!0});var Ki=o(Ln);Vl=e(Ki,"59.2s"),Ki.forEach(t),Yl=f(mt),Vn=p(mt,"TD",{align:!0});var Wi=o(Vn);Ql=e(Wi,"5min3s"),Wi.forEach(t),mt.forEach(t),dl.forEach(t),jl.forEach(t),Ka=f(s),_(Gs.$$.fragment,s),Wa=f(s),Vs=p(s,"H2",{id:!0});var Zi=o(Vs);Ul=e(Zi,"\u6279\u91CF\u7F16\u7801"),Zi.forEach(t),Za=f(s),_(Ys.$$.fragment,s),se=f(s),Ns=p(s,"P",{});var _l=o(Ns);Jl=e(_l,"\u5206\u8BCD\u5668\u7684\u8F93\u51FA\u4E0D\u662F\u7B80\u5355\u7684 Python \u5B57\u5178\uFF1B\u6211\u4EEC\u5F97\u5230\u7684\u5B9E\u9645\u4E0A\u662F\u4E00\u4E2A\u7279\u6B8A\u7684 "),kt=p(_l,"STRONG",{});var sc=o(kt);Kl=e(sc,"BatchEncoding"),sc.forEach(t),Wl=e(_l," \u76EE\u7684\u3002\u5B83\u662F\u5B57\u5178\u7684\u5B50\u7C7B\uFF08\u8FD9\u5C31\u662F\u4E3A\u4EC0\u4E48\u6211\u4EEC\u4E4B\u524D\u80FD\u591F\u6BEB\u65E0\u95EE\u9898\u5730\u7D22\u5F15\u5230\u8BE5\u7ED3\u679C\u4E2D\u7684\u539F\u56E0\uFF09\uFF0C\u4F46\u5177\u6709\u4E3B\u8981\u7531\u5FEB\u901F\u6807\u8BB0\u5668\u4F7F\u7528\u7684\u9644\u52A0\u65B9\u6CD5\u3002"),_l.forEach(t),ne=f(s),Yn=p(s,"P",{});var nc=o(Yn);Zl=e(nc,"\u9664\u4E86\u5B83\u4EEC\u7684\u5E76\u884C\u5316\u80FD\u529B\u4E4B\u5916\uFF0C\u5FEB\u901F\u6807\u8BB0\u5668\u7684\u5173\u952E\u529F\u80FD\u662F\u5B83\u4EEC\u59CB\u7EC8\u8DDF\u8E2A\u6700\u7EC8\u6807\u8BB0\u6765\u81EA\u7684\u539F\u59CB\u6587\u672C\u8303\u56F4\u2014\u2014\u6211\u4EEC\u79F0\u4E4B\u4E3A\u504F\u79FB\u6620\u5C04.\u8FD9\u53CD\u8FC7\u6765\u53C8\u89E3\u9501\u4E86\u8BF8\u5982\u5C06\u6BCF\u4E2A\u5355\u8BCD\u6620\u5C04\u5230\u5B83\u751F\u6210\u7684\u6807\u8BB0\u6216\u5C06\u539F\u59CB\u6587\u672C\u7684\u6BCF\u4E2A\u5B57\u7B26\u6620\u5C04\u5230\u5B83\u5185\u90E8\u7684\u6807\u8BB0\u7B49\u529F\u80FD\uFF0C\u53CD\u4E4B\u4EA6\u7136\u3002\u8BA9\u6211\u4EEC\u770B\u4E00\u4E2A\u4F8B\u5B50\uFF1A"),nc.forEach(t),te=f(s),_(Qs.$$.fragment,s),ae=f(s),Ps=p(s,"P",{});var bl=o(Ps);sr=e(bl,"\u5982\u524D\u6240\u8FF0\uFF0C\u6211\u4EEC\u5F97\u5230\u4E00\u4E2A "),Et=p(bl,"STRONG",{});var tc=o(Et);nr=e(tc,"BatchEncoding"),tc.forEach(t),tr=e(bl," \u6807\u8BB0\u5668\u8F93\u51FA\u4E2D\u7684\u5BF9\u8C61\uFF1A"),bl.forEach(t),ee=f(s),_(Us.$$.fragment,s),le=f(s),Q=p(s,"P",{});var ks=o(Q);ar=e(ks,"\u7531\u4E8E "),vt=p(ks,"STRONG",{});var ac=o(vt);er=e(ac,"AutoTokenizer"),ac.forEach(t),lr=e(ks," \u7C7B\u9ED8\u8BA4\u9009\u62E9\u5FEB\u901F\u6807\u8BB0\u5668\uFF0C\u6211\u4EEC\u53EF\u4EE5\u4F7F\u7528\u9644\u52A0\u65B9\u6CD5 this "),yt=p(ks,"STRONG",{});var ec=o(yt);rr=e(ec,"BatchEncoding"),ec.forEach(t),pr=e(ks," \u5BF9\u8C61\u63D0\u4F9B\u3002\u6211\u4EEC\u6709\u4E24\u79CD\u65B9\u6CD5\u6765\u68C0\u67E5\u6211\u4EEC\u7684\u5206\u8BCD\u5668\u662F\u5FEB\u7684\u8FD8\u662F\u6162\u7684\u3002\u6211\u4EEC\u53EF\u4EE5\u68C0\u67E5 "),wt=p(ks,"STRONG",{});var lc=o(wt);or=e(lc,"is_fast"),lc.forEach(t),ir=e(ks," \u7684\u5C5E\u6027 "),Rt=p(ks,"STRONG",{});var rc=o(Rt);cr=e(rc,"tokenizer"),rc.forEach(t),fr=e(ks," \uFF1A"),ks.forEach(t),re=f(s),_(Js.$$.fragment,s),pe=f(s),_(Ks.$$.fragment,s),oe=f(s),qs=p(s,"P",{});var $l=o(qs);gr=e($l,"\u6216\u68C0\u67E5\u6211\u4EEC\u7684\u76F8\u540C\u5C5E\u6027 "),Ot=p($l,"STRONG",{});var pc=o(Ot);ur=e(pc,"encoding"),pc.forEach(t),mr=e($l," \uFF1A"),$l.forEach(t),ie=f(s),_(Ws.$$.fragment,s),ce=f(s),_(Zs.$$.fragment,s),fe=f(s),Qn=p(s,"P",{});var oc=o(Qn);hr=e(oc,"\u8BA9\u6211\u4EEC\u770B\u770B\u5FEB\u901F\u6807\u8BB0\u5668\u4F7F\u6211\u4EEC\u80FD\u591F\u505A\u4EC0\u4E48\u3002\u9996\u5148\uFF0C\u6211\u4EEC\u53EF\u4EE5\u8BBF\u95EE\u4EE4\u724C\u800C\u65E0\u9700\u5C06 ID \u8F6C\u6362\u56DE\u4EE4\u724C\uFF1A"),oc.forEach(t),ge=f(s),_(sn.$$.fragment,s),ue=f(s),_(nn.$$.fragment,s),me=f(s),_s=p(s,"P",{});var ht=o(_s);xr=e(ht,"\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C\u7D22\u5F15 5 \u5904\u7684\u4EE4\u724C\u662F "),Tt=p(ht,"STRONG",{});var ic=o(Tt);jr=e(ic,"##yl"),ic.forEach(t),dr=e(ht," \uFF0C\u5B83\u662F\u539F\u59CB\u53E5\u5B50\u4E2D\u201CSylvain\u201D\u4E00\u8BCD\u7684\u4E00\u90E8\u5206\u3002\u6211\u4EEC\u4E5F\u53EF\u4EE5\u4F7F\u7528 "),St=p(ht,"STRONG",{});var cc=o(St);_r=e(cc,"word_ids()"),cc.forEach(t),br=e(ht," \u83B7\u53D6\u6BCF\u4E2A\u6807\u8BB0\u6765\u81EA\u7684\u5355\u8BCD\u7D22\u5F15\u7684\u65B9\u6CD5\uFF1A"),ht.forEach(t),he=f(s),_(tn.$$.fragment,s),xe=f(s),_(an.$$.fragment,s),je=f(s),U=p(s,"P",{});var Es=o(U);$r=e(Es,"\u6211\u4EEC\u53EF\u4EE5\u770B\u5230\u5206\u8BCD\u5668\u7684\u7279\u6B8A\u6807\u8BB0 "),It=p(Es,"STRONG",{});var fc=o(It);kr=e(fc,"[CLS]"),fc.forEach(t),Er=e(Es," \u548C "),Gt=p(Es,"STRONG",{});var gc=o(Gt);vr=e(gc,"[SEP]"),gc.forEach(t),yr=e(Es," \u88AB\u6620\u5C04\u5230 "),Nt=p(Es,"STRONG",{});var uc=o(Nt);wr=e(uc,"None"),uc.forEach(t),Rr=e(Es," \uFF0C\u7136\u540E\u6BCF\u4E2A\u6807\u8BB0\u90FD\u6620\u5C04\u5230\u5B83\u8D77\u6E90\u7684\u5355\u8BCD\u3002\u8FD9\u5BF9\u4E8E\u786E\u5B9A\u4E00\u4E2A\u6807\u8BB0\u662F\u5426\u5728\u5355\u8BCD\u7684\u5F00\u5934\u6216\u4E24\u4E2A\u6807\u8BB0\u662F\u5426\u5728\u540C\u4E00\u4E2A\u5355\u8BCD\u4E2D\u7279\u522B\u6709\u7528\u3002\u6211\u4EEC\u53EF\u4EE5\u4F9D\u9760 "),Pt=p(Es,"STRONG",{});var mc=o(Pt);Or=e(mc,"##"),mc.forEach(t),Tr=e(Es," \u524D\u7F00\uFF0C\u4F46\u5B83\u4EC5\u9002\u7528\u4E8E\u7C7B\u4F3C BERT \u7684\u5206\u8BCD\u5668\uFF1B\u8FD9\u79CD\u65B9\u6CD5\u9002\u7528\u4E8E\u4EFB\u4F55\u7C7B\u578B\u7684\u6807\u8BB0\u5668\uFF0C\u53EA\u8981\u5B83\u662F\u5FEB\u901F\u7684\u3002\u5728\u4E0B\u4E00\u7AE0\u4E2D\uFF0C\u6211\u4EEC\u5C06\u770B\u5230\u5982\u4F55\u4F7F\u7528\u6B64\u529F\u80FD\u5C06\u6BCF\u4E2A\u5355\u8BCD\u7684\u6807\u7B7E\u6B63\u786E\u5E94\u7528\u4E8E\u547D\u540D\u5B9E\u4F53\u8BC6\u522B (NER) \u548C\u8BCD\u6027 (POS) \u6807\u8BB0\u7B49\u4EFB\u52A1\u4E2D\u7684\u6807\u8BB0\u3002\u6211\u4EEC\u8FD8\u53EF\u4EE5\u4F7F\u7528\u5B83\u6765\u5C4F\u853D\u6765\u81EA\u5C4F\u853D\u8BED\u8A00\u5EFA\u6A21\u4E2D\u6765\u81EA\u540C\u4E00\u5355\u8BCD\u7684\u6240\u6709\u6807\u8BB0\uFF08\u4E00\u79CD\u79F0\u4E3A\u5168\u8BCD\u63A9\u7801\uFF09\u3002"),Es.forEach(t),de=f(s),_(Bs.$$.fragment,s),_e=f(s),bs=p(s,"P",{});var xt=o(bs);Sr=e(xt,"\u540C\u6837\uFF0C\u6709\u4E00\u4E2A "),qt=p(xt,"STRONG",{});var hc=o(qt);Ir=e(hc,"sentence_ids()"),hc.forEach(t),Gr=e(xt," \u6211\u4EEC\u53EF\u4EE5\u7528\u6765\u5C06\u6807\u8BB0\u6620\u5C04\u5230\u5B83\u6765\u81EA\u7684\u53E5\u5B50\u7684\u65B9\u6CD5\uFF08\u5C3D\u7BA1\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C "),Bt=p(xt,"STRONG",{});var xc=o(Bt);Nr=e(xc,"token_type_ids"),xc.forEach(t),Pr=e(xt," \u5206\u8BCD\u5668\u8FD4\u56DE\u7684\u4FE1\u606F\u53EF\u4EE5\u4E3A\u6211\u4EEC\u63D0\u4F9B\u76F8\u540C\u7684\u4FE1\u606F\uFF09\u3002"),xt.forEach(t),be=f(s),z=p(s,"P",{});var W=o(z);qr=e(W,"\u6700\u540E\uFF0C\u6211\u4EEC\u53EF\u4EE5\u5C06\u4EFB\u4F55\u5355\u8BCD\u6216\u6807\u8BB0\u6620\u5C04\u5230\u539F\u59CB\u6587\u672C\u4E2D\u7684\u5B57\u7B26\uFF0C\u53CD\u4E4B\u4EA6\u7136\uFF0C\u901A\u8FC7 "),Ft=p(W,"STRONG",{});var jc=o(Ft);Br=e(jc,"word_to_chars()"),jc.forEach(t),Fr=e(W," \u6216\u8005 "),Ct=p(W,"STRONG",{});var dc=o(Ct);Cr=e(dc,"token_to_chars()"),dc.forEach(t),zr=e(W," \u548C "),zt=p(W,"STRONG",{});var _c=o(zt);Xr=e(_c,"char_to_word()"),_c.forEach(t),Hr=e(W," \u6216\u8005 "),Xt=p(W,"STRONG",{});var bc=o(Xt);Ar=e(bc,"char_to_token()"),bc.forEach(t),Mr=e(W," \u65B9\u6CD5\u3002\u4F8B\u5982\uFF0C "),Ht=p(W,"STRONG",{});var $c=o(Ht);Dr=e($c,"word_ids()"),$c.forEach(t),Lr=e(W," \u65B9\u6CD5\u544A\u8BC9\u6211\u4EEC "),At=p(W,"STRONG",{});var kc=o(At);Vr=e(kc,"##yl"),kc.forEach(t),Yr=e(W," \u662F\u7D22\u5F15 3 \u5904\u5355\u8BCD\u7684\u4E00\u90E8\u5206\uFF0C\u4F46\u5B83\u662F\u53E5\u5B50\u4E2D\u7684\u54EA\u4E2A\u5355\u8BCD\uFF1F\u6211\u4EEC\u53EF\u4EE5\u8FD9\u6837\u53D1\u73B0\uFF1A"),W.forEach(t),$e=f(s),_(en.$$.fragment,s),ke=f(s),_(ln.$$.fragment,s),Ee=f(s),Fs=p(s,"P",{});var kl=o(Fs);Qr=e(kl,"\u6B63\u5982\u6211\u4EEC\u4E4B\u524D\u63D0\u5230\u7684\uFF0C\u8FD9\u4E00\u5207\u90FD\u662F\u7531\u5FEB\u901F\u6807\u8BB0\u5668\u8DDF\u8E2A\u6BCF\u4E2A\u6807\u8BB0\u6765\u81EA\u5217\u8868\u4E2D\u7684\u6587\u672C\u8DE8\u5EA6\u8FD9\u4E00\u4E8B\u5B9E\u63D0\u4F9B\u652F\u6301\u7684\u62B5\u6D88.\u4E3A\u4E86\u8BF4\u660E\u5B83\u4EEC\u7684\u7528\u9014\uFF0C\u63A5\u4E0B\u6765\u6211\u4EEC\u5C06\u5411\u60A8\u5C55\u793A\u5982\u4F55\u590D\u5236\u7ED3\u679C "),Mt=p(kl,"STRONG",{});var Ec=o(Mt);Ur=e(Ec,"token-classification"),Ec.forEach(t),Jr=e(kl," \u624B\u52A8\u7BA1\u9053\u3002"),kl.forEach(t),ve=f(s),_(Cs.$$.fragment,s),ye=f(s),rn=p(s,"H2",{id:!0});var vc=o(rn);Kr=e(vc,"\u5728\u4EE4\u724C\u5206\u7C7B\u7BA1\u9053\u5185"),vc.forEach(t),we=f(s),J=p(s,"P",{});var vs=o(J);Wr=e(vs,"\u5728"),Un=p(vs,"A",{href:!0});var yc=o(Un);Zr=e(yc,"Chapter 1"),yc.forEach(t),sp=e(vs,"\u6211\u4EEC\u7B2C\u4E00\u6B21\u5C1D\u8BD5\u4F7F\u7528 NER\u2014\u2014\u4EFB\u52A1\u662F\u8BC6\u522B\u6587\u672C\u7684\u54EA\u4E9B\u90E8\u5206\u5BF9\u5E94\u4E8E\u4E2A\u4EBA\u3001\u5730\u70B9\u6216\u7EC4\u7EC7\u7B49\u5B9E\u4F53\u2014\u2014\u4F7F\u7528 \u{1F917} Transformers "),Dt=p(vs,"STRONG",{});var wc=o(Dt);np=e(wc,"pipeline()"),wc.forEach(t),tp=e(vs," \u529F\u80FD\u3002\u7136\u540E\uFF0C\u5728"),Jn=p(vs,"A",{href:!0});var Rc=o(Jn);ap=e(Rc,"Chapter 2"),Rc.forEach(t),ep=e(vs,"\uFF0C\u6211\u4EEC\u770B\u5230\u4E86\u7BA1\u9053\u5982\u4F55\u5C06\u4ECE\u539F\u59CB\u6587\u672C\u4E2D\u83B7\u53D6\u9884\u6D4B\u6240\u9700\u7684\u4E09\u4E2A\u9636\u6BB5\u7EC4\u5408\u5728\u4E00\u8D77\uFF1A\u6807\u8BB0\u5316\u3001\u901A\u8FC7\u6A21\u578B\u4F20\u9012\u8F93\u5165\u548C\u540E\u5904\u7406\u3002\u524D\u4E24\u6B65 "),Lt=p(vs,"STRONG",{});var Oc=o(Lt);lp=e(Oc,"token-classification"),Oc.forEach(t),rp=e(vs," \u7BA1\u9053\u4E0E\u4EFB\u4F55\u5176\u4ED6\u7BA1\u9053\u76F8\u540C\uFF0C\u4F46\u540E\u5904\u7406\u7A0D\u5FAE\u590D\u6742\u4E00\u4E9B - \u8BA9\u6211\u4EEC\u770B\u770B\u5982\u4F55\uFF01"),vs.forEach(t),Re=f(s),gs.l(s),Kn=f(s),pn=p(s,"H3",{id:!0});var Tc=o(pn);pp=e(Tc,"\u901A\u8FC7\u7BA1\u9053\u83B7\u5F97\u57FA\u672C\u7ED3\u679C"),Tc.forEach(t),Oe=f(s),zs=p(s,"P",{});var El=o(zs);op=e(El,"\u9996\u5148\uFF0C\u8BA9\u6211\u4EEC\u83B7\u53D6\u4E00\u4E2A\u6807\u8BB0\u5206\u7C7B\u7BA1\u9053\uFF0C\u4EE5\u4FBF\u6211\u4EEC\u53EF\u4EE5\u624B\u52A8\u6BD4\u8F83\u4E00\u4E9B\u7ED3\u679C\u3002\u9ED8\u8BA4\u4F7F\u7528\u7684\u6A21\u578B\u662F"),on=p(El,"A",{href:!0,rel:!0});var Sc=o(on);ip=e(Sc,"dbmdz/bert-large-cased-finetuned-conll03-english"),Sc.forEach(t),cp=e(El,";\u5B83\u5BF9\u53E5\u5B50\u6267\u884C NER\uFF1A"),El.forEach(t),Te=f(s),_(cn.$$.fragment,s),Se=f(s),_(fn.$$.fragment,s),Ie=f(s),Wn=p(s,"P",{});var Ic=o(Wn);fp=e(Ic,"\u8BE5\u6A21\u578B\u6B63\u786E\u5730\u5C06\u201CSylvain\u201D\u751F\u6210\u7684\u6BCF\u4E2A\u6807\u8BB0\u8BC6\u522B\u4E3A\u4E00\u4E2A\u4EBA\uFF0C\u5C06\u201CHugging Face\u201D\u751F\u6210\u7684\u6BCF\u4E2A\u6807\u8BB0\u8BC6\u522B\u4E3A\u4E00\u4E2A\u7EC4\u7EC7\uFF0C\u5C06\u201CBrooklyn\u201D\u751F\u6210\u7684\u6807\u8BB0\u8BC6\u522B\u4E3A\u4E00\u4E2A\u4F4D\u7F6E\u3002\u6211\u4EEC\u8FD8\u53EF\u4EE5\u8981\u6C42\u7BA1\u9053\u5C06\u5BF9\u5E94\u4E8E\u540C\u4E00\u5B9E\u4F53\u7684\u4EE4\u724C\u7EC4\u5408\u5728\u4E00\u8D77\uFF1A"),Ic.forEach(t),Ge=f(s),_(gn.$$.fragment,s),Ne=f(s),_(un.$$.fragment,s),Pe=f(s),M=p(s,"P",{});var ls=o(M);Vt=p(ls,"STRONG",{});var Gc=o(Vt);gp=e(Gc,"aggregation_strategy"),Gc.forEach(t),up=e(ls," \u9009\u62E9\u5C06\u66F4\u6539\u4E3A\u6BCF\u4E2A\u5206\u7EC4\u5B9E\u4F53\u8BA1\u7B97\u7684\u5206\u6570\u3002\u548C "),Yt=p(ls,"STRONG",{});var Nc=o(Yt);mp=e(Nc,"simple"),Nc.forEach(t),hp=e(ls," \u5206\u6570\u53EA\u662F\u7ED9\u5B9A\u5B9E\u4F53\u4E2D\u6BCF\u4E2A\u6807\u8BB0\u7684\u5206\u6570\u7684\u5E73\u5747\u503C\uFF1A\u4F8B\u5982\uFF0C\u201CSylvain\u201D\u7684\u5206\u6570\u662F\u6211\u4EEC\u5728\u524D\u9762\u7684\u793A\u4F8B\u4E2D\u770B\u5230\u7684\u6807\u8BB0\u5206\u6570\u7684\u5E73\u5747\u503C "),Qt=p(ls,"STRONG",{});var Pc=o(Qt);xp=e(Pc,"S"),Pc.forEach(t),jp=e(ls," , "),Ut=p(ls,"STRONG",{});var qc=o(Ut);dp=e(qc,"##yl"),qc.forEach(t),_p=e(ls," , "),Jt=p(ls,"STRONG",{});var Bc=o(Jt);bp=e(Bc,"##va"),Bc.forEach(t),$p=e(ls," \uFF0C \u548C "),Kt=p(ls,"STRONG",{});var Fc=o(Kt);kp=e(Fc,"##in"),Fc.forEach(t),Ep=e(ls," .\u5176\u4ED6\u53EF\u7528\u7684\u7B56\u7565\u662F\uFF1A"),ls.forEach(t),qe=f(s),$s=p(s,"UL",{});var jt=o($s);Wt=p(jt,"LI",{});var Cc=o(Wt);Zn=p(Cc,"P",{});var Ri=o(Zn);Zt=p(Ri,"CODE",{});var zc=o(Zt);vp=e(zc,'"first"'),zc.forEach(t),yp=e(Ri,", \u5176\u4E2D\u6BCF\u4E2A\u5B9E\u4F53\u7684\u5206\u6570\u662F\u8BE5\u5B9E\u4F53\u7684\u7B2C\u4E00\u4E2A\u6807\u8BB0\u7684\u5206\u6570\uFF08\u56E0\u6B64\u5BF9\u4E8E\u201CSylvain\u201D\uFF0C\u5B83\u5C06\u662F 0.993828\uFF0C\u6807\u8BB0\u7684\u5206\u6570)"),Ri.forEach(t),Cc.forEach(t),wp=f(jt),sa=p(jt,"LI",{});var Xc=o(sa);st=p(Xc,"P",{});var Oi=o(st);na=p(Oi,"CODE",{});var Hc=o(na);Rp=e(Hc,'"max"'),Hc.forEach(t),Op=e(Oi,",\u5176\u4E2D\u6BCF\u4E2A\u5B9E\u4F53\u7684\u5206\u6570\u662F\u8BE5\u5B9E\u4F53\u4E2D\u6807\u8BB0\u7684\u6700\u5927\u5206\u6570\uFF08\u56E0\u6B64\u5BF9\u4E8E\u201CHugging Face\u201D\uFF0C\u5B83\u5C06\u662F 0.98879766\uFF0C\u5373\u201CFace\u201D\u7684\u5206\u6570\uFF09"),Oi.forEach(t),Xc.forEach(t),Tp=f(jt),ta=p(jt,"LI",{});var Ac=o(ta);nt=p(Ac,"P",{});var Ti=o(nt);aa=p(Ti,"CODE",{});var Mc=o(aa);Sp=e(Mc,'"average"'),Mc.forEach(t),Ip=e(Ti,", \u5176\u4E2D\u6BCF\u4E2A\u5B9E\u4F53\u7684\u5206\u6570\u662F\u7EC4\u6210\u8BE5\u5B9E\u4F53\u7684\u5355\u8BCD\u5206\u6570\u7684\u5E73\u5747\u503C\uFF08\u56E0\u6B64\u5BF9\u4E8E\u201CSylvain\u201D\uFF0C\u4E0E\u201Csimple\u201D\u7B56\u7565\uFF0C\u4F46\u201CHugging Face\u201D\u7684\u5F97\u5206\u4E3A 0.9819\uFF0C\u201CHugging\u201D\u5F97\u5206\u7684\u5E73\u5747\u503C\u4E3A 0.975\uFF0C\u201CFace\u201D\u5F97\u5206\u4E3A 0.98879\uFF09"),Ti.forEach(t),Ac.forEach(t),jt.forEach(t),Be=f(s),tt=p(s,"P",{});var Dc=o(tt);Gp=e(Dc,"\u73B0\u5728\u8BA9\u6211\u4EEC\u770B\u770B\u5982\u4F55\u5728\u4E0D\u4F7F\u7528pipeline\uFF08\uFF09\u51FD\u6570\u7684\u60C5\u51B5\u4E0B\u83B7\u5F97\u8FD9\u4E9B\u7ED3\u679C\uFF01"),Dc.forEach(t),Fe=f(s),mn=p(s,"H3",{id:!0});var Lc=o(mn);Np=e(Lc,"\u4ECE\u8F93\u5165\u5230\u9884\u6D4B"),Lc.forEach(t),Ce=f(s),ms.l(s),at=f(s),et=p(s,"P",{});var Vc=o(et);Pp=e(Vc,"\u6211\u4EEC\u6709\u4E00\u4E2A\u5305\u542B 19 \u4E2A\u6807\u8BB0\u7684 1 \u4E2A\u5E8F\u5217\u7684\u6279\u6B21\uFF0C\u6A21\u578B\u6709 9 \u4E2A\u4E0D\u540C\u7684\u6807\u7B7E\uFF0C\u56E0\u6B64\u6A21\u578B\u7684\u8F93\u51FA\u5177\u6709 1 x 19 x 9 \u7684\u5F62\u72B6\u3002\u4E0E\u6587\u672C\u5206\u7C7B\u7BA1\u9053\u4E00\u6837\uFF0C\u6211\u4EEC\u4F7F\u7528 softmax \u51FD\u6570\u6765\u8F6C\u6362\u8FD9\u4E9B logits\u5230\u6982\u7387\uFF0C\u6211\u4EEC\u91C7\u7528 argmax \u6765\u83B7\u5F97\u9884\u6D4B\uFF08\u8BF7\u6CE8\u610F\uFF0C\u6211\u4EEC\u53EF\u4EE5\u5728 logits \u4E0A\u91C7\u7528 argmax\uFF0C\u56E0\u4E3A softmax \u4E0D\u4F1A\u6539\u53D8\u987A\u5E8F\uFF09\uFF1A"),Vc.forEach(t),ze=f(s),xs.l(s),lt=f(s),_(hn.$$.fragment,s),Xe=f(s),xn=p(s,"P",{});var Si=o(xn);ea=p(Si,"STRONG",{});var Yc=o(ea);qp=e(Yc,"model.config.id2label"),Yc.forEach(t),Bp=e(Si," \u5C5E\u6027\u5305\u542B\u7D22\u5F15\u5230\u6807\u7B7E\u7684\u6620\u5C04\uFF0C\u6211\u4EEC\u53EF\u4EE5\u7528\u5B83\u6765\u7406\u89E3\u9884\u6D4B\uFF1A"),Si.forEach(t),He=f(s),_(jn.$$.fragment,s),Ae=f(s),_(dn.$$.fragment,s),Me=f(s),w=p(s,"P",{});var S=o(w);Fp=e(S,"\u6B63\u5982\u6211\u4EEC\u4E4B\u524D\u770B\u5230\u7684\uFF0C\u6709 9 \u4E2A\u6807\u7B7E\uFF1A "),la=p(S,"STRONG",{});var Qc=o(la);Cp=e(Qc,"O"),Qc.forEach(t),zp=e(S," \u662F\u4E0D\u5728\u4EFB\u4F55\u547D\u540D\u5B9E\u4F53\u4E2D\u7684\u6807\u8BB0\u7684\u6807\u7B7E\uFF08\u5B83\u4EE3\u8868\u201C\u5916\u90E8\u201D\uFF09\uFF0C\u7136\u540E\u6211\u4EEC\u4E3A\u6BCF\u79CD\u7C7B\u578B\u7684\u5B9E\u4F53\uFF08\u6742\u9879\u3001\u4EBA\u5458\u3001\u7EC4\u7EC7\u548C\u4F4D\u7F6E\uFF09\u63D0\u4F9B\u4E24\u4E2A\u6807\u7B7E\u3002\u6807\u7B7E "),ra=p(S,"STRONG",{});var Uc=o(ra);Xp=e(Uc,"B-XXX"),Uc.forEach(t),Hp=e(S," \u8868\u793A\u4EE4\u724C\u5728\u5B9E\u4F53\u7684\u5F00\u5934 "),pa=p(S,"STRONG",{});var Jc=o(pa);Ap=e(Jc,"XXX"),Jc.forEach(t),Mp=e(S," \u548C\u6807\u7B7E "),oa=p(S,"STRONG",{});var Kc=o(oa);Dp=e(Kc,"I-XXX"),Kc.forEach(t),Lp=e(S," \u8868\u793A\u4EE4\u724C\u5728\u5B9E\u4F53\u5185 "),ia=p(S,"STRONG",{});var Wc=o(ia);Vp=e(Wc,"XXX"),Wc.forEach(t),Yp=e(S," .\u4F8B\u5982\uFF0C\u5728\u5F53\u524D\u793A\u4F8B\u4E2D\uFF0C\u6211\u4EEC\u5E0C\u671B\u6211\u4EEC\u7684\u6A21\u578B\u5BF9\u4EE4\u724C\u8FDB\u884C\u5206\u7C7B "),ca=p(S,"STRONG",{});var Zc=o(ca);Qp=e(Zc,"S"),Zc.forEach(t),Up=e(S," \u4F5C\u4E3A "),fa=p(S,"STRONG",{});var s2=o(fa);Jp=e(s2,"B-PER"),s2.forEach(t),Kp=e(S," \uFF08\u4E00\u4E2A\u4EBA\u5B9E\u4F53\u7684\u5F00\u59CB\uFF09\u548C\u4EE4\u724C "),ga=p(S,"STRONG",{});var n2=o(ga);Wp=e(n2,"##yl"),n2.forEach(t),Zp=e(S," , "),ua=p(S,"STRONG",{});var t2=o(ua);so=e(t2,"##va"),t2.forEach(t),no=e(S," \u548C "),ma=p(S,"STRONG",{});var a2=o(ma);to=e(a2,"##in"),a2.forEach(t),ao=e(S," \u4F5C\u4E3A "),ha=p(S,"STRONG",{});var e2=o(ha);eo=e(e2,"I-PER"),e2.forEach(t),lo=e(S," \uFF08\u5728\u4E2A\u4EBA\u5B9E\u4F53\u5185\uFF09"),S.forEach(t),De=f(s),X=p(s,"P",{});var Z=o(X);ro=e(Z,"\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C\u60A8\u53EF\u80FD\u8BA4\u4E3A\u6A21\u578B\u662F\u9519\u8BEF\u7684\uFF0C\u56E0\u4E3A\u5B83\u7ED9\u51FA\u4E86\u6807\u7B7E "),xa=p(Z,"STRONG",{});var l2=o(xa);po=e(l2,"I-PER"),l2.forEach(t),oo=e(Z," \u5BF9\u6240\u6709\u8FD9\u56DB\u4E2A\u4EE4\u724C\uFF0C\u4F46\u8FD9\u5E76\u4E0D\u5B8C\u5168\u6B63\u786E\u3002\u5B9E\u9645\u4E0A\u6709\u4E24\u79CD\u683C\u5F0F "),ja=p(Z,"STRONG",{});var r2=o(ja);io=e(r2,"B-"),r2.forEach(t),co=e(Z," \u548C "),da=p(Z,"STRONG",{});var p2=o(da);fo=e(p2,"I-"),p2.forEach(t),go=e(Z," \u6807\u7B7E\uFF1AIOB1\u548CIOB2. IOB2 \u683C\u5F0F\uFF08\u4E0B\u9762\u7C89\u7EA2\u8272\uFF09\u662F\u6211\u4EEC\u4ECB\u7ECD\u7684\u683C\u5F0F\uFF0C\u800C\u5728 IOB1 \u683C\u5F0F\uFF08\u84DD\u8272\uFF09\u4E2D\uFF0C\u6807\u7B7E\u4EE5 "),_a=p(Z,"STRONG",{});var o2=o(_a);uo=e(o2,"B-"),o2.forEach(t),mo=e(Z," \u4EC5\u7528\u4E8E\u5206\u9694\u76F8\u540C\u7C7B\u578B\u7684\u4E24\u4E2A\u76F8\u90BB\u5B9E\u4F53\u3002\u6211\u4EEC\u4F7F\u7528\u7684\u6A21\u578B\u5728\u4F7F\u7528\u8BE5\u683C\u5F0F\u7684\u6570\u636E\u96C6\u4E0A\u8FDB\u884C\u4E86\u5FAE\u8C03\uFF0C\u8FD9\u5C31\u662F\u5B83\u5206\u914D\u6807\u7B7E\u7684\u539F\u56E0 "),ba=p(Z,"STRONG",{});var i2=o(ba);ho=e(i2,"I-PER"),i2.forEach(t),xo=e(Z," \u5230 "),$a=p(Z,"STRONG",{});var c2=o($a);jo=e(c2,"S"),c2.forEach(t),_o=e(Z," \u4EE4\u724C\u3002"),Z.forEach(t),Le=f(s),Ts=p(s,"DIV",{class:!0});var vl=o(Ts);_n=p(vl,"IMG",{class:!0,src:!0,alt:!0}),bo=f(vl),bn=p(vl,"IMG",{class:!0,src:!0,alt:!0}),vl.forEach(t),Ve=f(s),Xs=p(s,"P",{});var yl=o(Xs);$o=e(yl,"\u4E86\u8FD9\u5F20\u5730\u56FE\uFF0C\u6211\u4EEC\u5DF2\u7ECF\u51C6\u5907\u597D\uFF08\u51E0\u4E4E\u5B8C\u5168\uFF09\u91CD\u73B0\u7B2C\u4E00\u4E2A\u7BA1\u9053\u7684\u7ED3\u679C\u2014\u2014\u6211\u4EEC\u53EF\u4EE5\u83B7\u53D6\u6BCF\u4E2A\u672A\u88AB\u5F52\u7C7B\u4E3A\u7684\u6807\u8BB0\u7684\u5206\u6570\u548C\u6807\u7B7E "),ka=p(yl,"STRONG",{});var f2=o(ka);ko=e(f2,"O"),f2.forEach(t),Eo=e(yl," \uFF1A"),yl.forEach(t),Ye=f(s),_($n.$$.fragment,s),Qe=f(s),_(kn.$$.fragment,s),Ue=f(s),rs=p(s,"P",{});var Ms=o(rs);vo=e(Ms,"\u8FD9\u4E0E\u6211\u4EEC\u4E4B\u524D\u7684\u60C5\u51B5\u975E\u5E38\u76F8\u4F3C\uFF0C\u53EA\u6709\u4E00\u4E2A\u4F8B\u5916\uFF1A\u7BA1\u9053\u8FD8\u4E3A\u6211\u4EEC\u63D0\u4F9B\u4E86\u6709\u5173 "),Ea=p(Ms,"STRONG",{});var g2=o(Ea);yo=e(g2,"start"),g2.forEach(t),wo=e(Ms," \u548C "),va=p(Ms,"STRONG",{});var u2=o(va);Ro=e(u2,"end"),u2.forEach(t),Oo=e(Ms," \u539F\u59CB\u53E5\u5B50\u4E2D\u7684\u6BCF\u4E2A\u5B9E\u4F53\u3002\u8FD9\u662F\u6211\u4EEC\u7684\u504F\u79FB\u6620\u5C04\u5C06\u53D1\u6325\u4F5C\u7528\u7684\u5730\u65B9\u3002\u8981\u83B7\u5F97\u504F\u79FB\u91CF\uFF0C\u6211\u4EEC\u53EA\u9700\u8981\u8BBE\u7F6E "),ya=p(Ms,"STRONG",{});var m2=o(ya);To=e(m2,"return_offsets_mapping=True"),m2.forEach(t),So=e(Ms," \u5F53\u6211\u4EEC\u5C06\u5206\u8BCD\u5668\u5E94\u7528\u4E8E\u6211\u4EEC\u7684\u8F93\u5165\u65F6\uFF1A"),Ms.forEach(t),Je=f(s),_(En.$$.fragment,s),Ke=f(s),_(vn.$$.fragment,s),We=f(s),ps=p(s,"P",{});var Ds=o(ps);Io=e(Ds,"\u6BCF\u4E2A\u5143\u7EC4\u662F\u5BF9\u5E94\u4E8E\u6BCF\u4E2A\u6807\u8BB0\u7684\u6587\u672C\u8DE8\u5EA6\uFF0C\u5176\u4E2D "),wa=p(Ds,"STRONG",{});var h2=o(wa);Go=e(h2,"(0, 0)"),h2.forEach(t),No=e(Ds," \u4FDD\u7559\u7528\u4E8E\u7279\u6B8A\u4EE4\u724C\u3002\u6211\u4EEC\u4E4B\u524D\u770B\u5230\u7D22\u5F15 5 \u5904\u7684\u4EE4\u724C\u662F "),Ra=p(Ds,"STRONG",{});var x2=o(Ra);Po=e(x2,"##yl"),x2.forEach(t),qo=e(Ds," \uFF0C \u5176\u4E2D\u6709 "),Oa=p(Ds,"STRONG",{});var j2=o(Oa);Bo=e(j2,"(12, 14)"),j2.forEach(t),Fo=e(Ds," \u4F5C\u4E3A\u8FD9\u91CC\u7684\u62B5\u6D88\u3002\u5982\u679C\u6211\u4EEC\u5728\u793A\u4F8B\u4E2D\u6293\u53D6\u76F8\u5E94\u7684\u5207\u7247\uFF1A"),Ds.forEach(t),Ze=f(s),_(yn.$$.fragment,s),sl=f(s),Hs=p(s,"P",{});var wl=o(Hs);Co=e(wl,"\u6211\u4EEC\u5F97\u5230\u4E86\u6B63\u786E\u7684\u6587\u672C\u8DE8\u5EA6\uFF0C\u800C\u6CA1\u6709 "),Ta=p(wl,"STRONG",{});var d2=o(Ta);zo=e(d2,"##"),d2.forEach(t),Xo=e(wl," \uFF1A"),wl.forEach(t),nl=f(s),_(wn.$$.fragment,s),tl=f(s),rt=p(s,"P",{});var _2=o(rt);Ho=e(_2,"\u4F7F\u7528\u8FD9\u4E2A\uFF0C\u6211\u4EEC\u73B0\u5728\u53EF\u4EE5\u5B8C\u6210\u4E4B\u524D\u7684\u7ED3\u679C\uFF1A"),_2.forEach(t),al=f(s),_(Rn.$$.fragment,s),el=f(s),_(On.$$.fragment,s),ll=f(s),pt=p(s,"P",{});var b2=o(pt);Ao=e(b2,"\u8FD9\u548C\u6211\u4EEC\u4ECE\u7B2C\u4E00\u4E2A\u7BA1\u9053\u4E2D\u5F97\u5230\u7684\u4E00\u6837\uFF01"),b2.forEach(t),rl=f(s),Tn=p(s,"H3",{id:!0});var $2=o(Tn);Mo=e($2,"\u5206\u7EC4\u5B9E\u4F53"),$2.forEach(t),pl=f(s),H=p(s,"P",{});var ss=o(H);Do=e(ss,"\u4F7F\u7528\u504F\u79FB\u91CF\u6765\u786E\u5B9A\u6BCF\u4E2A\u5B9E\u4F53\u7684\u5F00\u59CB\u548C\u7ED3\u675F\u952E\u5F88\u65B9\u4FBF\uFF0C\u4F46\u8BE5\u4FE1\u606F\u5E76\u4E0D\u662F\u7EDD\u5BF9\u5FC5\u8981\u7684\u3002\u7136\u800C\uFF0C\u5F53\u6211\u4EEC\u60F3\u8981\u5C06\u5B9E\u4F53\u7EC4\u5408\u5728\u4E00\u8D77\u65F6\uFF0C\u504F\u79FB\u91CF\u5C06\u4E3A\u6211\u4EEC\u8282\u7701\u5927\u91CF\u6DF7\u4E71\u7684\u4EE3\u7801\u3002\u4F8B\u5982\uFF0C\u5982\u679C\u6211\u4EEC\u60F3\u5C06\u4EE4\u724C\u7EC4\u5408\u5728\u4E00\u8D77 "),Sa=p(ss,"STRONG",{});var k2=o(Sa);Lo=e(k2,"Hu"),k2.forEach(t),Vo=e(ss," , "),Ia=p(ss,"STRONG",{});var E2=o(Ia);Yo=e(E2,"##gging"),E2.forEach(t),Qo=e(ss," \uFF0C \u548C "),Ga=p(ss,"STRONG",{});var v2=o(Ga);Uo=e(v2,"Face"),v2.forEach(t),Jo=e(ss," \uFF0C\u6211\u4EEC\u53EF\u4EE5\u5236\u5B9A\u7279\u6B8A\u7684\u89C4\u5219\uFF0C\u8BF4\u524D\u4E24\u4E2A\u5E94\u8BE5\u9644\u52A0\uFF0C\u540C\u65F6\u5220\u9664 "),Na=p(ss,"STRONG",{});var y2=o(Na);Ko=e(y2,"##"),y2.forEach(t),Wo=e(ss," \uFF0C\u4EE5\u53CA "),Pa=p(ss,"STRONG",{});var w2=o(Pa);Zo=e(w2,"Face"),w2.forEach(t),si=e(ss," \u5E94\u8BE5\u6DFB\u52A0\u4E00\u4E2A\u7A7A\u683C\uFF0C\u56E0\u4E3A\u5B83\u4E0D\u4EE5 "),qa=p(ss,"STRONG",{});var R2=o(qa);ni=e(R2,"##"),R2.forEach(t),ti=e(ss," \u2014 \u4F46\u8FD9\u4EC5\u9002\u7528\u4E8E\u8FD9\u79CD\u7279\u5B9A\u7C7B\u578B\u7684\u6807\u8BB0\u5668\u3002\u6211\u4EEC\u5FC5\u987B\u4E3A SentencePiece \u6216 Byte-Pair-Encoding \u5206\u8BCD\u5668\uFF08\u672C\u7AE0\u7A0D\u540E\u8BA8\u8BBA\uFF09\u3002"),ss.forEach(t),ol=f(s),D=p(s,"P",{});var os=o(D);ai=e(os,"\u7F16\u5199\u53E6\u4E00\u7EC4\u89C4\u5219\u3002\u4F7F\u7528\u504F\u79FB\u91CF\uFF0C\u6240\u6709\u81EA\u5B9A\u4E49\u4EE3\u7801\u90FD\u6D88\u5931\u4E86\uFF1A\u6211\u4EEC\u53EF\u4EE5\u5728\u539F\u59CB\u6587\u672C\u4E2D\u83B7\u53D6\u4ECE\u7B2C\u4E00\u4E2A\u6807\u8BB0\u5F00\u59CB\u5230\u6700\u540E\u4E00\u4E2A\u6807\u8BB0\u7ED3\u675F\u7684\u8DE8\u5EA6\u3002\u6240\u4EE5\uFF0C\u5728\u4EE4\u724C\u7684\u60C5\u51B5\u4E0B "),Ba=p(os,"STRONG",{});var O2=o(Ba);ei=e(O2,"Hu"),O2.forEach(t),li=e(os," , "),Fa=p(os,"STRONG",{});var T2=o(Fa);ri=e(T2,"##gging"),T2.forEach(t),pi=e(os," \uFF0C \u548C "),Ca=p(os,"STRONG",{});var S2=o(Ca);oi=e(S2,"Face"),S2.forEach(t),ii=e(os," \uFF0C\u6211\u4EEC\u5E94\u8BE5\u4ECE\u5B57\u7B26 33\uFF08\u5F00\u59CB "),za=p(os,"STRONG",{});var I2=o(za);ci=e(I2,"Hu"),I2.forEach(t),fi=e(os," ) \u5E76\u5728\u5B57\u7B26 45 \u4E4B\u524D\u7ED3\u675F\uFF08\u7ED3\u675F "),Xa=p(os,"STRONG",{});var G2=o(Xa);gi=e(G2,"Face"),G2.forEach(t),ui=e(os," )\uFF1A"),os.forEach(t),il=f(s),_(Sn.$$.fragment,s),cl=f(s),_(In.$$.fragment,s),fl=f(s),L=p(s,"P",{});var is=o(L);mi=e(is,"\u4E3A\u4E86\u7F16\u5199\u5728\u5BF9\u5B9E\u4F53\u8FDB\u884C\u5206\u7EC4\u7684\u540C\u65F6\u5BF9\u9884\u6D4B\u8FDB\u884C\u540E\u5904\u7406\u7684\u4EE3\u7801\uFF0C\u6211\u4EEC\u5C06\u8FDE\u7EED\u5E76\u6807\u8BB0\u4E3A\u7684\u5B9E\u4F53\u5206\u7EC4\u5728\u4E00\u8D77 "),Ha=p(is,"STRONG",{});var N2=o(Ha);hi=e(N2,"I-XXX"),N2.forEach(t),xi=e(is," \uFF0C\u9664\u4E86\u7B2C\u4E00\u4E2A\uFF0C\u53EF\u4EE5\u6807\u8BB0\u4E3A "),Aa=p(is,"STRONG",{});var P2=o(Aa);ji=e(P2,"B-XXX"),P2.forEach(t),di=e(is," \u6216\u8005 "),Ma=p(is,"STRONG",{});var q2=o(Ma);_i=e(q2,"I-XXX"),q2.forEach(t),bi=e(is," \uFF08\u56E0\u6B64\uFF0C\u5F53\u6211\u4EEC\u5F97\u5230\u4E00\u4E2A\u5B9E\u4F53\u65F6\uFF0C\u6211\u4EEC\u505C\u6B62\u5BF9\u5B9E\u4F53\u8FDB\u884C\u5206\u7EC4 "),Da=p(is,"STRONG",{});var B2=o(Da);$i=e(B2,"O"),B2.forEach(t),ki=e(is," \uFF0C\u4E00\u79CD\u65B0\u578B\u5B9E\u4F53\uFF0C\u6216 "),La=p(is,"STRONG",{});var F2=o(La);Ei=e(F2,"B-XXX"),F2.forEach(t),vi=e(is," \u8FD9\u544A\u8BC9\u6211\u4EEC\u4E00\u4E2A\u76F8\u540C\u7C7B\u578B\u7684\u5B9E\u4F53\u6B63\u5728\u542F\u52A8\uFF09\uFF1A"),is.forEach(t),gl=f(s),_(Gn.$$.fragment,s),ul=f(s),ot=p(s,"P",{});var C2=o(ot);yi=e(C2,"\u6211\u4EEC\u5F97\u5230\u4E86\u4E0E\u7B2C\u4E8C\u6761\u7BA1\u9053\u76F8\u540C\u7684\u7ED3\u679C\uFF01"),C2.forEach(t),ml=f(s),_(Nn.$$.fragment,s),hl=f(s),it=p(s,"P",{});var z2=o(it);wi=e(z2,"\u8FD9\u4E9B\u504F\u79FB\u91CF\u975E\u5E38\u6709\u7528\u7684\u53E6\u4E00\u4E2A\u4EFB\u52A1\u793A\u4F8B\u662F\u95EE\u7B54\u3002\u6DF1\u5165\u7814\u7A76\u8FD9\u4E2A\u7BA1\u9053\uFF0C\u6211\u4EEC\u5C06\u5728\u4E0B\u4E00\u8282\u4E2D\u8FDB\u884C\uFF0C\u4E5F\u5C06\u4F7F\u6211\u4EEC\u80FD\u591F\u4E86\u89E3 \u{1F917} Transformers \u5E93\u4E2D\u6807\u8BB0\u5668\u7684\u6700\u540E\u4E00\u4E2A\u529F\u80FD\uFF1A\u5F53\u6211\u4EEC\u5C06\u8F93\u5165\u622A\u65AD\u4E3A\u7ED9\u5B9A\u957F\u5EA6\u65F6\u5904\u7406\u6EA2\u51FA\u7684\u6807\u8BB0\u3002"),z2.forEach(t),this.h()},h(){y(u,"name","hf:doc:metadata"),y(u,"content",JSON.stringify(rf)),y(q,"id",""),y(m,"href","/course/chapter1"),y(Cn,"href","/course/chapter5/3"),y(zn,"align","center"),y(Xn,"align","center"),y(_t,"align","center"),y(Hn,"align","center"),y(An,"align","center"),y(Mn,"align","center"),y(Dn,"align","center"),y(Ln,"align","center"),y(Vn,"align","center"),y(Vs,"id",""),y(rn,"id",""),y(Un,"href","/course/chapter1"),y(Jn,"href","/course/chapter2"),y(pn,"id",""),y(on,"href","https://huggingface.co/dbmdz/bert-large-cased-finetuned-conll03-english"),y(on,"rel","nofollow"),y(mn,"id",""),y(_n,"class","block dark:hidden"),X2(_n.src,Gi="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter6/IOB_versions.svg")||y(_n,"src",Gi),y(_n,"alt","IOB1 vs IOB2 format"),y(bn,"class","hidden dark:block"),X2(bn.src,Ni="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter6/IOB_versions-dark.svg")||y(bn,"src",Ni),y(bn,"alt","IOB1 vs IOB2 format"),y(Ts,"class","flex justify-center"),y(Tn,"id","")},m(s,l){n(document.head,u),i(s,j,l),b(g,s,l),i(s,k,l),i(s,q,l),n(q,R),i(s,B,l),Pn[I].m(s,l),i(s,G,l),i(s,T,l),n(T,P),n(T,ns),n(ns,V),n(T,cs),n(T,ts),n(ts,as),n(T,F),n(T,Y),n(Y,C),n(T,es),n(T,m),n(m,v),n(T,ys),i(s,js,l),b(A,s,l),i(s,ds,l),i(s,Ss,l),n(Ss,Sl),n(Ss,Cn),n(Cn,Il),n(Ss,Gl),i(s,Ja,l),i(s,Is,l),n(Is,dt),n(dt,ws),n(ws,zn),n(zn,Nl),n(ws,Pl),n(ws,Xn),n(Xn,ql),n(ws,Bl),n(ws,_t),n(Is,Fl),n(Is,Ls),n(Ls,Rs),n(Rs,Hn),n(Hn,bt),n(bt,Cl),n(Rs,zl),n(Rs,An),n(An,Xl),n(Rs,Hl),n(Rs,Mn),n(Mn,Al),n(Ls,Ml),n(Ls,Os),n(Os,Dn),n(Dn,$t),n($t,Dl),n(Os,Ll),n(Os,Ln),n(Ln,Vl),n(Os,Yl),n(Os,Vn),n(Vn,Ql),i(s,Ka,l),b(Gs,s,l),i(s,Wa,l),i(s,Vs,l),n(Vs,Ul),i(s,Za,l),b(Ys,s,l),i(s,se,l),i(s,Ns,l),n(Ns,Jl),n(Ns,kt),n(kt,Kl),n(Ns,Wl),i(s,ne,l),i(s,Yn,l),n(Yn,Zl),i(s,te,l),b(Qs,s,l),i(s,ae,l),i(s,Ps,l),n(Ps,sr),n(Ps,Et),n(Et,nr),n(Ps,tr),i(s,ee,l),b(Us,s,l),i(s,le,l),i(s,Q,l),n(Q,ar),n(Q,vt),n(vt,er),n(Q,lr),n(Q,yt),n(yt,rr),n(Q,pr),n(Q,wt),n(wt,or),n(Q,ir),n(Q,Rt),n(Rt,cr),n(Q,fr),i(s,re,l),b(Js,s,l),i(s,pe,l),b(Ks,s,l),i(s,oe,l),i(s,qs,l),n(qs,gr),n(qs,Ot),n(Ot,ur),n(qs,mr),i(s,ie,l),b(Ws,s,l),i(s,ce,l),b(Zs,s,l),i(s,fe,l),i(s,Qn,l),n(Qn,hr),i(s,ge,l),b(sn,s,l),i(s,ue,l),b(nn,s,l),i(s,me,l),i(s,_s,l),n(_s,xr),n(_s,Tt),n(Tt,jr),n(_s,dr),n(_s,St),n(St,_r),n(_s,br),i(s,he,l),b(tn,s,l),i(s,xe,l),b(an,s,l),i(s,je,l),i(s,U,l),n(U,$r),n(U,It),n(It,kr),n(U,Er),n(U,Gt),n(Gt,vr),n(U,yr),n(U,Nt),n(Nt,wr),n(U,Rr),n(U,Pt),n(Pt,Or),n(U,Tr),i(s,de,l),b(Bs,s,l),i(s,_e,l),i(s,bs,l),n(bs,Sr),n(bs,qt),n(qt,Ir),n(bs,Gr),n(bs,Bt),n(Bt,Nr),n(bs,Pr),i(s,be,l),i(s,z,l),n(z,qr),n(z,Ft),n(Ft,Br),n(z,Fr),n(z,Ct),n(Ct,Cr),n(z,zr),n(z,zt),n(zt,Xr),n(z,Hr),n(z,Xt),n(Xt,Ar),n(z,Mr),n(z,Ht),n(Ht,Dr),n(z,Lr),n(z,At),n(At,Vr),n(z,Yr),i(s,$e,l),b(en,s,l),i(s,ke,l),b(ln,s,l),i(s,Ee,l),i(s,Fs,l),n(Fs,Qr),n(Fs,Mt),n(Mt,Ur),n(Fs,Jr),i(s,ve,l),b(Cs,s,l),i(s,ye,l),i(s,rn,l),n(rn,Kr),i(s,we,l),i(s,J,l),n(J,Wr),n(J,Un),n(Un,Zr),n(J,sp),n(J,Dt),n(Dt,np),n(J,tp),n(J,Jn),n(Jn,ap),n(J,ep),n(J,Lt),n(Lt,lp),n(J,rp),i(s,Re,l),qn[fs].m(s,l),i(s,Kn,l),i(s,pn,l),n(pn,pp),i(s,Oe,l),i(s,zs,l),n(zs,op),n(zs,on),n(on,ip),n(zs,cp),i(s,Te,l),b(cn,s,l),i(s,Se,l),b(fn,s,l),i(s,Ie,l),i(s,Wn,l),n(Wn,fp),i(s,Ge,l),b(gn,s,l),i(s,Ne,l),b(un,s,l),i(s,Pe,l),i(s,M,l),n(M,Vt),n(Vt,gp),n(M,up),n(M,Yt),n(Yt,mp),n(M,hp),n(M,Qt),n(Qt,xp),n(M,jp),n(M,Ut),n(Ut,dp),n(M,_p),n(M,Jt),n(Jt,bp),n(M,$p),n(M,Kt),n(Kt,kp),n(M,Ep),i(s,qe,l),i(s,$s,l),n($s,Wt),n(Wt,Zn),n(Zn,Zt),n(Zt,vp),n(Zn,yp),n($s,wp),n($s,sa),n(sa,st),n(st,na),n(na,Rp),n(st,Op),n($s,Tp),n($s,ta),n(ta,nt),n(nt,aa),n(aa,Sp),n(nt,Ip),i(s,Be,l),i(s,tt,l),n(tt,Gp),i(s,Fe,l),i(s,mn,l),n(mn,Np),i(s,Ce,l),Bn[us].m(s,l),i(s,at,l),i(s,et,l),n(et,Pp),i(s,ze,l),Fn[hs].m(s,l),i(s,lt,l),b(hn,s,l),i(s,Xe,l),i(s,xn,l),n(xn,ea),n(ea,qp),n(xn,Bp),i(s,He,l),b(jn,s,l),i(s,Ae,l),b(dn,s,l),i(s,Me,l),i(s,w,l),n(w,Fp),n(w,la),n(la,Cp),n(w,zp),n(w,ra),n(ra,Xp),n(w,Hp),n(w,pa),n(pa,Ap),n(w,Mp),n(w,oa),n(oa,Dp),n(w,Lp),n(w,ia),n(ia,Vp),n(w,Yp),n(w,ca),n(ca,Qp),n(w,Up),n(w,fa),n(fa,Jp),n(w,Kp),n(w,ga),n(ga,Wp),n(w,Zp),n(w,ua),n(ua,so),n(w,no),n(w,ma),n(ma,to),n(w,ao),n(w,ha),n(ha,eo),n(w,lo),i(s,De,l),i(s,X,l),n(X,ro),n(X,xa),n(xa,po),n(X,oo),n(X,ja),n(ja,io),n(X,co),n(X,da),n(da,fo),n(X,go),n(X,_a),n(_a,uo),n(X,mo),n(X,ba),n(ba,ho),n(X,xo),n(X,$a),n($a,jo),n(X,_o),i(s,Le,l),i(s,Ts,l),n(Ts,_n),n(Ts,bo),n(Ts,bn),i(s,Ve,l),i(s,Xs,l),n(Xs,$o),n(Xs,ka),n(ka,ko),n(Xs,Eo),i(s,Ye,l),b($n,s,l),i(s,Qe,l),b(kn,s,l),i(s,Ue,l),i(s,rs,l),n(rs,vo),n(rs,Ea),n(Ea,yo),n(rs,wo),n(rs,va),n(va,Ro),n(rs,Oo),n(rs,ya),n(ya,To),n(rs,So),i(s,Je,l),b(En,s,l),i(s,Ke,l),b(vn,s,l),i(s,We,l),i(s,ps,l),n(ps,Io),n(ps,wa),n(wa,Go),n(ps,No),n(ps,Ra),n(Ra,Po),n(ps,qo),n(ps,Oa),n(Oa,Bo),n(ps,Fo),i(s,Ze,l),b(yn,s,l),i(s,sl,l),i(s,Hs,l),n(Hs,Co),n(Hs,Ta),n(Ta,zo),n(Hs,Xo),i(s,nl,l),b(wn,s,l),i(s,tl,l),i(s,rt,l),n(rt,Ho),i(s,al,l),b(Rn,s,l),i(s,el,l),b(On,s,l),i(s,ll,l),i(s,pt,l),n(pt,Ao),i(s,rl,l),i(s,Tn,l),n(Tn,Mo),i(s,pl,l),i(s,H,l),n(H,Do),n(H,Sa),n(Sa,Lo),n(H,Vo),n(H,Ia),n(Ia,Yo),n(H,Qo),n(H,Ga),n(Ga,Uo),n(H,Jo),n(H,Na),n(Na,Ko),n(H,Wo),n(H,Pa),n(Pa,Zo),n(H,si),n(H,qa),n(qa,ni),n(H,ti),i(s,ol,l),i(s,D,l),n(D,ai),n(D,Ba),n(Ba,ei),n(D,li),n(D,Fa),n(Fa,ri),n(D,pi),n(D,Ca),n(Ca,oi),n(D,ii),n(D,za),n(za,ci),n(D,fi),n(D,Xa),n(Xa,gi),n(D,ui),i(s,il,l),b(Sn,s,l),i(s,cl,l),b(In,s,l),i(s,fl,l),i(s,L,l),n(L,mi),n(L,Ha),n(Ha,hi),n(L,xi),n(L,Aa),n(Aa,ji),n(L,di),n(L,Ma),n(Ma,_i),n(L,bi),n(L,Da),n(Da,$i),n(L,ki),n(L,La),n(La,Ei),n(L,vi),i(s,gl,l),b(Gn,s,l),i(s,ul,l),i(s,ot,l),n(ot,yi),i(s,ml,l),b(Nn,s,l),i(s,hl,l),i(s,it,l),n(it,wi),xl=!0},p(s,[l]){const Va={};l&1&&(Va.fw=s[0]),g.$set(Va);let K=I;I=qi(s),I!==K&&(Ol(),h(Pn[K],1,1,()=>{Pn[K]=null}),Rl(),N=Pn[I],N||(N=Pn[I]=Pi[I](s),N.c()),x(N,1),N.m(G.parentNode,G));const Ya={};l&2&&(Ya.$$scope={dirty:l,ctx:s}),Gs.$set(Ya);const Qa={};l&2&&(Qa.$$scope={dirty:l,ctx:s}),Bs.$set(Qa);const Ua={};l&2&&(Ua.$$scope={dirty:l,ctx:s}),Cs.$set(Ua);let ct=fs;fs=Fi(s),fs!==ct&&(Ol(),h(qn[ct],1,1,()=>{qn[ct]=null}),Rl(),gs=qn[fs],gs||(gs=qn[fs]=Bi[fs](s),gs.c()),x(gs,1),gs.m(Kn.parentNode,Kn));let As=us;us=zi(s),us!==As&&(Ol(),h(Bn[As],1,1,()=>{Bn[As]=null}),Rl(),ms=Bn[us],ms||(ms=Bn[us]=Ci[us](s),ms.c()),x(ms,1),ms.m(at.parentNode,at));let ft=hs;hs=Hi(s),hs!==ft&&(Ol(),h(Fn[ft],1,1,()=>{Fn[ft]=null}),Rl(),xs=Fn[hs],xs||(xs=Fn[hs]=Xi[hs](s),xs.c()),x(xs,1),xs.m(lt.parentNode,lt))},i(s){xl||(x(g.$$.fragment,s),x(N),x(A.$$.fragment,s),x(Gs.$$.fragment,s),x(Ys.$$.fragment,s),x(Qs.$$.fragment,s),x(Us.$$.fragment,s),x(Js.$$.fragment,s),x(Ks.$$.fragment,s),x(Ws.$$.fragment,s),x(Zs.$$.fragment,s),x(sn.$$.fragment,s),x(nn.$$.fragment,s),x(tn.$$.fragment,s),x(an.$$.fragment,s),x(Bs.$$.fragment,s),x(en.$$.fragment,s),x(ln.$$.fragment,s),x(Cs.$$.fragment,s),x(gs),x(cn.$$.fragment,s),x(fn.$$.fragment,s),x(gn.$$.fragment,s),x(un.$$.fragment,s),x(ms),x(xs),x(hn.$$.fragment,s),x(jn.$$.fragment,s),x(dn.$$.fragment,s),x($n.$$.fragment,s),x(kn.$$.fragment,s),x(En.$$.fragment,s),x(vn.$$.fragment,s),x(yn.$$.fragment,s),x(wn.$$.fragment,s),x(Rn.$$.fragment,s),x(On.$$.fragment,s),x(Sn.$$.fragment,s),x(In.$$.fragment,s),x(Gn.$$.fragment,s),x(Nn.$$.fragment,s),xl=!0)},o(s){h(g.$$.fragment,s),h(N),h(A.$$.fragment,s),h(Gs.$$.fragment,s),h(Ys.$$.fragment,s),h(Qs.$$.fragment,s),h(Us.$$.fragment,s),h(Js.$$.fragment,s),h(Ks.$$.fragment,s),h(Ws.$$.fragment,s),h(Zs.$$.fragment,s),h(sn.$$.fragment,s),h(nn.$$.fragment,s),h(tn.$$.fragment,s),h(an.$$.fragment,s),h(Bs.$$.fragment,s),h(en.$$.fragment,s),h(ln.$$.fragment,s),h(Cs.$$.fragment,s),h(gs),h(cn.$$.fragment,s),h(fn.$$.fragment,s),h(gn.$$.fragment,s),h(un.$$.fragment,s),h(ms),h(xs),h(hn.$$.fragment,s),h(jn.$$.fragment,s),h(dn.$$.fragment,s),h($n.$$.fragment,s),h(kn.$$.fragment,s),h(En.$$.fragment,s),h(vn.$$.fragment,s),h(yn.$$.fragment,s),h(wn.$$.fragment,s),h(Rn.$$.fragment,s),h(On.$$.fragment,s),h(Sn.$$.fragment,s),h(In.$$.fragment,s),h(Gn.$$.fragment,s),h(Nn.$$.fragment,s),xl=!1},d(s){t(u),s&&t(j),$(g,s),s&&t(k),s&&t(q),s&&t(B),Pn[I].d(s),s&&t(G),s&&t(T),s&&t(js),$(A,s),s&&t(ds),s&&t(Ss),s&&t(Ja),s&&t(Is),s&&t(Ka),$(Gs,s),s&&t(Wa),s&&t(Vs),s&&t(Za),$(Ys,s),s&&t(se),s&&t(Ns),s&&t(ne),s&&t(Yn),s&&t(te),$(Qs,s),s&&t(ae),s&&t(Ps),s&&t(ee),$(Us,s),s&&t(le),s&&t(Q),s&&t(re),$(Js,s),s&&t(pe),$(Ks,s),s&&t(oe),s&&t(qs),s&&t(ie),$(Ws,s),s&&t(ce),$(Zs,s),s&&t(fe),s&&t(Qn),s&&t(ge),$(sn,s),s&&t(ue),$(nn,s),s&&t(me),s&&t(_s),s&&t(he),$(tn,s),s&&t(xe),$(an,s),s&&t(je),s&&t(U),s&&t(de),$(Bs,s),s&&t(_e),s&&t(bs),s&&t(be),s&&t(z),s&&t($e),$(en,s),s&&t(ke),$(ln,s),s&&t(Ee),s&&t(Fs),s&&t(ve),$(Cs,s),s&&t(ye),s&&t(rn),s&&t(we),s&&t(J),s&&t(Re),qn[fs].d(s),s&&t(Kn),s&&t(pn),s&&t(Oe),s&&t(zs),s&&t(Te),$(cn,s),s&&t(Se),$(fn,s),s&&t(Ie),s&&t(Wn),s&&t(Ge),$(gn,s),s&&t(Ne),$(un,s),s&&t(Pe),s&&t(M),s&&t(qe),s&&t($s),s&&t(Be),s&&t(tt),s&&t(Fe),s&&t(mn),s&&t(Ce),Bn[us].d(s),s&&t(at),s&&t(et),s&&t(ze),Fn[hs].d(s),s&&t(lt),$(hn,s),s&&t(Xe),s&&t(xn),s&&t(He),$(jn,s),s&&t(Ae),$(dn,s),s&&t(Me),s&&t(w),s&&t(De),s&&t(X),s&&t(Le),s&&t(Ts),s&&t(Ve),s&&t(Xs),s&&t(Ye),$($n,s),s&&t(Qe),$(kn,s),s&&t(Ue),s&&t(rs),s&&t(Je),$(En,s),s&&t(Ke),$(vn,s),s&&t(We),s&&t(ps),s&&t(Ze),$(yn,s),s&&t(sl),s&&t(Hs),s&&t(nl),$(wn,s),s&&t(tl),s&&t(rt),s&&t(al),$(Rn,s),s&&t(el),$(On,s),s&&t(ll),s&&t(pt),s&&t(rl),s&&t(Tn),s&&t(pl),s&&t(H),s&&t(ol),s&&t(D),s&&t(il),$(Sn,s),s&&t(cl),$(In,s),s&&t(fl),s&&t(L),s&&t(gl),$(Gn,s),s&&t(ul),s&&t(ot),s&&t(ml),$(Nn,s),s&&t(hl),s&&t(it)}}}const rf={local:"",sections:[{local:"",title:"\u6279\u91CF\u7F16\u7801"},{local:"",sections:[{local:"",title:"\u901A\u8FC7\u7BA1\u9053\u83B7\u5F97\u57FA\u672C\u7ED3\u679C"},{local:"",title:"\u4ECE\u8F93\u5165\u5230\u9884\u6D4B"},{local:"",title:"\u5206\u7EC4\u5B9E\u4F53"}],title:"\u5728\u4EE4\u724C\u5206\u7C7B\u7BA1\u9053\u5185"}],title:"\u5FEB\u901F\u6807\u8BB0\u5668\u7684\u7279\u6B8A\u80FD\u529B"};function pf(O,u,j){let g="pt";return V2(()=>{const k=new URLSearchParams(window.location.search);j(0,g=k.get("fw")||"pt")}),[g]}class xf extends A2{constructor(u){super();M2(this,u,pf,lf,D2,{})}}export{xf as default,rf as metadata};
