import{S as Bf,i as Ff,s as Hf,e as i,t as a,c as p,a as _,h as l,d as s,g as n,G as t,k as m,w as v,m as d,x as E,y,q as g,o as b,B as x,b as A,M as Nf,N as No,p as Js,v as If,n as Qs}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ct}from"../../chunks/Tip-hf-doc-builder.js";import{Y as Io}from"../../chunks/Youtube-hf-doc-builder.js";import{I as Rf}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as M}from"../../chunks/CodeBlock-hf-doc-builder.js";import{C as Lf}from"../../chunks/CourseFloatingBanner-hf-doc-builder.js";import{F as Gf}from"../../chunks/FrameworkSwitchCourse-hf-doc-builder.js";function Uf(K){let o,h;return o=new Lf({props:{chapter:7,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/ja/chapter7/section3_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/ja/chapter7/section3_tf.ipynb"}]}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function Wf(K){let o,h;return o=new Lf({props:{chapter:7,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/ja/chapter7/section3_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/ja/chapter7/section3_pt.ipynb"}]}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function Yf(K){let o,h,c,w,D;return{c(){o=i("p"),h=a("\u{1F64B} \u300C\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u300D\u3084\u300C\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u300D\u3068\u3044\u3046\u8A00\u8449\u306B\u805E\u304D\u899A\u3048\u304C\u306A\u3044\u65B9\u306F\u3001"),c=i("a"),w=a("\u7B2C1\u7AE0"),D=a("\u3067\u3053\u308C\u3089\u306E\u4E3B\u8981\u306A\u6982\u5FF5\u3092\u3059\u3079\u3066\u52D5\u753B\u4ED8\u304D\u3067\u8AAC\u660E\u3057\u3066\u3044\u307E\u3059\u306E\u3067\u3001\u305C\u3072\u3054\u89A7\u306B\u306A\u3063\u3066\u304F\u3060\u3055\u3044\u3002"),this.h()},l($){o=p($,"P",{});var k=_(o);h=l(k,"\u{1F64B} \u300C\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u300D\u3084\u300C\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u300D\u3068\u3044\u3046\u8A00\u8449\u306B\u805E\u304D\u899A\u3048\u304C\u306A\u3044\u65B9\u306F\u3001"),c=p(k,"A",{href:!0});var q=_(c);w=l(q,"\u7B2C1\u7AE0"),q.forEach(s),D=l(k,"\u3067\u3053\u308C\u3089\u306E\u4E3B\u8981\u306A\u6982\u5FF5\u3092\u3059\u3079\u3066\u52D5\u753B\u4ED8\u304D\u3067\u8AAC\u660E\u3057\u3066\u3044\u307E\u3059\u306E\u3067\u3001\u305C\u3072\u3054\u89A7\u306B\u306A\u3063\u3066\u304F\u3060\u3055\u3044\u3002"),k.forEach(s),this.h()},h(){A(c,"href","/course/ja/chapter1")},m($,k){n($,o,k),t(o,h),t(o,c),t(c,w),t(o,D)},d($){$&&s(o)}}}function Vf(K){let o,h,c,w,D,$,k,q,u,T,C,R,L,N,F,B,H,W;return k=new M({props:{code:`from transformers import TFAutoModelForMaskedLM

model_checkpoint = "distilbert-base-uncased"
model = TFAutoModelForMaskedLM.from_pretrained(model_checkpoint)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForMaskedLM

model_checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>
model = TFAutoModelForMaskedLM.from_pretrained(model_checkpoint)`}}),F=new M({props:{code:`model(model.dummy_inputs)  # Build the model
model.summary()`,highlighted:`model(model.dummy_inputs)  <span class="hljs-comment"># Build the model</span>
model.summary()`}}),H=new M({props:{code:`Model: "tf_distil_bert_for_masked_lm"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
distilbert (TFDistilBertMain multiple                  66362880  
_________________________________________________________________
vocab_transform (Dense)      multiple                  590592    
_________________________________________________________________
vocab_layer_norm (LayerNorma multiple                  1536      
_________________________________________________________________
vocab_projector (TFDistilBer multiple                  23866170  
=================================================================
Total params: 66,985,530
Trainable params: 66,985,530
Non-trainable params: 0
_________________________________________________________________`,highlighted:`Model: <span class="hljs-string">&quot;tf_distil_bert_for_masked_lm&quot;</span>
_________________________________________________________________
Layer (<span class="hljs-built_in">type</span>)                 Output Shape              Param <span class="hljs-comment">#   </span>
=================================================================
distilbert (TFDistilBertMain multiple                  <span class="hljs-number">66362880</span>  
_________________________________________________________________
vocab_transform (Dense)      multiple                  <span class="hljs-number">590592</span>    
_________________________________________________________________
vocab_layer_norm (LayerNorma multiple                  <span class="hljs-number">1536</span>      
_________________________________________________________________
vocab_projector (TFDistilBer multiple                  <span class="hljs-number">23866170</span>  
=================================================================
Total params: <span class="hljs-number">66</span>,<span class="hljs-number">985</span>,<span class="hljs-number">530</span>
Trainable params: <span class="hljs-number">66</span>,<span class="hljs-number">985</span>,<span class="hljs-number">530</span>
Non-trainable params: <span class="hljs-number">0</span>
_________________________________________________________________`}}),{c(){o=i("p"),h=a("\u305D\u308C\u3067\u306F\u3001"),c=i("code"),w=a("AutoModelForMaskedLM"),D=a("\u30AF\u30E9\u30B9\u3092\u4F7F\u3063\u3066DistilBERT\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),$=m(),v(k.$$.fragment),q=m(),u=i("p"),T=a("\u3053\u306E\u30E2\u30C7\u30EB\u304C\u3044\u304F\u3064\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3063\u3066\u3044\u308B\u304B\u306F\u3001"),C=i("code"),R=a("summary()"),L=a(" \u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u3067\u78BA\u8A8D\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),N=m(),v(F.$$.fragment),B=m(),v(H.$$.fragment)},l(j){o=p(j,"P",{});var P=_(o);h=l(P,"\u305D\u308C\u3067\u306F\u3001"),c=p(P,"CODE",{});var se=_(c);w=l(se,"AutoModelForMaskedLM"),se.forEach(s),D=l(P,"\u30AF\u30E9\u30B9\u3092\u4F7F\u3063\u3066DistilBERT\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),P.forEach(s),$=d(j),E(k.$$.fragment,j),q=d(j),u=p(j,"P",{});var G=_(u);T=l(G,"\u3053\u306E\u30E2\u30C7\u30EB\u304C\u3044\u304F\u3064\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3063\u3066\u3044\u308B\u304B\u306F\u3001"),C=p(G,"CODE",{});var Z=_(C);R=l(Z,"summary()"),Z.forEach(s),L=l(G," \u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u3067\u78BA\u8A8D\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),G.forEach(s),N=d(j),E(F.$$.fragment,j),B=d(j),E(H.$$.fragment,j)},m(j,P){n(j,o,P),t(o,h),t(o,c),t(c,w),t(o,D),n(j,$,P),y(k,j,P),n(j,q,P),n(j,u,P),t(u,T),t(u,C),t(C,R),t(u,L),n(j,N,P),y(F,j,P),n(j,B,P),y(H,j,P),W=!0},i(j){W||(g(k.$$.fragment,j),g(F.$$.fragment,j),g(H.$$.fragment,j),W=!0)},o(j){b(k.$$.fragment,j),b(F.$$.fragment,j),b(H.$$.fragment,j),W=!1},d(j){j&&s(o),j&&s($),x(k,j),j&&s(q),j&&s(u),j&&s(N),x(F,j),j&&s(B),x(H,j)}}}function Jf(K){let o,h,c,w,D,$,k,q,u,T,C,R,L,N,F,B,H,W;return k=new M({props:{code:`from transformers import AutoModelForMaskedLM

model_checkpoint = "distilbert-base-uncased"
model = AutoModelForMaskedLM.from_pretrained(model_checkpoint)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForMaskedLM

model_checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>
model = AutoModelForMaskedLM.from_pretrained(model_checkpoint)`}}),F=new M({props:{code:`distilbert_num_parameters = model.num_parameters() / 1_000_000
print(f"'>>> DistilBERT number of parameters: {round(distilbert_num_parameters)}M'")
print(f"'>>> BERT number of parameters: 110M'")`,highlighted:`distilbert_num_parameters = model.num_parameters() / <span class="hljs-number">1_000_000</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&#x27;&gt;&gt;&gt; DistilBERT number of parameters: <span class="hljs-subst">{<span class="hljs-built_in">round</span>(distilbert_num_parameters)}</span>M&#x27;&quot;</span>)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&#x27;&gt;&gt;&gt; BERT number of parameters: 110M&#x27;&quot;</span>)`}}),H=new M({props:{code:`'>>> DistilBERT number of parameters: 67M'
'>>> BERT number of parameters: 110M'`,highlighted:`<span class="hljs-string">&#x27;&gt;&gt;&gt; DistilBERT number of parameters: 67M&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; BERT number of parameters: 110M&#x27;</span>`}}),{c(){o=i("p"),h=a("\u305D\u308C\u3067\u306F\u3001"),c=i("code"),w=a("AutoModelForMaskedLM"),D=a("\u30AF\u30E9\u30B9\u3092\u4F7F\u3063\u3066DistilBERT\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),$=m(),v(k.$$.fragment),q=m(),u=i("p"),T=a("\u3053\u306E\u30E2\u30C7\u30EB\u304C\u3044\u304F\u3064\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3063\u3066\u3044\u308B\u304B\u306F\u3001"),C=i("code"),R=a("num_parameters()"),L=a(" \u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u3067\u78BA\u8A8D\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),N=m(),v(F.$$.fragment),B=m(),v(H.$$.fragment)},l(j){o=p(j,"P",{});var P=_(o);h=l(P,"\u305D\u308C\u3067\u306F\u3001"),c=p(P,"CODE",{});var se=_(c);w=l(se,"AutoModelForMaskedLM"),se.forEach(s),D=l(P,"\u30AF\u30E9\u30B9\u3092\u4F7F\u3063\u3066DistilBERT\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),P.forEach(s),$=d(j),E(k.$$.fragment,j),q=d(j),u=p(j,"P",{});var G=_(u);T=l(G,"\u3053\u306E\u30E2\u30C7\u30EB\u304C\u3044\u304F\u3064\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3063\u3066\u3044\u308B\u304B\u306F\u3001"),C=p(G,"CODE",{});var Z=_(C);R=l(Z,"num_parameters()"),Z.forEach(s),L=l(G," \u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u3067\u78BA\u8A8D\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),G.forEach(s),N=d(j),E(F.$$.fragment,j),B=d(j),E(H.$$.fragment,j)},m(j,P){n(j,o,P),t(o,h),t(o,c),t(c,w),t(o,D),n(j,$,P),y(k,j,P),n(j,q,P),n(j,u,P),t(u,T),t(u,C),t(C,R),t(u,L),n(j,N,P),y(F,j,P),n(j,B,P),y(H,j,P),W=!0},i(j){W||(g(k.$$.fragment,j),g(F.$$.fragment,j),g(H.$$.fragment,j),W=!0)},o(j){b(k.$$.fragment,j),b(F.$$.fragment,j),b(H.$$.fragment,j),W=!1},d(j){j&&s(o),j&&s($),x(k,j),j&&s(q),j&&s(u),j&&s(N),x(F,j),j&&s(B),x(H,j)}}}function Qf(K){let o,h;return o=new M({props:{code:`import numpy as np
import tensorflow as tf

inputs = tokenizer(text, return_tensors="np")
token_logits = model(**inputs).logits
# Find the location of [MASK] and extract its logits
mask_token_index = np.argwhere(inputs["input_ids"] == tokenizer.mask_token_id)[0, 1]
mask_token_logits = token_logits[0, mask_token_index, :]
# Pick the [MASK] candidates with the highest logits
# We negate the array before argsort to get the largest, not the smallest, logits
top_5_tokens = np.argsort(-mask_token_logits)[:5].tolist()

for token in top_5_tokens:
    print(f">>> {text.replace(tokenizer.mask_token, tokenizer.decode([token]))}")`,highlighted:`<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
token_logits = model(**inputs).logits
<span class="hljs-comment"># Find the location of [MASK] and extract its logits</span>
mask_token_index = np.argwhere(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>] == tokenizer.mask_token_id)[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]
mask_token_logits = token_logits[<span class="hljs-number">0</span>, mask_token_index, :]
<span class="hljs-comment"># Pick the [MASK] candidates with the highest logits</span>
<span class="hljs-comment"># We negate the array before argsort to get the largest, not the smallest, logits</span>
top_5_tokens = np.argsort(-mask_token_logits)[:<span class="hljs-number">5</span>].tolist()

<span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> top_5_tokens:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&gt;&gt;&gt; <span class="hljs-subst">{text.replace(tokenizer.mask_token, tokenizer.decode([token]))}</span>&quot;</span>)`}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function Xf(K){let o,h;return o=new M({props:{code:`import torch

inputs = tokenizer(text, return_tensors="pt")
token_logits = model(**inputs).logits
# Find the location of [MASK] and extract its logits
mask_token_index = torch.where(inputs["input_ids"] == tokenizer.mask_token_id)[1]
mask_token_logits = token_logits[0, mask_token_index, :]
# Pick the [MASK] candidates with the highest logits
top_5_tokens = torch.topk(mask_token_logits, 5, dim=1).indices[0].tolist()

for token in top_5_tokens:
    print(f"'>>> {text.replace(tokenizer.mask_token, tokenizer.decode([token]))}'")`,highlighted:`<span class="hljs-keyword">import</span> torch

inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
token_logits = model(**inputs).logits
<span class="hljs-comment"># Find the location of [MASK] and extract its logits</span>
mask_token_index = torch.where(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>] == tokenizer.mask_token_id)[<span class="hljs-number">1</span>]
mask_token_logits = token_logits[<span class="hljs-number">0</span>, mask_token_index, :]
<span class="hljs-comment"># Pick the [MASK] candidates with the highest logits</span>
top_5_tokens = torch.topk(mask_token_logits, <span class="hljs-number">5</span>, dim=<span class="hljs-number">1</span>).indices[<span class="hljs-number">0</span>].tolist()

<span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> top_5_tokens:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&#x27;&gt;&gt;&gt; <span class="hljs-subst">{text.replace(tokenizer.mask_token, tokenizer.decode([token]))}</span>&#x27;&quot;</span>)`}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function Zf(K){let o,h,c,w,D,$,k,q,u,T,C,R,L,N,F,B,H,W,j,P,se,G,Z,Y,he,X;return{c(){o=i("p"),h=a("\u270F\uFE0F "),c=i("strong"),w=a("\u6311\u6226\u3057\u3066\u307F\u307E\u3057\u3087\u3046\uFF01"),D=m(),$=i("code"),k=a("unsupervised"),q=a(" \u306E\u30E9\u30D9\u30EB\u304C\u3064\u3044\u305F\u5206\u5272\u30C7\u30FC\u30BF\u306E\u30E9\u30F3\u30C0\u30E0\u30B5\u30F3\u30D7\u30EB\u3092\u4F5C\u6210\u3057\u3001\u30E9\u30D9\u30EB\u304C "),u=i("code"),T=a("0"),C=a(" \u3084 "),R=i("code"),L=a("1"),N=a(" \u3067\u306A\u3044\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u307E\u305F\u3001"),F=i("code"),B=a("train"),H=a(" \u3068 "),W=i("code"),j=a("test"),P=a(" \u7528\u306E\u5206\u5272\u30C7\u30FC\u30BF\u306E\u30E9\u30D9\u30EB\u304C\u672C\u5F53\u306B "),se=i("code"),G=a("0"),Z=a(" \u304B "),Y=i("code"),he=a("1"),X=a(" \u306E\u307F\u304B\u3092\u78BA\u8A8D\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306F\u3059\u3079\u3066\u306E\u81EA\u7136\u8A00\u8A9E\u51E6\u7406\u306E\u5B9F\u8DF5\u8005\u304C\u65B0\u3057\u3044\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u958B\u59CB\u6642\u306B\u5B9F\u884C\u3059\u3079\u304D\u3001\u6709\u7528\u306A\u30B5\u30CB\u30C6\u30A3\u30C1\u30A7\u30C3\u30AF\u3067\u3059!")},l(ie){o=p(ie,"P",{});var I=_(o);h=l(I,"\u270F\uFE0F "),c=p(I,"STRONG",{});var je=_(c);w=l(je,"\u6311\u6226\u3057\u3066\u307F\u307E\u3057\u3087\u3046\uFF01"),je.forEach(s),D=d(I),$=p(I,"CODE",{});var U=_($);k=l(U,"unsupervised"),U.forEach(s),q=l(I," \u306E\u30E9\u30D9\u30EB\u304C\u3064\u3044\u305F\u5206\u5272\u30C7\u30FC\u30BF\u306E\u30E9\u30F3\u30C0\u30E0\u30B5\u30F3\u30D7\u30EB\u3092\u4F5C\u6210\u3057\u3001\u30E9\u30D9\u30EB\u304C "),u=p(I,"CODE",{});var Oe=_(u);T=l(Oe,"0"),Oe.forEach(s),C=l(I," \u3084 "),R=p(I,"CODE",{});var Q=_(R);L=l(Q,"1"),Q.forEach(s),N=l(I," \u3067\u306A\u3044\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u307E\u305F\u3001"),F=p(I,"CODE",{});var le=_(F);B=l(le,"train"),le.forEach(s),H=l(I," \u3068 "),W=p(I,"CODE",{});var ce=_(W);j=l(ce,"test"),ce.forEach(s),P=l(I," \u7528\u306E\u5206\u5272\u30C7\u30FC\u30BF\u306E\u30E9\u30D9\u30EB\u304C\u672C\u5F53\u306B "),se=p(I,"CODE",{});var te=_(se);G=l(te,"0"),te.forEach(s),Z=l(I," \u304B "),Y=p(I,"CODE",{});var ge=_(Y);he=l(ge,"1"),ge.forEach(s),X=l(I," \u306E\u307F\u304B\u3092\u78BA\u8A8D\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306F\u3059\u3079\u3066\u306E\u81EA\u7136\u8A00\u8A9E\u51E6\u7406\u306E\u5B9F\u8DF5\u8005\u304C\u65B0\u3057\u3044\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u958B\u59CB\u6642\u306B\u5B9F\u884C\u3059\u3079\u304D\u3001\u6709\u7528\u306A\u30B5\u30CB\u30C6\u30A3\u30C1\u30A7\u30C3\u30AF\u3067\u3059!"),I.forEach(s)},m(ie,I){n(ie,o,I),t(o,h),t(o,c),t(c,w),t(o,D),t(o,$),t($,k),t(o,q),t(o,u),t(u,T),t(o,C),t(o,R),t(R,L),t(o,N),t(o,F),t(F,B),t(o,H),t(o,W),t(W,j),t(o,P),t(o,se),t(se,G),t(o,Z),t(o,Y),t(Y,he),t(o,X)},d(ie){ie&&s(o)}}}function em(K){let o,h,c,w,D,$,k,q,u,T,C,R,L,N;return{c(){o=i("p"),h=a("\u270F\uFE0F "),c=i("strong"),w=a("\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),D=m(),$=i("a"),k=a("BigBird"),q=a(" \u3084 "),u=i("a"),T=a("Longformer"),C=a(" \u306A\u3069\u306E\u3044\u304F\u3064\u304B\u306E Transformer \u30E2\u30C7\u30EB\u306F\u3001BERT \u3084\u4ED6\u306E\u521D\u671F\u306E Transformer \u30E2\u30C7\u30EB\u3088\u308A\u305A\u3063\u3068\u9577\u3044\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u9577\u3092\u6301\u3063\u3066\u3044\u307E\u3059\u3002\u3053\u308C\u3089\u306E\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u306E\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3057\u3066\u3001"),R=i("code"),L=a("model_max_length"),N=a(" \u304C\u305D\u306E\u30E2\u30C7\u30EB\u30AB\u30FC\u30C9\u5185\u306B\u8A18\u8F09\u3055\u308C\u3066\u3044\u308B\u3082\u306E\u3068\u4E00\u81F4\u3059\u308B\u3053\u3068\u3092\u691C\u8A3C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),this.h()},l(F){o=p(F,"P",{});var B=_(o);h=l(B,"\u270F\uFE0F "),c=p(B,"STRONG",{});var H=_(c);w=l(H,"\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),H.forEach(s),D=d(B),$=p(B,"A",{href:!0,rel:!0});var W=_($);k=l(W,"BigBird"),W.forEach(s),q=l(B," \u3084 "),u=p(B,"A",{href:!0});var j=_(u);T=l(j,"Longformer"),j.forEach(s),C=l(B," \u306A\u3069\u306E\u3044\u304F\u3064\u304B\u306E Transformer \u30E2\u30C7\u30EB\u306F\u3001BERT \u3084\u4ED6\u306E\u521D\u671F\u306E Transformer \u30E2\u30C7\u30EB\u3088\u308A\u305A\u3063\u3068\u9577\u3044\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u9577\u3092\u6301\u3063\u3066\u3044\u307E\u3059\u3002\u3053\u308C\u3089\u306E\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u306E\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3057\u3066\u3001"),R=p(B,"CODE",{});var P=_(R);L=l(P,"model_max_length"),P.forEach(s),N=l(B," \u304C\u305D\u306E\u30E2\u30C7\u30EB\u30AB\u30FC\u30C9\u5185\u306B\u8A18\u8F09\u3055\u308C\u3066\u3044\u308B\u3082\u306E\u3068\u4E00\u81F4\u3059\u308B\u3053\u3068\u3092\u691C\u8A3C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),B.forEach(s),this.h()},h(){A($,"href","https://huggingface.co/google/bigbird-roberta-base"),A($,"rel","nofollow"),A(u,"href","hf.co/allenai/longformer-base-4096")},m(F,B){n(F,o,B),t(o,h),t(o,c),t(c,w),t(o,D),t(o,$),t($,k),t(o,q),t(o,u),t(u,T),t(o,C),t(o,R),t(R,L),t(o,N)},d(F){F&&s(o)}}}function sm(K){let o,h;return{c(){o=i("p"),h=a("\u306A\u304A\u3001\u5C0F\u3055\u306A\u65AD\u7247\u30B5\u30A4\u30BA\u3092\u4F7F\u7528\u3059\u308B\u3068\u3001\u5B9F\u969B\u306E\u30B7\u30CA\u30EA\u30AA\u3067\u306F\u4E0D\u5229\u306B\u306A\u308B\u3053\u3068\u304C\u3042\u308B\u306E\u3067\u3001\u30E2\u30C7\u30EB\u3092\u9069\u7528\u3059\u308B\u30E6\u30FC\u30B9\u30B1\u30FC\u30B9\u306B\u5BFE\u5FDC\u3057\u305F\u30B5\u30A4\u30BA\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002")},l(c){o=p(c,"P",{});var w=_(o);h=l(w,"\u306A\u304A\u3001\u5C0F\u3055\u306A\u65AD\u7247\u30B5\u30A4\u30BA\u3092\u4F7F\u7528\u3059\u308B\u3068\u3001\u5B9F\u969B\u306E\u30B7\u30CA\u30EA\u30AA\u3067\u306F\u4E0D\u5229\u306B\u306A\u308B\u3053\u3068\u304C\u3042\u308B\u306E\u3067\u3001\u30E2\u30C7\u30EB\u3092\u9069\u7528\u3059\u308B\u30E6\u30FC\u30B9\u30B1\u30FC\u30B9\u306B\u5BFE\u5FDC\u3057\u305F\u30B5\u30A4\u30BA\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),w.forEach(s)},m(c,w){n(c,o,w),t(o,h)},d(c){c&&s(o)}}}function tm(K){let o,h,c,w,D,$,k,q,u,T,C;return{c(){o=i("p"),h=a("\u270F\uFE0F "),c=i("strong"),w=a("\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),D=a(" \u4E0A\u306E\u30B3\u30FC\u30C9\u3092\u4F55\u5EA6\u304B\u5B9F\u884C\u3057\u3066\u3001\u30E9\u30F3\u30C0\u30E0\u306A\u30DE\u30B9\u30AD\u30F3\u30B0\u304C\u3042\u306A\u305F\u306E\u76EE\u306E\u524D\u3067\u8D77\u3053\u308B\u306E\u3092\u898B\u307E\u3057\u3087\u3046! \u307E\u305F\u3001"),$=i("code"),k=a("tokenizer.decode()"),q=a(" \u30E1\u30BD\u30C3\u30C9\u3092 "),u=i("code"),T=a("tokenizer.convert_ids_to_tokens()"),C=a(" \u306B\u7F6E\u304D\u63DB\u3048\u308B\u3068\u3001\u4E0E\u3048\u305F\u5358\u8A9E\u5185\u304B\u3089\u4E00\u3064\u306E\u30C8\u30FC\u30AF\u30F3\u304C\u9078\u629E\u3055\u308C\u3066\u30DE\u30B9\u30AF\u3055\u308C\u3001\u4ED6\u306E\u5358\u8A9E\u304C\u30DE\u30B9\u30AF\u3055\u308C\u306A\u3044\u3053\u3068\u3092\u898B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002")},l(R){o=p(R,"P",{});var L=_(o);h=l(L,"\u270F\uFE0F "),c=p(L,"STRONG",{});var N=_(c);w=l(N,"\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),N.forEach(s),D=l(L," \u4E0A\u306E\u30B3\u30FC\u30C9\u3092\u4F55\u5EA6\u304B\u5B9F\u884C\u3057\u3066\u3001\u30E9\u30F3\u30C0\u30E0\u306A\u30DE\u30B9\u30AD\u30F3\u30B0\u304C\u3042\u306A\u305F\u306E\u76EE\u306E\u524D\u3067\u8D77\u3053\u308B\u306E\u3092\u898B\u307E\u3057\u3087\u3046! \u307E\u305F\u3001"),$=p(L,"CODE",{});var F=_($);k=l(F,"tokenizer.decode()"),F.forEach(s),q=l(L," \u30E1\u30BD\u30C3\u30C9\u3092 "),u=p(L,"CODE",{});var B=_(u);T=l(B,"tokenizer.convert_ids_to_tokens()"),B.forEach(s),C=l(L," \u306B\u7F6E\u304D\u63DB\u3048\u308B\u3068\u3001\u4E0E\u3048\u305F\u5358\u8A9E\u5185\u304B\u3089\u4E00\u3064\u306E\u30C8\u30FC\u30AF\u30F3\u304C\u9078\u629E\u3055\u308C\u3066\u30DE\u30B9\u30AF\u3055\u308C\u3001\u4ED6\u306E\u5358\u8A9E\u304C\u30DE\u30B9\u30AF\u3055\u308C\u306A\u3044\u3053\u3068\u3092\u898B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),L.forEach(s)},m(R,L){n(R,o,L),t(o,h),t(o,c),t(c,w),t(o,D),t(o,$),t($,k),t(o,q),t(o,u),t(u,T),t(o,C)},d(R){R&&s(o)}}}function Sf(K){let o,h,c,w,D;return{c(){o=i("p"),h=a("\u30E9\u30F3\u30C0\u30E0\u30DE\u30B9\u30AD\u30F3\u30B0\u306E\u526F\u4F5C\u7528\u3068\u3057\u3066\u3001"),c=i("code"),w=a("Trainer"),D=a(`\u3092\u4F7F\u7528\u3059\u308B\u5834\u5408\u3001\u8A55\u4FA1\u6307\u6A19\u304C\u78BA\u5B9A\u7684\u3067\u306A\u304F\u306A\u308B\u3053\u3068\u304C\u6319\u3052\u3089\u308C\u307E\u3059\u3002
\u3053\u308C\u306F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u3068\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306B\u540C\u3058\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u7528\u3059\u308B\u305F\u3081\u3067\u3059\u3002\u5F8C\u307B\u3069\u3001\u{1F917} Accelerate\u3067\u5FAE\u8ABF\u6574\u3092\u884C\u3046\u969B\u306B\u3001\u30AB\u30B9\u30BF\u30E0\u8A55\u4FA1\u30EB\u30FC\u30D7\u306E\u67D4\u8EDF\u6027\u3092\u5229\u7528\u3057\u3066\u30E9\u30F3\u30C0\u30E0\u6027\u3092\u306A\u304F\u3059\u65B9\u6CD5\u306B\u3064\u3044\u3066\u8AAC\u660E\u3057\u307E\u3059\u3002`)},l($){o=p($,"P",{});var k=_(o);h=l(k,"\u30E9\u30F3\u30C0\u30E0\u30DE\u30B9\u30AD\u30F3\u30B0\u306E\u526F\u4F5C\u7528\u3068\u3057\u3066\u3001"),c=p(k,"CODE",{});var q=_(c);w=l(q,"Trainer"),q.forEach(s),D=l(k,`\u3092\u4F7F\u7528\u3059\u308B\u5834\u5408\u3001\u8A55\u4FA1\u6307\u6A19\u304C\u78BA\u5B9A\u7684\u3067\u306A\u304F\u306A\u308B\u3053\u3068\u304C\u6319\u3052\u3089\u308C\u307E\u3059\u3002
\u3053\u308C\u306F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u3068\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306B\u540C\u3058\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u7528\u3059\u308B\u305F\u3081\u3067\u3059\u3002\u5F8C\u307B\u3069\u3001\u{1F917} Accelerate\u3067\u5FAE\u8ABF\u6574\u3092\u884C\u3046\u969B\u306B\u3001\u30AB\u30B9\u30BF\u30E0\u8A55\u4FA1\u30EB\u30FC\u30D7\u306E\u67D4\u8EDF\u6027\u3092\u5229\u7528\u3057\u3066\u30E9\u30F3\u30C0\u30E0\u6027\u3092\u306A\u304F\u3059\u65B9\u6CD5\u306B\u3064\u3044\u3066\u8AAC\u660E\u3057\u307E\u3059\u3002`),k.forEach(s)},m($,k){n($,o,k),t(o,h),t(o,c),t(c,w),t(o,D)},d($){$&&s(o)}}}function am(K){let o,h;return o=new M({props:{code:`import collections
import numpy as np

from transformers.data.data_collator import tf_default_data_collator

wwm_probability = 0.2


def whole_word_masking_data_collator(features):
    for feature in features:
        word_ids = feature.pop("word_ids")

        # Create a map between words and corresponding token indices
        mapping = collections.defaultdict(list)
        current_word_index = -1
        current_word = None
        for idx, word_id in enumerate(word_ids):
            if word_id is not None:
                if word_id != current_word:
                    current_word = word_id
                    current_word_index += 1
                mapping[current_word_index].append(idx)

        # Randomly mask words
        mask = np.random.binomial(1, wwm_probability, (len(mapping),))
        input_ids = feature["input_ids"]
        labels = feature["labels"]
        new_labels = [-100] * len(labels)
        for word_id in np.where(mask)[0]:
            word_id = word_id.item()
            for idx in mapping[word_id]:
                new_labels[idx] = labels[idx]
                input_ids[idx] = tokenizer.mask_token_id
        feature["labels"] = new_labels

    return tf_default_data_collator(features)`,highlighted:`<span class="hljs-keyword">import</span> collections
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-keyword">from</span> transformers.data.data_collator <span class="hljs-keyword">import</span> tf_default_data_collator

wwm_probability = <span class="hljs-number">0.2</span>


<span class="hljs-keyword">def</span> <span class="hljs-title function_">whole_word_masking_data_collator</span>(<span class="hljs-params">features</span>):
    <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features:
        word_ids = feature.pop(<span class="hljs-string">&quot;word_ids&quot;</span>)

        <span class="hljs-comment"># Create a map between words and corresponding token indices</span>
        mapping = collections.defaultdict(<span class="hljs-built_in">list</span>)
        current_word_index = -<span class="hljs-number">1</span>
        current_word = <span class="hljs-literal">None</span>
        <span class="hljs-keyword">for</span> idx, word_id <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(word_ids):
            <span class="hljs-keyword">if</span> word_id <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>:
                <span class="hljs-keyword">if</span> word_id != current_word:
                    current_word = word_id
                    current_word_index += <span class="hljs-number">1</span>
                mapping[current_word_index].append(idx)

        <span class="hljs-comment"># Randomly mask words</span>
        mask = np.random.binomial(<span class="hljs-number">1</span>, wwm_probability, (<span class="hljs-built_in">len</span>(mapping),))
        input_ids = feature[<span class="hljs-string">&quot;input_ids&quot;</span>]
        labels = feature[<span class="hljs-string">&quot;labels&quot;</span>]
        new_labels = [-<span class="hljs-number">100</span>] * <span class="hljs-built_in">len</span>(labels)
        <span class="hljs-keyword">for</span> word_id <span class="hljs-keyword">in</span> np.where(mask)[<span class="hljs-number">0</span>]:
            word_id = word_id.item()
            <span class="hljs-keyword">for</span> idx <span class="hljs-keyword">in</span> mapping[word_id]:
                new_labels[idx] = labels[idx]
                input_ids[idx] = tokenizer.mask_token_id
        feature[<span class="hljs-string">&quot;labels&quot;</span>] = new_labels

    <span class="hljs-keyword">return</span> tf_default_data_collator(features)`}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function lm(K){let o,h;return o=new M({props:{code:`import collections
import numpy as np

from transformers import default_data_collator

wwm_probability = 0.2


def whole_word_masking_data_collator(features):
    for feature in features:
        word_ids = feature.pop("word_ids")

        # Create a map between words and corresponding token indices
        mapping = collections.defaultdict(list)
        current_word_index = -1
        current_word = None
        for idx, word_id in enumerate(word_ids):
            if word_id is not None:
                if word_id != current_word:
                    current_word = word_id
                    current_word_index += 1
                mapping[current_word_index].append(idx)

        # Randomly mask words
        mask = np.random.binomial(1, wwm_probability, (len(mapping),))
        input_ids = feature["input_ids"]
        labels = feature["labels"]
        new_labels = [-100] * len(labels)
        for word_id in np.where(mask)[0]:
            word_id = word_id.item()
            for idx in mapping[word_id]:
                new_labels[idx] = labels[idx]
                input_ids[idx] = tokenizer.mask_token_id
        feature["labels"] = new_labels

    return default_data_collator(features)`,highlighted:`<span class="hljs-keyword">import</span> collections
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> default_data_collator

wwm_probability = <span class="hljs-number">0.2</span>


<span class="hljs-keyword">def</span> <span class="hljs-title function_">whole_word_masking_data_collator</span>(<span class="hljs-params">features</span>):
    <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features:
        word_ids = feature.pop(<span class="hljs-string">&quot;word_ids&quot;</span>)

        <span class="hljs-comment"># Create a map between words and corresponding token indices</span>
        mapping = collections.defaultdict(<span class="hljs-built_in">list</span>)
        current_word_index = -<span class="hljs-number">1</span>
        current_word = <span class="hljs-literal">None</span>
        <span class="hljs-keyword">for</span> idx, word_id <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(word_ids):
            <span class="hljs-keyword">if</span> word_id <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>:
                <span class="hljs-keyword">if</span> word_id != current_word:
                    current_word = word_id
                    current_word_index += <span class="hljs-number">1</span>
                mapping[current_word_index].append(idx)

        <span class="hljs-comment"># Randomly mask words</span>
        mask = np.random.binomial(<span class="hljs-number">1</span>, wwm_probability, (<span class="hljs-built_in">len</span>(mapping),))
        input_ids = feature[<span class="hljs-string">&quot;input_ids&quot;</span>]
        labels = feature[<span class="hljs-string">&quot;labels&quot;</span>]
        new_labels = [-<span class="hljs-number">100</span>] * <span class="hljs-built_in">len</span>(labels)
        <span class="hljs-keyword">for</span> word_id <span class="hljs-keyword">in</span> np.where(mask)[<span class="hljs-number">0</span>]:
            word_id = word_id.item()
            <span class="hljs-keyword">for</span> idx <span class="hljs-keyword">in</span> mapping[word_id]:
                new_labels[idx] = labels[idx]
                input_ids[idx] = tokenizer.mask_token_id
        feature[<span class="hljs-string">&quot;labels&quot;</span>] = new_labels

    <span class="hljs-keyword">return</span> default_data_collator(features)`}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function rm(K){let o,h,c,w,D,$,k,q,u,T,C;return{c(){o=i("p"),h=a("\u270F\uFE0F "),c=i("strong"),w=a("\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),D=a(" \u4E0A\u306E\u30B3\u30FC\u30C9\u3092\u4F55\u5EA6\u304B\u5B9F\u884C\u3057\u3066\u3001\u30E9\u30F3\u30C0\u30E0\u306A\u30DE\u30B9\u30AD\u30F3\u30B0\u304C\u3042\u306A\u305F\u306E\u76EE\u306E\u524D\u3067\u8D77\u3053\u308B\u306E\u3092\u898B\u307E\u3057\u3087\u3046! \u307E\u305F\u3001"),$=i("code"),k=a("tokenizer.decode()"),q=a(" \u30E1\u30BD\u30C3\u30C9\u3092 "),u=i("code"),T=a("tokenizer.convert_ids_to_tokens()"),C=a(" \u306B\u7F6E\u304D\u63DB\u3048\u308B\u3068\u3001\u4E0E\u3048\u3089\u308C\u305F\u5358\u8A9E\u304B\u3089\u306E\u30C8\u30FC\u30AF\u30F3\u304C\u5E38\u306B\u4E00\u7DD2\u306B\u30DE\u30B9\u30AF\u3055\u308C\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002")},l(R){o=p(R,"P",{});var L=_(o);h=l(L,"\u270F\uFE0F "),c=p(L,"STRONG",{});var N=_(c);w=l(N,"\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),N.forEach(s),D=l(L," \u4E0A\u306E\u30B3\u30FC\u30C9\u3092\u4F55\u5EA6\u304B\u5B9F\u884C\u3057\u3066\u3001\u30E9\u30F3\u30C0\u30E0\u306A\u30DE\u30B9\u30AD\u30F3\u30B0\u304C\u3042\u306A\u305F\u306E\u76EE\u306E\u524D\u3067\u8D77\u3053\u308B\u306E\u3092\u898B\u307E\u3057\u3087\u3046! \u307E\u305F\u3001"),$=p(L,"CODE",{});var F=_($);k=l(F,"tokenizer.decode()"),F.forEach(s),q=l(L," \u30E1\u30BD\u30C3\u30C9\u3092 "),u=p(L,"CODE",{});var B=_(u);T=l(B,"tokenizer.convert_ids_to_tokens()"),B.forEach(s),C=l(L," \u306B\u7F6E\u304D\u63DB\u3048\u308B\u3068\u3001\u4E0E\u3048\u3089\u308C\u305F\u5358\u8A9E\u304B\u3089\u306E\u30C8\u30FC\u30AF\u30F3\u304C\u5E38\u306B\u4E00\u7DD2\u306B\u30DE\u30B9\u30AF\u3055\u308C\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002"),L.forEach(s)},m(R,L){n(R,o,L),t(o,h),t(o,c),t(c,w),t(o,D),t(o,$),t($,k),t(o,q),t(o,u),t(u,T),t(o,C)},d(R){R&&s(o)}}}function nm(K){let o,h,c,w,D,$,k,q,u,T,C,R,L,N,F,B,H,W,j,P,se,G,Z,Y,he,X,ie,I,je,U,Oe,Q,le,ce,te,ge,Be,Ie,re,be,Fe,fe,Ke,ke,De,pe,ve,$e,Ee,_e,Re,me,Ae,ye,S,ee,He,ae,we,Ve,ne,qe,J,Le,Ge,Ne,Je,Me,Pe;return k=new M({props:{code:`from transformers import TrainingArguments

batch_size = 64
# Show the training loss with every epoch
logging_steps = len(downsampled_dataset["train"]) // batch_size
model_name = model_checkpoint.split("/")[-1]

training_args = TrainingArguments(
    output_dir=f"{model_name}-finetuned-imdb",
    overwrite_output_dir=True,
    evaluation_strategy="epoch",
    learning_rate=2e-5,
    weight_decay=0.01,
    per_device_train_batch_size=batch_size,
    per_device_eval_batch_size=batch_size,
    push_to_hub=True,
    fp16=True,
    logging_steps=logging_steps,
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

batch_size = <span class="hljs-number">64</span>
<span class="hljs-comment"># Show the training loss with every epoch</span>
logging_steps = <span class="hljs-built_in">len</span>(downsampled_dataset[<span class="hljs-string">&quot;train&quot;</span>]) // batch_size
model_name = model_checkpoint.split(<span class="hljs-string">&quot;/&quot;</span>)[-<span class="hljs-number">1</span>]

training_args = TrainingArguments(
    output_dir=<span class="hljs-string">f&quot;<span class="hljs-subst">{model_name}</span>-finetuned-imdb&quot;</span>,
    overwrite_output_dir=<span class="hljs-literal">True</span>,
    evaluation_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
    learning_rate=<span class="hljs-number">2e-5</span>,
    weight_decay=<span class="hljs-number">0.01</span>,
    per_device_train_batch_size=batch_size,
    per_device_eval_batch_size=batch_size,
    push_to_hub=<span class="hljs-literal">True</span>,
    fp16=<span class="hljs-literal">True</span>,
    logging_steps=logging_steps,
)`}}),we=new M({props:{code:`from transformers import Trainer

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=downsampled_dataset["train"],
    eval_dataset=downsampled_dataset["test"],
    data_collator=data_collator,
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Trainer

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=downsampled_dataset[<span class="hljs-string">&quot;train&quot;</span>],
    eval_dataset=downsampled_dataset[<span class="hljs-string">&quot;test&quot;</span>],
    data_collator=data_collator,
)`}}),{c(){o=i("p"),h=a("\u4E00\u5EA6\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u3089\u3001"),c=i("code"),w=a("Trainer"),D=a(" \u306E\u5F15\u6570\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002"),$=m(),v(k.$$.fragment),q=m(),u=i("p"),T=a("\u3053\u3053\u3067\u306F\u3001\u5404\u30A8\u30DD\u30C3\u30AF\u3067\u306E\u5B66\u7FD2\u640D\u5931\u3092\u78BA\u5B9F\u306B\u8FFD\u8DE1\u3059\u308B\u305F\u3081\u306B "),C=i("code"),R=a("logging_steps"),L=a(" \u3092\u542B\u3080\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u5C11\u3057\u8ABF\u6574\u3057\u307E\u3057\u305F\u3002\u307E\u305F\u3001 "),N=i("code"),F=a("fp16=True"),B=a(" \u3092\u4F7F\u7528\u3057\u3066\u3001\u6DF7\u5408\u7CBE\u5EA6\u306E\u5B66\u7FD2\u3092\u6709\u52B9\u306B\u3057\u3001\u3055\u3089\u306B\u9AD8\u901F\u5316\u3057\u307E\u3057\u305F\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001 "),H=i("code"),W=a("Trainer"),j=a(" \u306F\u30E2\u30C7\u30EB\u306E "),P=i("code"),se=a("forward()"),G=a(" \u30E1\u30BD\u30C3\u30C9\u306B\u542B\u307E\u308C\u306A\u3044\u5217\u3092\u3059\u3079\u3066\u524A\u9664\u3057\u307E\u3059\u3002\u3064\u307E\u308A\u3001\u5168\u5358\u8A9E\u30DE\u30B9\u30AF\u7528\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u3001 "),Z=i("code"),Y=a("remove_unused_columns=False"),he=a(" \u3092\u8A2D\u5B9A\u3057\u3066\u3001\u5B66\u7FD2\u6642\u306B "),X=i("code"),ie=a("word_ids"),I=a(" \u30AB\u30E9\u30E0\u304C\u5931\u308F\u308C\u306A\u3044\u3088\u3046\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),je=m(),U=i("p"),Oe=a("\u306A\u304A\u3001 "),Q=i("code"),le=a("hub_model_id"),ce=a(" \u5F15\u6570\u3067\u30D7\u30C3\u30B7\u30E5\u5148\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u540D\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059 (\u7279\u306B\u3001\u7D44\u7E54\u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u5834\u5408\u306F\u3053\u306E\u5F15\u6570\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059)\u3002\u4F8B\u3048\u3070\u3001\u30E2\u30C7\u30EB\u3092 "),te=i("a"),ge=i("code"),Be=a("huggingface-course"),Ie=a(" organization"),re=a(" \u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u5834\u5408\u3001 "),be=i("code"),Fe=a("TrainingArguments"),fe=a(" \u306B "),Ke=i("code"),ke=a('hub_model_id="huggingface-course/distilbert-finetuned-imdb"'),De=a(" \u3092\u8FFD\u52A0\u3057\u3066\u3044\u307E\u3059\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u4F7F\u7528\u3059\u308B\u30EA\u30DD\u30B8\u30C8\u30EA\u306F\u3042\u306A\u305F\u306E\u540D\u524D\u7A7A\u9593\u5185\u306B\u3042\u308A\u3001\u8A2D\u5B9A\u3057\u305F\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3061\u306A\u3093\u3060\u540D\u524D\u306B\u306A\u308B\u306E\u3067\u3001\u79C1\u305F\u3061\u306E\u5834\u5408\u306F "),pe=i("code"),ve=a('"lewtun/distilbert-finetuned-imdb"'),$e=a(" \u3068\u306A\u308A\u307E\u3059\u3002"),Ee=m(),_e=i("p"),Re=a("\u3053\u308C\u3067 "),me=i("code"),Ae=a("Trainer"),ye=a(" \u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u6750\u6599\u304C\u63C3\u3044\u307E\u3057\u305F\u3002\u3053\u3053\u3067\u306F\u3001\u6A19\u6E96\u7684\u306A "),S=i("code"),ee=a("data_collator"),He=a(" \u3092\u4F7F\u7528\u3057\u307E\u3059\u304C\u3001\u7DF4\u7FD2\u3068\u3057\u3066\u5168\u5358\u8A9E\u30DE\u30B9\u30AD\u30F3\u30B0\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u8A66\u3057\u3066\u3001\u7D50\u679C\u3092\u6BD4\u8F03\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),ae=m(),v(we.$$.fragment),Ve=m(),ne=i("p"),qe=a("\u3053\u308C\u3067 "),J=i("code"),Le=a("trainer.train()"),Ge=a(" \u3092\u5B9F\u884C\u3059\u308B\u6E96\u5099\u304C\u3067\u304D\u307E\u3057\u305F\u3002\u3057\u304B\u3057\u305D\u306E\u524D\u306B\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u6027\u80FD\u3092\u8A55\u4FA1\u3059\u308B\u4E00\u822C\u7684\u306A\u6307\u6A19\u3067\u3042\u308B "),Ne=i("em"),Je=a("\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"),Me=a(" \u306B\u3064\u3044\u3066\u7C21\u5358\u306B\u898B\u3066\u304A\u304D\u307E\u3057\u3087\u3046\u3002"),this.h()},l(z){o=p(z,"P",{});var V=_(o);h=l(V,"\u4E00\u5EA6\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u3089\u3001"),c=p(V,"CODE",{});var _s=_(c);w=l(_s,"Trainer"),_s.forEach(s),D=l(V," \u306E\u5F15\u6570\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002"),V.forEach(s),$=d(z),E(k.$$.fragment,z),q=d(z),u=p(z,"P",{});var de=_(u);T=l(de,"\u3053\u3053\u3067\u306F\u3001\u5404\u30A8\u30DD\u30C3\u30AF\u3067\u306E\u5B66\u7FD2\u640D\u5931\u3092\u78BA\u5B9F\u306B\u8FFD\u8DE1\u3059\u308B\u305F\u3081\u306B "),C=p(de,"CODE",{});var Qe=_(C);R=l(Qe,"logging_steps"),Qe.forEach(s),L=l(de," \u3092\u542B\u3080\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u5C11\u3057\u8ABF\u6574\u3057\u307E\u3057\u305F\u3002\u307E\u305F\u3001 "),N=p(de,"CODE",{});var Ue=_(N);F=l(Ue,"fp16=True"),Ue.forEach(s),B=l(de," \u3092\u4F7F\u7528\u3057\u3066\u3001\u6DF7\u5408\u7CBE\u5EA6\u306E\u5B66\u7FD2\u3092\u6709\u52B9\u306B\u3057\u3001\u3055\u3089\u306B\u9AD8\u901F\u5316\u3057\u307E\u3057\u305F\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001 "),H=p(de,"CODE",{});var cs=_(H);W=l(cs,"Trainer"),cs.forEach(s),j=l(de," \u306F\u30E2\u30C7\u30EB\u306E "),P=p(de,"CODE",{});var ns=_(P);se=l(ns,"forward()"),ns.forEach(s),G=l(de," \u30E1\u30BD\u30C3\u30C9\u306B\u542B\u307E\u308C\u306A\u3044\u5217\u3092\u3059\u3079\u3066\u524A\u9664\u3057\u307E\u3059\u3002\u3064\u307E\u308A\u3001\u5168\u5358\u8A9E\u30DE\u30B9\u30AF\u7528\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u3001 "),Z=p(de,"CODE",{});var fs=_(Z);Y=l(fs,"remove_unused_columns=False"),fs.forEach(s),he=l(de," \u3092\u8A2D\u5B9A\u3057\u3066\u3001\u5B66\u7FD2\u6642\u306B "),X=p(de,"CODE",{});var os=_(X);ie=l(os,"word_ids"),os.forEach(s),I=l(de," \u30AB\u30E9\u30E0\u304C\u5931\u308F\u308C\u306A\u3044\u3088\u3046\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),de.forEach(s),je=d(z),U=p(z,"P",{});var xe=_(U);Oe=l(xe,"\u306A\u304A\u3001 "),Q=p(xe,"CODE",{});var Xe=_(Q);le=l(Xe,"hub_model_id"),Xe.forEach(s),ce=l(xe," \u5F15\u6570\u3067\u30D7\u30C3\u30B7\u30E5\u5148\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u540D\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059 (\u7279\u306B\u3001\u7D44\u7E54\u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u5834\u5408\u306F\u3053\u306E\u5F15\u6570\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059)\u3002\u4F8B\u3048\u3070\u3001\u30E2\u30C7\u30EB\u3092 "),te=p(xe,"A",{href:!0,rel:!0});var Te=_(te);ge=p(Te,"CODE",{});var ue=_(ge);Be=l(ue,"huggingface-course"),ue.forEach(s),Ie=l(Te," organization"),Te.forEach(s),re=l(xe," \u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u5834\u5408\u3001 "),be=p(xe,"CODE",{});var ms=_(be);Fe=l(ms,"TrainingArguments"),ms.forEach(s),fe=l(xe," \u306B "),Ke=p(xe,"CODE",{});var Ze=_(Ke);ke=l(Ze,'hub_model_id="huggingface-course/distilbert-finetuned-imdb"'),Ze.forEach(s),De=l(xe," \u3092\u8FFD\u52A0\u3057\u3066\u3044\u307E\u3059\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u4F7F\u7528\u3059\u308B\u30EA\u30DD\u30B8\u30C8\u30EA\u306F\u3042\u306A\u305F\u306E\u540D\u524D\u7A7A\u9593\u5185\u306B\u3042\u308A\u3001\u8A2D\u5B9A\u3057\u305F\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3061\u306A\u3093\u3060\u540D\u524D\u306B\u306A\u308B\u306E\u3067\u3001\u79C1\u305F\u3061\u306E\u5834\u5408\u306F "),pe=p(xe,"CODE",{});var Ks=_(pe);ve=l(Ks,'"lewtun/distilbert-finetuned-imdb"'),Ks.forEach(s),$e=l(xe," \u3068\u306A\u308A\u307E\u3059\u3002"),xe.forEach(s),Ee=d(z),_e=p(z,"P",{});var es=_(_e);Re=l(es,"\u3053\u308C\u3067 "),me=p(es,"CODE",{});var ss=_(me);Ae=l(ss,"Trainer"),ss.forEach(s),ye=l(es," \u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u6750\u6599\u304C\u63C3\u3044\u307E\u3057\u305F\u3002\u3053\u3053\u3067\u306F\u3001\u6A19\u6E96\u7684\u306A "),S=p(es,"CODE",{});var ts=_(S);ee=l(ts,"data_collator"),ts.forEach(s),He=l(es," \u3092\u4F7F\u7528\u3057\u307E\u3059\u304C\u3001\u7DF4\u7FD2\u3068\u3057\u3066\u5168\u5358\u8A9E\u30DE\u30B9\u30AD\u30F3\u30B0\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u8A66\u3057\u3066\u3001\u7D50\u679C\u3092\u6BD4\u8F03\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),es.forEach(s),ae=d(z),E(we.$$.fragment,z),Ve=d(z),ne=p(z,"P",{});var oe=_(ne);qe=l(oe,"\u3053\u308C\u3067 "),J=p(oe,"CODE",{});var ds=_(J);Le=l(ds,"trainer.train()"),ds.forEach(s),Ge=l(oe," \u3092\u5B9F\u884C\u3059\u308B\u6E96\u5099\u304C\u3067\u304D\u307E\u3057\u305F\u3002\u3057\u304B\u3057\u305D\u306E\u524D\u306B\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u6027\u80FD\u3092\u8A55\u4FA1\u3059\u308B\u4E00\u822C\u7684\u306A\u6307\u6A19\u3067\u3042\u308B "),Ne=p(oe,"EM",{});var hs=_(Ne);Je=l(hs,"\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"),hs.forEach(s),Me=l(oe," \u306B\u3064\u3044\u3066\u7C21\u5358\u306B\u898B\u3066\u304A\u304D\u307E\u3057\u3087\u3046\u3002"),oe.forEach(s),this.h()},h(){A(te,"href","https://huggingface.co/huggingface-course"),A(te,"rel","nofollow")},m(z,V){n(z,o,V),t(o,h),t(o,c),t(c,w),t(o,D),n(z,$,V),y(k,z,V),n(z,q,V),n(z,u,V),t(u,T),t(u,C),t(C,R),t(u,L),t(u,N),t(N,F),t(u,B),t(u,H),t(H,W),t(u,j),t(u,P),t(P,se),t(u,G),t(u,Z),t(Z,Y),t(u,he),t(u,X),t(X,ie),t(u,I),n(z,je,V),n(z,U,V),t(U,Oe),t(U,Q),t(Q,le),t(U,ce),t(U,te),t(te,ge),t(ge,Be),t(te,Ie),t(U,re),t(U,be),t(be,Fe),t(U,fe),t(U,Ke),t(Ke,ke),t(U,De),t(U,pe),t(pe,ve),t(U,$e),n(z,Ee,V),n(z,_e,V),t(_e,Re),t(_e,me),t(me,Ae),t(_e,ye),t(_e,S),t(S,ee),t(_e,He),n(z,ae,V),y(we,z,V),n(z,Ve,V),n(z,ne,V),t(ne,qe),t(ne,J),t(J,Le),t(ne,Ge),t(ne,Ne),t(Ne,Je),t(ne,Me),Pe=!0},i(z){Pe||(g(k.$$.fragment,z),g(we.$$.fragment,z),Pe=!0)},o(z){b(k.$$.fragment,z),b(we.$$.fragment,z),Pe=!1},d(z){z&&s(o),z&&s($),x(k,z),z&&s(q),z&&s(u),z&&s(je),z&&s(U),z&&s(Ee),z&&s(_e),z&&s(ae),x(we,z),z&&s(Ve),z&&s(ne)}}}function om(K){let o,h,c,w,D,$,k,q,u,T,C,R,L,N,F,B,H,W,j,P,se,G,Z,Y,he,X,ie,I,je,U,Oe,Q,le,ce,te,ge,Be,Ie,re,be,Fe,fe,Ke,ke,De,pe,ve,$e,Ee,_e,Re,me,Ae,ye;return k=new M({props:{code:`tf_train_dataset = downsampled_dataset["train"].to_tf_dataset(
    columns=["input_ids", "attention_mask", "labels"],
    collate_fn=data_collator,
    shuffle=True,
    batch_size=32,
)

tf_eval_dataset = downsampled_dataset["test"].to_tf_dataset(
    columns=["input_ids", "attention_mask", "labels"],
    collate_fn=data_collator,
    shuffle=False,
    batch_size=32,
)`,highlighted:`tf_train_dataset = downsampled_dataset[<span class="hljs-string">&quot;train&quot;</span>].to_tf_dataset(
    columns=[<span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>],
    collate_fn=data_collator,
    shuffle=<span class="hljs-literal">True</span>,
    batch_size=<span class="hljs-number">32</span>,
)

tf_eval_dataset = downsampled_dataset[<span class="hljs-string">&quot;test&quot;</span>].to_tf_dataset(
    columns=[<span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>],
    collate_fn=data_collator,
    shuffle=<span class="hljs-literal">False</span>,
    batch_size=<span class="hljs-number">32</span>,
)`}}),ke=new M({props:{code:`from transformers import create_optimizer
from transformers.keras_callbacks import PushToHubCallback
import tensorflow as tf

num_train_steps = len(tf_train_dataset)
optimizer, schedule = create_optimizer(
    init_lr=2e-5,
    num_warmup_steps=1_000,
    num_train_steps=num_train_steps,
    weight_decay_rate=0.01,
)
model.compile(optimizer=optimizer)

# Train in mixed-precision float16
tf.keras.mixed_precision.set_global_policy("mixed_float16")

callback = PushToHubCallback(
    output_dir=f"{model_name}-finetuned-imdb", tokenizer=tokenizer
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer
<span class="hljs-keyword">from</span> transformers.keras_callbacks <span class="hljs-keyword">import</span> PushToHubCallback
<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

num_train_steps = <span class="hljs-built_in">len</span>(tf_train_dataset)
optimizer, schedule = create_optimizer(
    init_lr=<span class="hljs-number">2e-5</span>,
    num_warmup_steps=<span class="hljs-number">1_000</span>,
    num_train_steps=num_train_steps,
    weight_decay_rate=<span class="hljs-number">0.01</span>,
)
model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)

<span class="hljs-comment"># Train in mixed-precision float16</span>
tf.keras.mixed_precision.set_global_policy(<span class="hljs-string">&quot;mixed_float16&quot;</span>)

callback = PushToHubCallback(
    output_dir=<span class="hljs-string">f&quot;<span class="hljs-subst">{model_name}</span>-finetuned-imdb&quot;</span>, tokenizer=tokenizer
)`}}),{c(){o=i("p"),h=a("\u4E00\u5EA6\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u3089\u3001"),c=i("code"),w=a("tf.data"),D=a("\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u4F5C\u6210\u3059\u308B\u4E8B\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u3053\u3067\u306F\u6A19\u6E96\u7684\u306A\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u3044\u307E\u3059\u304C\u3001\u7DF4\u7FD2\u3068\u3057\u3066\u5168\u5358\u8A9E\u30DE\u30B9\u30AD\u30F3\u30B0\u306E\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u8A66\u3057\u3066\u7D50\u679C\u3092\u6BD4\u8F03\u3059\u308B\u3053\u3068\u3082\u53EF\u80FD\u3067\u3059\u3002"),$=m(),v(k.$$.fragment),q=m(),u=i("p"),T=a("\u6B21\u306B\u3001\u5B66\u7FD2\u7528\u30CF\u30A4\u30D1\u30FC\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u8A2D\u5B9A\u3057\u3001\u30E2\u30C7\u30EB\u3092\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u307E\u3059\u3002Transformers\u30E9\u30A4\u30D6\u30E9\u30EA\u306E "),C=i("code"),R=a("create_optimizer()"),L=a(" \u95A2\u6570\u3092\u4F7F\u7528\u3057\u3001\u5B66\u7FD2\u7387\u304C\u7DDA\u5F62\u306B\u6E1B\u8870\u3059\u308B\u6027\u8CEA\u3092\u6301\u3064 "),N=i("code"),F=a("AdamW"),B=a(" \u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u307E\u305F\u3001\u30E2\u30C7\u30EB\u306E\u7D44\u307F\u8FBC\u307F\u306E\u640D\u5931\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u3053\u308C\u306F "),H=i("code"),W=a("compile()"),j=a(" \u306E\u5F15\u6570\u306B\u640D\u5931\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u3042\u308A\u3001\u5B66\u7FD2\u7CBE\u5EA6\u306F "),P=i("code"),se=a('"mixed_float16"'),G=a(" \u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Colab\u3067\u5272\u308A\u5F53\u3066\u3089\u308C\u305FGPU\u3084\u304A\u4F7F\u3044\u306EGPU\u304Cfloat16\u306E\u30B5\u30DD\u30FC\u30C8\u3092\u3057\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u3001\u3053\u306E\u884C\u3092\u30B3\u30E1\u30F3\u30C8\u30A2\u30A6\u30C8\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),Z=m(),Y=i("p"),he=a("\u3055\u3089\u306B\u3001\u5404\u30A8\u30DD\u30C3\u30AF\u5F8C\u306B\u30E2\u30C7\u30EB\u3092\u30CF\u30D6\u306B\u4FDD\u5B58\u3059\u308B "),X=i("code"),ie=a("PushToHubCallback"),I=a(" \u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u307E\u3059\u3002"),je=i("code"),U=a("hub_model_id"),Oe=a(" \u5F15\u6570\u3067\u3001\u30D7\u30C3\u30B7\u30E5\u3057\u305F\u3044\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u540D\u524D\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\uFF08\u7279\u306B\u3001\u7D44\u7E54\u3092\u6307\u5B9A\u3057\u3066\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u5834\u5408\u306F\u3053\u306E\u5F15\u6570\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09\u3002\u4F8B\u3048\u3070\u3001\u30E2\u30C7\u30EB\u3092 "),Q=i("a"),le=i("code"),ce=a("huggingface-course"),te=a(" organization"),ge=a(" \u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u306B\u306F\u3001 "),Be=i("code"),Ie=a('hub_model_id="huggingface-course/distilbert-finetuned-imdb"'),re=a(" \u3092\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u4F7F\u7528\u3055\u308C\u308B\u30EA\u30DD\u30B8\u30C8\u30EA\u306F\u3042\u306A\u305F\u306E\u540D\u524D\u7A7A\u9593\u306B\u306A\u308A\u3001\u8A2D\u5B9A\u3055\u308C\u305F\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u540D\u524D\u306B\u306A\u308A\u307E\u3059\u3002\u305D\u306E\u305F\u3081\u3001\u79C1\u9054\u306E\u30B1\u30FC\u30B9\u3067\u306F"),be=i("code"),Fe=a('"lewtun/distilbert-finetuned-imdb"'),fe=a(" \u3068\u306A\u308B\u3067\u3057\u3087\u3046\u3002"),Ke=m(),v(ke.$$.fragment),De=m(),pe=i("p"),ve=a("\u3053\u308C\u3067 "),$e=i("code"),Ee=a("model.fit()"),_e=a(` \u3092\u5B9F\u884C\u3059\u308B\u6E96\u5099\u304C\u3067\u304D\u307E\u3057\u305F\u3002
\u3057\u304B\u3057\u3001\u3053\u308C\u3092\u5B9F\u884C\u3059\u308B\u524D\u306B\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u6027\u80FD\u3092\u8A55\u4FA1\u3059\u308B\u4E00\u822C\u7684\u306A\u6307\u6A19\u3067\u3042\u308B `),Re=i("em"),me=a("\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"),Ae=a(" \u306B\u3064\u3044\u3066\u7C21\u5358\u306B\u898B\u3066\u304A\u304D\u307E\u3057\u3087\u3046\u3002"),this.h()},l(S){o=p(S,"P",{});var ee=_(o);h=l(ee,"\u4E00\u5EA6\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u3089\u3001"),c=p(ee,"CODE",{});var He=_(c);w=l(He,"tf.data"),He.forEach(s),D=l(ee,"\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u4F5C\u6210\u3059\u308B\u4E8B\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u3053\u3067\u306F\u6A19\u6E96\u7684\u306A\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u3044\u307E\u3059\u304C\u3001\u7DF4\u7FD2\u3068\u3057\u3066\u5168\u5358\u8A9E\u30DE\u30B9\u30AD\u30F3\u30B0\u306E\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u8A66\u3057\u3066\u7D50\u679C\u3092\u6BD4\u8F03\u3059\u308B\u3053\u3068\u3082\u53EF\u80FD\u3067\u3059\u3002"),ee.forEach(s),$=d(S),E(k.$$.fragment,S),q=d(S),u=p(S,"P",{});var ae=_(u);T=l(ae,"\u6B21\u306B\u3001\u5B66\u7FD2\u7528\u30CF\u30A4\u30D1\u30FC\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u8A2D\u5B9A\u3057\u3001\u30E2\u30C7\u30EB\u3092\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u307E\u3059\u3002Transformers\u30E9\u30A4\u30D6\u30E9\u30EA\u306E "),C=p(ae,"CODE",{});var we=_(C);R=l(we,"create_optimizer()"),we.forEach(s),L=l(ae," \u95A2\u6570\u3092\u4F7F\u7528\u3057\u3001\u5B66\u7FD2\u7387\u304C\u7DDA\u5F62\u306B\u6E1B\u8870\u3059\u308B\u6027\u8CEA\u3092\u6301\u3064 "),N=p(ae,"CODE",{});var Ve=_(N);F=l(Ve,"AdamW"),Ve.forEach(s),B=l(ae," \u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u307E\u305F\u3001\u30E2\u30C7\u30EB\u306E\u7D44\u307F\u8FBC\u307F\u306E\u640D\u5931\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u3053\u308C\u306F "),H=p(ae,"CODE",{});var ne=_(H);W=l(ne,"compile()"),ne.forEach(s),j=l(ae," \u306E\u5F15\u6570\u306B\u640D\u5931\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u3042\u308A\u3001\u5B66\u7FD2\u7CBE\u5EA6\u306F "),P=p(ae,"CODE",{});var qe=_(P);se=l(qe,'"mixed_float16"'),qe.forEach(s),G=l(ae," \u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Colab\u3067\u5272\u308A\u5F53\u3066\u3089\u308C\u305FGPU\u3084\u304A\u4F7F\u3044\u306EGPU\u304Cfloat16\u306E\u30B5\u30DD\u30FC\u30C8\u3092\u3057\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u3001\u3053\u306E\u884C\u3092\u30B3\u30E1\u30F3\u30C8\u30A2\u30A6\u30C8\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),ae.forEach(s),Z=d(S),Y=p(S,"P",{});var J=_(Y);he=l(J,"\u3055\u3089\u306B\u3001\u5404\u30A8\u30DD\u30C3\u30AF\u5F8C\u306B\u30E2\u30C7\u30EB\u3092\u30CF\u30D6\u306B\u4FDD\u5B58\u3059\u308B "),X=p(J,"CODE",{});var Le=_(X);ie=l(Le,"PushToHubCallback"),Le.forEach(s),I=l(J," \u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u307E\u3059\u3002"),je=p(J,"CODE",{});var Ge=_(je);U=l(Ge,"hub_model_id"),Ge.forEach(s),Oe=l(J," \u5F15\u6570\u3067\u3001\u30D7\u30C3\u30B7\u30E5\u3057\u305F\u3044\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u540D\u524D\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\uFF08\u7279\u306B\u3001\u7D44\u7E54\u3092\u6307\u5B9A\u3057\u3066\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u5834\u5408\u306F\u3053\u306E\u5F15\u6570\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09\u3002\u4F8B\u3048\u3070\u3001\u30E2\u30C7\u30EB\u3092 "),Q=p(J,"A",{href:!0,rel:!0});var Ne=_(Q);le=p(Ne,"CODE",{});var Je=_(le);ce=l(Je,"huggingface-course"),Je.forEach(s),te=l(Ne," organization"),Ne.forEach(s),ge=l(J," \u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u306B\u306F\u3001 "),Be=p(J,"CODE",{});var Me=_(Be);Ie=l(Me,'hub_model_id="huggingface-course/distilbert-finetuned-imdb"'),Me.forEach(s),re=l(J," \u3092\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u4F7F\u7528\u3055\u308C\u308B\u30EA\u30DD\u30B8\u30C8\u30EA\u306F\u3042\u306A\u305F\u306E\u540D\u524D\u7A7A\u9593\u306B\u306A\u308A\u3001\u8A2D\u5B9A\u3055\u308C\u305F\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u540D\u524D\u306B\u306A\u308A\u307E\u3059\u3002\u305D\u306E\u305F\u3081\u3001\u79C1\u9054\u306E\u30B1\u30FC\u30B9\u3067\u306F"),be=p(J,"CODE",{});var Pe=_(be);Fe=l(Pe,'"lewtun/distilbert-finetuned-imdb"'),Pe.forEach(s),fe=l(J," \u3068\u306A\u308B\u3067\u3057\u3087\u3046\u3002"),J.forEach(s),Ke=d(S),E(ke.$$.fragment,S),De=d(S),pe=p(S,"P",{});var z=_(pe);ve=l(z,"\u3053\u308C\u3067 "),$e=p(z,"CODE",{});var V=_($e);Ee=l(V,"model.fit()"),V.forEach(s),_e=l(z,` \u3092\u5B9F\u884C\u3059\u308B\u6E96\u5099\u304C\u3067\u304D\u307E\u3057\u305F\u3002
\u3057\u304B\u3057\u3001\u3053\u308C\u3092\u5B9F\u884C\u3059\u308B\u524D\u306B\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u6027\u80FD\u3092\u8A55\u4FA1\u3059\u308B\u4E00\u822C\u7684\u306A\u6307\u6A19\u3067\u3042\u308B `),Re=p(z,"EM",{});var _s=_(Re);me=l(_s,"\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"),_s.forEach(s),Ae=l(z," \u306B\u3064\u3044\u3066\u7C21\u5358\u306B\u898B\u3066\u304A\u304D\u307E\u3057\u3087\u3046\u3002"),z.forEach(s),this.h()},h(){A(Q,"href","https://huggingface.co/huggingface-course"),A(Q,"rel","nofollow")},m(S,ee){n(S,o,ee),t(o,h),t(o,c),t(c,w),t(o,D),n(S,$,ee),y(k,S,ee),n(S,q,ee),n(S,u,ee),t(u,T),t(u,C),t(C,R),t(u,L),t(u,N),t(N,F),t(u,B),t(u,H),t(H,W),t(u,j),t(u,P),t(P,se),t(u,G),n(S,Z,ee),n(S,Y,ee),t(Y,he),t(Y,X),t(X,ie),t(Y,I),t(Y,je),t(je,U),t(Y,Oe),t(Y,Q),t(Q,le),t(le,ce),t(Q,te),t(Y,ge),t(Y,Be),t(Be,Ie),t(Y,re),t(Y,be),t(be,Fe),t(Y,fe),n(S,Ke,ee),y(ke,S,ee),n(S,De,ee),n(S,pe,ee),t(pe,ve),t(pe,$e),t($e,Ee),t(pe,_e),t(pe,Re),t(Re,me),t(pe,Ae),ye=!0},i(S){ye||(g(k.$$.fragment,S),g(ke.$$.fragment,S),ye=!0)},o(S){b(k.$$.fragment,S),b(ke.$$.fragment,S),ye=!1},d(S){S&&s(o),S&&s($),x(k,S),S&&s(q),S&&s(u),S&&s(Z),S&&s(Y),S&&s(Ke),x(ke,S),S&&s(De),S&&s(pe)}}}function im(K){let o,h,c,w,D,$,k,q;return k=new M({props:{code:`import math

eval_loss = model.evaluate(tf_eval_dataset)
print(f"Perplexity: {math.exp(eval_loss):.2f}")`,highlighted:`<span class="hljs-keyword">import</span> math

eval_loss = model.evaluate(tf_eval_dataset)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Perplexity: <span class="hljs-subst">{math.exp(eval_loss):<span class="hljs-number">.2</span>f}</span>&quot;</span>)`}}),{c(){o=i("p"),h=a("\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306E\u307B\u3068\u3093\u3069\u304C\u6587\u6CD5\u7684\u306B\u6B63\u3057\u3044\u6587\u7AE0\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u3068\u4EEE\u5B9A\u3059\u308B\u3068\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u54C1\u8CEA\u3092\u6E2C\u5B9A\u3059\u308B\u4E00\u3064\u306E\u65B9\u6CD5\u306F\u3001\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306E\u3059\u3079\u3066\u306E\u6587\u7AE0\u3067\u6B21\u306E\u5358\u8A9E\u304C\u6B63\u3057\u304F\u5272\u308A\u5F53\u3066\u308B\u78BA\u7387\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u78BA\u7387\u304C\u9AD8\u3044\u3068\u3044\u3046\u3053\u3068\u306F\u3001\u30E2\u30C7\u30EB\u304C\u672A\u898B\u306E\u4F8B\u6587\u306B\u300C\u9A5A\u304D\u300D\u300C\u5F53\u60D1\u300D\u3057\u3066\u3044\u306A\u3044\u3053\u3068\u3092\u793A\u3057\u3001\u305D\u306E\u8A00\u8A9E\u306E\u6587\u6CD5\u306E\u57FA\u672C\u30D1\u30BF\u30FC\u30F3\u3092\u5B66\u7FD2\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u793A\u5506\u3057\u3066\u3044\u307E\u3059\u3002\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u306B\u306F\u69D8\u3005\u306A\u6570\u5B66\u7684\u5B9A\u7FA9\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u79C1\u9054\u304C\u4F7F\u3046\u306E\u306F\u30AF\u30ED\u30B9\u30A8\u30F3\u30C8\u30ED\u30D4\u30FC\u306E\u640D\u5931\u306E\u6307\u6570\u3068\u3057\u3066\u5B9A\u7FA9\u3059\u308B\u3082\u306E\u3067\u3059\u3002\u3057\u305F\u304C\u3063\u3066\u3001"),c=i("code"),w=a("model.evaluate()"),D=a(" \u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u3063\u3066\u30C6\u30B9\u30C8\u96C6\u5408\u306E\u30AF\u30ED\u30B9\u30A8\u30F3\u30C8\u30ED\u30D4\u30FC\u640D\u5931\u3092\u8A08\u7B97\u3057\u3001\u305D\u306E\u7D50\u679C\u306E\u6307\u6570\u3092\u53D6\u308B\u3053\u3068\u3067\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u3067\u3059\u3002"),$=m(),v(k.$$.fragment)},l(u){o=p(u,"P",{});var T=_(o);h=l(T,"\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306E\u307B\u3068\u3093\u3069\u304C\u6587\u6CD5\u7684\u306B\u6B63\u3057\u3044\u6587\u7AE0\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u3068\u4EEE\u5B9A\u3059\u308B\u3068\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u54C1\u8CEA\u3092\u6E2C\u5B9A\u3059\u308B\u4E00\u3064\u306E\u65B9\u6CD5\u306F\u3001\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306E\u3059\u3079\u3066\u306E\u6587\u7AE0\u3067\u6B21\u306E\u5358\u8A9E\u304C\u6B63\u3057\u304F\u5272\u308A\u5F53\u3066\u308B\u78BA\u7387\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u78BA\u7387\u304C\u9AD8\u3044\u3068\u3044\u3046\u3053\u3068\u306F\u3001\u30E2\u30C7\u30EB\u304C\u672A\u898B\u306E\u4F8B\u6587\u306B\u300C\u9A5A\u304D\u300D\u300C\u5F53\u60D1\u300D\u3057\u3066\u3044\u306A\u3044\u3053\u3068\u3092\u793A\u3057\u3001\u305D\u306E\u8A00\u8A9E\u306E\u6587\u6CD5\u306E\u57FA\u672C\u30D1\u30BF\u30FC\u30F3\u3092\u5B66\u7FD2\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u793A\u5506\u3057\u3066\u3044\u307E\u3059\u3002\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u306B\u306F\u69D8\u3005\u306A\u6570\u5B66\u7684\u5B9A\u7FA9\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u79C1\u9054\u304C\u4F7F\u3046\u306E\u306F\u30AF\u30ED\u30B9\u30A8\u30F3\u30C8\u30ED\u30D4\u30FC\u306E\u640D\u5931\u306E\u6307\u6570\u3068\u3057\u3066\u5B9A\u7FA9\u3059\u308B\u3082\u306E\u3067\u3059\u3002\u3057\u305F\u304C\u3063\u3066\u3001"),c=p(T,"CODE",{});var C=_(c);w=l(C,"model.evaluate()"),C.forEach(s),D=l(T," \u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u3063\u3066\u30C6\u30B9\u30C8\u96C6\u5408\u306E\u30AF\u30ED\u30B9\u30A8\u30F3\u30C8\u30ED\u30D4\u30FC\u640D\u5931\u3092\u8A08\u7B97\u3057\u3001\u305D\u306E\u7D50\u679C\u306E\u6307\u6570\u3092\u53D6\u308B\u3053\u3068\u3067\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u3067\u3059\u3002"),T.forEach(s),$=d(u),E(k.$$.fragment,u)},m(u,T){n(u,o,T),t(o,h),t(o,c),t(c,w),t(o,D),n(u,$,T),y(k,u,T),q=!0},i(u){q||(g(k.$$.fragment,u),q=!0)},o(u){b(k.$$.fragment,u),q=!1},d(u){u&&s(o),u&&s($),x(k,u)}}}function pm(K){let o,h,c,w,D,$,k,q;return k=new M({props:{code:`import math

eval_results = trainer.evaluate()
print(f">>> Perplexity: {math.exp(eval_results['eval_loss']):.2f}")`,highlighted:`<span class="hljs-keyword">import</span> math

eval_results = trainer.evaluate()
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&gt;&gt;&gt; Perplexity: <span class="hljs-subst">{math.exp(eval_results[<span class="hljs-string">&#x27;eval_loss&#x27;</span>]):<span class="hljs-number">.2</span>f}</span>&quot;</span>)`}}),{c(){o=i("p"),h=a("\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306E\u307B\u3068\u3093\u3069\u304C\u6587\u6CD5\u7684\u306B\u6B63\u3057\u3044\u6587\u3067\u3042\u308B\u3068\u4EEE\u5B9A\u3059\u308B\u3068\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u54C1\u8CEA\u3092\u6E2C\u308B\u4E00\u3064\u306E\u65B9\u6CD5\u306F\u3001\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306E\u3059\u3079\u3066\u306E\u6587\u306B\u304A\u3044\u3066\u3001\u6B21\u306B\u51FA\u73FE\u3059\u308B\u5358\u8A9E\u3092\u6B63\u3057\u304F\u5272\u308A\u5F53\u3066\u308B\u78BA\u7387\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u78BA\u7387\u304C\u9AD8\u3044\u3068\u3044\u3046\u3053\u3068\u306F\u3001\u30E2\u30C7\u30EB\u304C\u672A\u77E5\u306E\u4F8B\u6587\u306B\u300C\u9A5A\u304D\u300D\u3084\u300C\u5F53\u60D1\u300D\u3092\u611F\u3058\u3066\u3044\u306A\u3044\u3053\u3068\u3092\u793A\u3057\u3001\u305D\u306E\u8A00\u8A9E\u306E\u6587\u6CD5\u306E\u57FA\u672C\u30D1\u30BF\u30FC\u30F3\u3092\u5B66\u7FD2\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u793A\u5506\u3057\u3066\u3044\u307E\u3059\u3002\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u306B\u306F\u69D8\u3005\u306A\u6570\u5B66\u7684\u5B9A\u7FA9\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u79C1\u9054\u304C\u4F7F\u3046\u306E\u306F\u30AF\u30ED\u30B9\u30A8\u30F3\u30C8\u30ED\u30D4\u30FC\u640D\u5931\u306E\u6307\u6570\u3068\u3057\u3066\u5B9A\u7FA9\u3059\u308B\u3082\u306E\u3067\u3059\u3002\u3057\u305F\u304C\u3063\u3066\u3001"),c=i("code"),w=a("Trainer.evaluate()"),D=a("\u95A2\u6570\u3092\u4F7F\u3063\u3066\u30C6\u30B9\u30C8\u96C6\u5408\u306E\u30AF\u30ED\u30B9\u30A8\u30F3\u30C8\u30ED\u30D4\u30FC\u640D\u5931\u3092\u8A08\u7B97\u3057\u3001\u305D\u306E\u7D50\u679C\u306E\u6307\u6570\u3092\u53D6\u308B\u3053\u3068\u3067\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u3067\u3059\u3002"),$=m(),v(k.$$.fragment)},l(u){o=p(u,"P",{});var T=_(o);h=l(T,"\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306E\u307B\u3068\u3093\u3069\u304C\u6587\u6CD5\u7684\u306B\u6B63\u3057\u3044\u6587\u3067\u3042\u308B\u3068\u4EEE\u5B9A\u3059\u308B\u3068\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u54C1\u8CEA\u3092\u6E2C\u308B\u4E00\u3064\u306E\u65B9\u6CD5\u306F\u3001\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306E\u3059\u3079\u3066\u306E\u6587\u306B\u304A\u3044\u3066\u3001\u6B21\u306B\u51FA\u73FE\u3059\u308B\u5358\u8A9E\u3092\u6B63\u3057\u304F\u5272\u308A\u5F53\u3066\u308B\u78BA\u7387\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u78BA\u7387\u304C\u9AD8\u3044\u3068\u3044\u3046\u3053\u3068\u306F\u3001\u30E2\u30C7\u30EB\u304C\u672A\u77E5\u306E\u4F8B\u6587\u306B\u300C\u9A5A\u304D\u300D\u3084\u300C\u5F53\u60D1\u300D\u3092\u611F\u3058\u3066\u3044\u306A\u3044\u3053\u3068\u3092\u793A\u3057\u3001\u305D\u306E\u8A00\u8A9E\u306E\u6587\u6CD5\u306E\u57FA\u672C\u30D1\u30BF\u30FC\u30F3\u3092\u5B66\u7FD2\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u793A\u5506\u3057\u3066\u3044\u307E\u3059\u3002\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u306B\u306F\u69D8\u3005\u306A\u6570\u5B66\u7684\u5B9A\u7FA9\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u79C1\u9054\u304C\u4F7F\u3046\u306E\u306F\u30AF\u30ED\u30B9\u30A8\u30F3\u30C8\u30ED\u30D4\u30FC\u640D\u5931\u306E\u6307\u6570\u3068\u3057\u3066\u5B9A\u7FA9\u3059\u308B\u3082\u306E\u3067\u3059\u3002\u3057\u305F\u304C\u3063\u3066\u3001"),c=p(T,"CODE",{});var C=_(c);w=l(C,"Trainer.evaluate()"),C.forEach(s),D=l(T,"\u95A2\u6570\u3092\u4F7F\u3063\u3066\u30C6\u30B9\u30C8\u96C6\u5408\u306E\u30AF\u30ED\u30B9\u30A8\u30F3\u30C8\u30ED\u30D4\u30FC\u640D\u5931\u3092\u8A08\u7B97\u3057\u3001\u305D\u306E\u7D50\u679C\u306E\u6307\u6570\u3092\u53D6\u308B\u3053\u3068\u3067\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u3067\u3059\u3002"),T.forEach(s),$=d(u),E(k.$$.fragment,u)},m(u,T){n(u,o,T),t(o,h),t(o,c),t(c,w),t(o,D),n(u,$,T),y(k,u,T),q=!0},i(u){q||(g(k.$$.fragment,u),q=!0)},o(u){b(k.$$.fragment,u),q=!1},d(u){u&&s(o),u&&s($),x(k,u)}}}function _m(K){let o,h;return o=new M({props:{code:"model.fit(tf_train_dataset, validation_data=tf_eval_dataset, callbacks=[callback])",highlighted:"model.fit(tf_train_dataset, validation_data=tf_eval_dataset, callbacks=[callback])"}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function cm(K){let o,h;return o=new M({props:{code:"trainer.train()",highlighted:"trainer.train()"}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function fm(K){let o,h;return o=new M({props:{code:`eval_loss = model.evaluate(tf_eval_dataset)
print(f"Perplexity: {math.exp(eval_loss):.2f}")`,highlighted:`eval_loss = model.evaluate(tf_eval_dataset)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Perplexity: <span class="hljs-subst">{math.exp(eval_loss):<span class="hljs-number">.2</span>f}</span>&quot;</span>)`}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function mm(K){let o,h;return o=new M({props:{code:`eval_results = trainer.evaluate()
print(f">>> Perplexity: {math.exp(eval_results['eval_loss']):.2f}")`,highlighted:`eval_results = trainer.evaluate()
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&gt;&gt;&gt; Perplexity: <span class="hljs-subst">{math.exp(eval_results[<span class="hljs-string">&#x27;eval_loss&#x27;</span>]):<span class="hljs-number">.2</span>f}</span>&quot;</span>)`}}),{c(){v(o.$$.fragment)},l(c){E(o.$$.fragment,c)},m(c,w){y(o,c,w),h=!0},i(c){h||(g(o.$$.fragment,c),h=!0)},o(c){b(o.$$.fragment,c),h=!1},d(c){x(o,c)}}}function Of(K){let o,h,c,w,D;return w=new M({props:{code:"trainer.push_to_hub()",highlighted:"trainer.push_to_hub()"}}),{c(){o=i("p"),h=a("\u4E00\u5EA6\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u304C\u7D42\u4E86\u3057\u305F\u3089\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u60C5\u5831\u304C\u5165\u3063\u305F\u30E2\u30C7\u30EB\u30AB\u30FC\u30C9\u3092Hub\u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u4E8B\u304C\u3067\u304D\u307E\u3059\u3002\uFF08\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u306F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u306E\u6700\u4E2D\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3059\uFF09\u3002"),c=m(),v(w.$$.fragment)},l($){o=p($,"P",{});var k=_(o);h=l(k,"\u4E00\u5EA6\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u304C\u7D42\u4E86\u3057\u305F\u3089\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u60C5\u5831\u304C\u5165\u3063\u305F\u30E2\u30C7\u30EB\u30AB\u30FC\u30C9\u3092Hub\u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u4E8B\u304C\u3067\u304D\u307E\u3059\u3002\uFF08\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u306F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u306E\u6700\u4E2D\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3059\uFF09\u3002"),k.forEach(s),c=d($),E(w.$$.fragment,$)},m($,k){n($,o,k),t(o,h),n($,c,k),y(w,$,k),D=!0},i($){D||(g(w.$$.fragment,$),D=!0)},o($){b(w.$$.fragment,$),D=!1},d($){$&&s(o),$&&s(c),x(w,$)}}}function dm(K){let o,h,c,w,D;return{c(){o=i("p"),h=a("\u270F\uFE0F "),c=i("strong"),w=a("\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),D=a(" \u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u5168\u5358\u8A9E\u30DE\u30B9\u30AD\u30F3\u30B0\u30B3\u30EC\u30FC\u30BF\u30FC\u306B\u5909\u3048\u3066\u3001\u4E0A\u8A18\u306E\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u5B9F\u884C\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u3088\u308A\u826F\u3044\u7D50\u679C\u304C\u5F97\u3089\u308C\u307E\u3057\u305F\u304B\uFF1F")},l($){o=p($,"P",{});var k=_(o);h=l(k,"\u270F\uFE0F "),c=p(k,"STRONG",{});var q=_(c);w=l(q,"\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),q.forEach(s),D=l(k," \u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u5168\u5358\u8A9E\u30DE\u30B9\u30AD\u30F3\u30B0\u30B3\u30EC\u30FC\u30BF\u30FC\u306B\u5909\u3048\u3066\u3001\u4E0A\u8A18\u306E\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u5B9F\u884C\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u3088\u308A\u826F\u3044\u7D50\u679C\u304C\u5F97\u3089\u308C\u307E\u3057\u305F\u304B\uFF1F"),k.forEach(s)},m($,k){n($,o,k),t(o,h),t(o,c),t(c,w),t(o,D)},d($){$&&s(o)}}}function Kf(K){let o,h,c,w,D,$,k,q,u,T,C,R,L,N,F,B,H,W,j,P,se,G,Z,Y,he,X,ie,I,je,U,Oe,Q,le,ce,te,ge,Be,Ie,re,be,Fe,fe,Ke,ke,De,pe,ve,$e,Ee,_e,Re,me,Ae,ye,S,ee,He,ae,we,Ve,ne,qe,J,Le,Ge,Ne,Je,Me,Pe,z,V,_s,de,Qe,Ue,cs,ns,fs,os,xe,Xe,Te,ue,ms,Ze,Ks,es,ss,ts,oe,ds,hs,at,Es,gs,ys,lt,is,St,rt;return k=new Rf({}),Q=new M({props:{code:`def insert_random_mask(batch):
    features = [dict(zip(batch, t)) for t in zip(*batch.values())]
    masked_inputs = data_collator(features)
    # Create a new "masked" column for each column in the dataset
    return {"masked_" + k: v.numpy() for k, v in masked_inputs.items()}`,highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">insert_random_mask</span>(<span class="hljs-params">batch</span>):
    features = [<span class="hljs-built_in">dict</span>(<span class="hljs-built_in">zip</span>(batch, t)) <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(*batch.values())]
    masked_inputs = data_collator(features)
    <span class="hljs-comment"># Create a new &quot;masked&quot; column for each column in the dataset</span>
    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;masked_&quot;</span> + k: v.numpy() <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> masked_inputs.items()}`}}),be=new M({props:{code:`downsampled_dataset = downsampled_dataset.remove_columns(["word_ids"])
eval_dataset = downsampled_dataset["test"].map(
    insert_random_mask,
    batched=True,
    remove_columns=downsampled_dataset["test"].column_names,
)
eval_dataset = eval_dataset.rename_columns(
    {
        "masked_input_ids": "input_ids",
        "masked_attention_mask": "attention_mask",
        "masked_labels": "labels",
    }
)`,highlighted:`downsampled_dataset = downsampled_dataset.remove_columns([<span class="hljs-string">&quot;word_ids&quot;</span>])
eval_dataset = downsampled_dataset[<span class="hljs-string">&quot;test&quot;</span>].<span class="hljs-built_in">map</span>(
    insert_random_mask,
    batched=<span class="hljs-literal">True</span>,
    remove_columns=downsampled_dataset[<span class="hljs-string">&quot;test&quot;</span>].column_names,
)
eval_dataset = eval_dataset.rename_columns(
    {
        <span class="hljs-string">&quot;masked_input_ids&quot;</span>: <span class="hljs-string">&quot;input_ids&quot;</span>,
        <span class="hljs-string">&quot;masked_attention_mask&quot;</span>: <span class="hljs-string">&quot;attention_mask&quot;</span>,
        <span class="hljs-string">&quot;masked_labels&quot;</span>: <span class="hljs-string">&quot;labels&quot;</span>,
    }
)`}}),$e=new M({props:{code:`from torch.utils.data import DataLoader
from transformers import default_data_collator

batch_size = 64
train_dataloader = DataLoader(
    downsampled_dataset["train"],
    shuffle=True,
    batch_size=batch_size,
    collate_fn=data_collator,
)
eval_dataloader = DataLoader(
    eval_dataset, batch_size=batch_size, collate_fn=default_data_collator
)`,highlighted:`<span class="hljs-keyword">from</span> torch.utils.data <span class="hljs-keyword">import</span> DataLoader
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> default_data_collator

batch_size = <span class="hljs-number">64</span>
train_dataloader = DataLoader(
    downsampled_dataset[<span class="hljs-string">&quot;train&quot;</span>],
    shuffle=<span class="hljs-literal">True</span>,
    batch_size=batch_size,
    collate_fn=data_collator,
)
eval_dataloader = DataLoader(
    eval_dataset, batch_size=batch_size, collate_fn=default_data_collator
)`}}),Ae=new M({props:{code:"model = AutoModelForMaskedLM.from_pretrained(model_checkpoint)",highlighted:'model = <span class="hljs-module-access"><span class="hljs-module"><span class="hljs-identifier">AutoModelForMaskedLM</span>.</span></span>from<span class="hljs-constructor">_pretrained(<span class="hljs-params">model_checkpoint</span>)</span>'}}),ne=new M({props:{code:`from torch.optim import AdamW

optimizer = AdamW(model.parameters(), lr=5e-5)`,highlighted:`<span class="hljs-keyword">from</span> torch.optim <span class="hljs-keyword">import</span> AdamW

optimizer = AdamW(model.parameters(), lr=<span class="hljs-number">5e-5</span>)`}}),Pe=new M({props:{code:`from accelerate import Accelerator

accelerator = Accelerator()
model, optimizer, train_dataloader, eval_dataloader = accelerator.prepare(
    model, optimizer, train_dataloader, eval_dataloader
)`,highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator

accelerator = Accelerator()
model, optimizer, train_dataloader, eval_dataloader = accelerator.prepare(
    model, optimizer, train_dataloader, eval_dataloader
)`}}),Qe=new M({props:{code:`from transformers import get_scheduler

num_train_epochs = 3
num_update_steps_per_epoch = len(train_dataloader)
num_training_steps = num_train_epochs * num_update_steps_per_epoch

lr_scheduler = get_scheduler(
    "linear",
    optimizer=optimizer,
    num_warmup_steps=0,
    num_training_steps=num_training_steps,
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> get_scheduler

num_train_epochs = <span class="hljs-number">3</span>
num_update_steps_per_epoch = <span class="hljs-built_in">len</span>(train_dataloader)
num_training_steps = num_train_epochs * num_update_steps_per_epoch

lr_scheduler = get_scheduler(
    <span class="hljs-string">&quot;linear&quot;</span>,
    optimizer=optimizer,
    num_warmup_steps=<span class="hljs-number">0</span>,
    num_training_steps=num_training_steps,
)`}}),os=new M({props:{code:`from huggingface_hub import get_full_repo_name

model_name = "distilbert-base-uncased-finetuned-imdb-accelerate"
repo_name = get_full_repo_name(model_name)
repo_name`,highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> get_full_repo_name

model_name = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-imdb-accelerate&quot;</span>
repo_name = get_full_repo_name(model_name)
repo_name`}}),Xe=new M({props:{code:"'lewtun/distilbert-base-uncased-finetuned-imdb-accelerate'",highlighted:'<span class="hljs-string">&#x27;lewtun/distilbert-base-uncased-finetuned-imdb-accelerate&#x27;</span>'}}),ts=new M({props:{code:`from huggingface_hub import Repository

output_dir = model_name
repo = Repository(output_dir, clone_from=repo_name)`,highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository

output_dir = model_name
repo = Repository(output_dir, clone_from=repo_name)`}}),Es=new M({props:{code:`from tqdm.auto import tqdm
import torch
import math

progress_bar = tqdm(range(num_training_steps))

for epoch in range(num_train_epochs):
    # Training
    model.train()
    for batch in train_dataloader:
        outputs = model(**batch)
        loss = outputs.loss
        accelerator.backward(loss)

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(1)

    # Evaluation
    model.eval()
    losses = []
    for step, batch in enumerate(eval_dataloader):
        with torch.no_grad():
            outputs = model(**batch)

        loss = outputs.loss
        losses.append(accelerator.gather(loss.repeat(batch_size)))

    losses = torch.cat(losses)
    losses = losses[: len(eval_dataset)]
    try:
        perplexity = math.exp(torch.mean(losses))
    except OverflowError:
        perplexity = float("inf")

    print(f">>> Epoch {epoch}: Perplexity: {perplexity}")

    # Save and upload
    accelerator.wait_for_everyone()
    unwrapped_model = accelerator.unwrap_model(model)
    unwrapped_model.save_pretrained(output_dir, save_function=accelerator.save)
    if accelerator.is_main_process:
        tokenizer.save_pretrained(output_dir)
        repo.push_to_hub(
            commit_message=f"Training in progress epoch {epoch}", blocking=False
        )`,highlighted:`<span class="hljs-keyword">from</span> tqdm.auto <span class="hljs-keyword">import</span> tqdm
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> math

progress_bar = tqdm(<span class="hljs-built_in">range</span>(num_training_steps))

<span class="hljs-keyword">for</span> epoch <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_train_epochs):
    <span class="hljs-comment"># Training</span>
    model.train()
    <span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dataloader:
        outputs = model(**batch)
        loss = outputs.loss
        accelerator.backward(loss)

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(<span class="hljs-number">1</span>)

    <span class="hljs-comment"># Evaluation</span>
    model.<span class="hljs-built_in">eval</span>()
    losses = []
    <span class="hljs-keyword">for</span> step, batch <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(eval_dataloader):
        <span class="hljs-keyword">with</span> torch.no_grad():
            outputs = model(**batch)

        loss = outputs.loss
        losses.append(accelerator.gather(loss.repeat(batch_size)))

    losses = torch.cat(losses)
    losses = losses[: <span class="hljs-built_in">len</span>(eval_dataset)]
    <span class="hljs-keyword">try</span>:
        perplexity = math.exp(torch.mean(losses))
    <span class="hljs-keyword">except</span> OverflowError:
        perplexity = <span class="hljs-built_in">float</span>(<span class="hljs-string">&quot;inf&quot;</span>)

    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&gt;&gt;&gt; Epoch <span class="hljs-subst">{epoch}</span>: Perplexity: <span class="hljs-subst">{perplexity}</span>&quot;</span>)

    <span class="hljs-comment"># Save and upload</span>
    accelerator.wait_for_everyone()
    unwrapped_model = accelerator.unwrap_model(model)
    unwrapped_model.save_pretrained(output_dir, save_function=accelerator.save)
    <span class="hljs-keyword">if</span> accelerator.is_main_process:
        tokenizer.save_pretrained(output_dir)
        repo.push_to_hub(
            commit_message=<span class="hljs-string">f&quot;Training in progress epoch <span class="hljs-subst">{epoch}</span>&quot;</span>, blocking=<span class="hljs-literal">False</span>
        )`}}),ys=new M({props:{code:`Epoch 0: Perplexity: 11.397545307900472
Epoch 1: Perplexity: 10.904909330983092
Epoch 2: Perplexity: 10.729503505340409`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>Epoch <span class="hljs-number">0</span>: Perplexity: <span class="hljs-number">11.397545307900472</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>Epoch <span class="hljs-number">1</span>: Perplexity: <span class="hljs-number">10.904909330983092</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>Epoch <span class="hljs-number">2</span>: Perplexity: <span class="hljs-number">10.729503505340409</span>`}}),{c(){o=i("p"),h=a(`\u4ECA\u56DE\u306E\u4F7F\u7528\u4F8B\u3067\u306F\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30EB\u30FC\u30D7\u306B\u7279\u5225\u306A\u3053\u3068\u3092\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u304C\u3001\u5834\u5408\u306B\u3088\u3063\u3066\u306F\u30AB\u30B9\u30BF\u30E0\u30ED\u30B8\u30C3\u30AF\u3092\u5B9F\u88C5\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093\u3002\u305D\u306E\u3088\u3046\u306A\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3067\u306F\u3001\u{1F917} Accelerate\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002
\u898B\u3066\u307F\u307E\u3057\u3087\u3046!`),c=m(),w=i("h2"),D=i("a"),$=i("span"),v(k.$$.fragment),q=m(),u=i("span"),T=a("DistilBERT\u3092\u{1F917} Accelerate\u3092\u4F7F\u3063\u3066\u5FAE\u8ABF\u6574\u3059\u308B"),C=m(),R=i("p"),L=i("code"),N=a("Trainer"),F=a("\u3067\u898B\u305F\u3088\u3046\u306B\u3001\u30DE\u30B9\u30AF\u3055\u308C\u305F\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574\u306F"),B=i("a"),H=a("\u7B2C3\u7AE0"),W=a("\u306E\u30C6\u30AD\u30B9\u30C8\u5206\u985E\u306E\u4F8B\u3068\u975E\u5E38\u306B\u3088\u304F\u4F3C\u3066\u3044\u307E\u3059\u3002\u5B9F\u969B\u3001\u552F\u4E00\u306E\u308F\u305A\u304B\u306A\u9055\u3044\u306F\u7279\u5225\u306A\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u3046\u3053\u3068\u3067\u3001\u305D\u308C\u306F\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u524D\u534A\u3067\u3059\u3067\u306B\u53D6\u308A\u4E0A\u3052\u307E\u3057\u305F!"),j=m(),P=i("p"),se=a("\u3057\u304B\u3057\u3001"),G=i("code"),Z=a("DataCollatorForLanguageModeling"),Y=a("\u306F\u8A55\u4FA1\u3054\u3068\u306B\u30E9\u30F3\u30C0\u30E0\u306A\u30DE\u30B9\u30AD\u30F3\u30B0\u3092\u884C\u3046\u306E\u3067\u3001\u5B66\u7FD2\u5B9F\u884C\u3054\u3068\u306B\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u30B9\u30B3\u30A2\u306B\u591A\u5C11\u306E\u5909\u52D5\u304C\u898B\u3089\u308C\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3057\u305F\u3002\u3053\u306E\u30E9\u30F3\u30C0\u30E0\u6027\u3092\u6392\u9664\u3059\u308B\u4E00\u3064\u306E\u65B9\u6CD5\u306F\u3001\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u5168\u4F53\u306B "),he=i("em"),X=a("\u4E00\u5EA6\u3060\u3051"),ie=a(" \u30DE\u30B9\u30AD\u30F3\u30B0\u3092\u9069\u7528\u3057\u3001\u305D\u306E\u5F8C\u{1F917} Transformers\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u7528\u3057\u3066\u3001\u8A55\u4FA1\u4E2D\u306B\u30D0\u30C3\u30C1\u3092\u53CE\u96C6\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u3053\u308C\u304C\u3069\u306E\u3088\u3046\u306B\u6A5F\u80FD\u3059\u308B\u304B\u3092\u898B\u308B\u305F\u3081\u306B\u3001"),I=i("code"),je=a("DataCollatorForLanguageModeling"),U=a(" \u3092\u6700\u521D\u306B\u4F7F\u3063\u305F\u6642\u3068\u540C\u69D8\u306B\u3001\u30D0\u30C3\u30C1\u306B\u30DE\u30B9\u30AD\u30F3\u30B0\u3092\u9069\u7528\u3059\u308B\u7C21\u5358\u306A\u95A2\u6570\u3092\u5B9F\u88C5\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Oe=m(),v(Q.$$.fragment),le=m(),ce=i("p"),te=a("\u6B21\u306B\u3001\u3053\u306E\u95A2\u6570\u3092\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306B\u9069\u7528\u3057\u3066\u3001\u30DE\u30B9\u30AF\u3055\u308C\u3066\u3044\u306A\u3044\u30AB\u30E9\u30E0\u3092\u524A\u9664\u3057\u3001\u30DE\u30B9\u30AF\u3055\u308C\u305F\u30AB\u30E9\u30E0\u306B\u7F6E\u304D\u63DB\u3048\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u4E0A\u306E "),ge=i("code"),Be=a("data_collator"),Ie=a(` \u3092\u9069\u5207\u306A\u3082\u306E\u306B\u7F6E\u304D\u63DB\u3048\u308B\u3053\u3068\u3067\u3001\u5168\u5358\u8A9E\u5358\u4F4D\u3067\u306E\u30DE\u30B9\u30AD\u30F3\u30B0\u3092\u884C\u3046\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002
\u305D\u306E\u5834\u5408\u306F\u3001\u4EE5\u4E0B\u306E\u6700\u521D\u306E\u884C\u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),re=m(),v(be.$$.fragment),Fe=m(),fe=i("p"),Ke=a("\u3042\u3068\u306F\u901A\u5E38\u901A\u308A\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u307E\u3059\u304C\u3001\u3053\u3053\u3067\u306F\u8A55\u4FA1\u30BB\u30C3\u30C8\u306B \u{1F917} Transformers \u306E "),ke=i("code"),De=a("default_data_collator"),pe=a(" \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002"),ve=m(),v($e.$$.fragment),Ee=m(),_e=i("p"),Re=a("\u3053\u3053\u3067\u306F\u3001\u{1F917} Accelerate\u3092\u4F7F\u3063\u305F\u6A19\u6E96\u7684\u306A\u30B9\u30C6\u30C3\u30D7\u306B\u5F93\u3044\u307E\u3059\u3002\u6700\u521D\u306B\u3084\u308B\u4E8B\u306F\u3001\u4E8B\u524D\u5B66\u7FD2\u3057\u305F\u30E2\u30C7\u30EB\u306E\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u3067\u3059\u3002"),me=m(),v(Ae.$$.fragment),ye=m(),S=i("p"),ee=a("\u6B21\u306B\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\u3053\u3053\u3067\u306F\u3001\u6A19\u6E96\u7684\u306A "),He=i("code"),ae=a("AdamW"),we=a(" \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002"),Ve=m(),v(ne.$$.fragment),qe=m(),J=i("p"),Le=a("\u3053\u308C\u3089\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u3042\u308C\u3070\u3001\u3042\u3068\u306F "),Ge=i("code"),Ne=a("Accelerator"),Je=a(" \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u4F7F\u3063\u3066\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u306E\u305F\u3081\u306E\u3059\u3079\u3066\u3092\u6E96\u5099\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Me=m(),v(Pe.$$.fragment),z=m(),V=i("p"),_s=a("\u30E2\u30C7\u30EB\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u30FC\u3001\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u304C\u8A2D\u5B9A\u3055\u308C\u305F\u306E\u3067\u3001\u5B66\u7FD2\u7387\u30B9\u30B1\u30B8\u30E5\u30FC\u30E9\u30FC\u3092\u4EE5\u4E0B\u306E\u3088\u3046\u306B\u6307\u5B9A\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),de=m(),v(Qe.$$.fragment),Ue=m(),cs=i("p"),ns=a("\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u306E\u524D\u306B\u6700\u5F8C\u306B\u3059\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6\u306B\u30E2\u30C7\u30EB\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u{1F917} Hub \u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u4F7F\u3063\u3066\u3001\u307E\u305A\u30EC\u30DD\u30B8\u30C8\u30EA\u306E\u30D5\u30EB\u30CD\u30FC\u30E0\u3092\u751F\u6210\u3057\u307E\u3059\u3002"),fs=m(),v(os.$$.fragment),xe=m(),v(Xe.$$.fragment),Te=m(),ue=i("p"),ms=a("\u305D\u308C\u304B\u3089\u3001\u{1F917} Hub \u306E "),Ze=i("code"),Ks=a("Repository"),es=a(" \u30AF\u30E9\u30B9\u3092\u4F7F\u7528\u3057\u3066\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u4F5C\u6210\u3057\u3001\u30AF\u30ED\u30FC\u30F3\u3057\u307E\u3059\u3002"),ss=m(),v(ts.$$.fragment),oe=m(),ds=i("p"),hs=a("\u3053\u308C\u304C\u3067\u304D\u308C\u3070\u3001\u3042\u3068\u306F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3068\u8A55\u4FA1\u306E\u30EB\u30FC\u30D7\u3092\u3059\u3079\u3066\u66F8\u304D\u51FA\u3059\u3060\u3051\u3067\u3059\u3002"),at=m(),v(Es.$$.fragment),gs=m(),v(ys.$$.fragment),lt=m(),is=i("p"),St=a(`\u30A4\u30B1\u3066\u308B\uFF01
\u30A8\u30DD\u30C3\u30AF\u3054\u3068\u306B\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u8A55\u4FA1\u3057\u3001\u8907\u6570\u56DE\u306E\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u5B9F\u884C\u3057\u305F\u969B\u306E\u518D\u73FE\u6027\u3092\u78BA\u4FDD\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3057\u305F`),this.h()},l(f){o=p(f,"P",{});var O=_(o);h=l(O,`\u4ECA\u56DE\u306E\u4F7F\u7528\u4F8B\u3067\u306F\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30EB\u30FC\u30D7\u306B\u7279\u5225\u306A\u3053\u3068\u3092\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u304C\u3001\u5834\u5408\u306B\u3088\u3063\u3066\u306F\u30AB\u30B9\u30BF\u30E0\u30ED\u30B8\u30C3\u30AF\u3092\u5B9F\u88C5\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093\u3002\u305D\u306E\u3088\u3046\u306A\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3067\u306F\u3001\u{1F917} Accelerate\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002
\u898B\u3066\u307F\u307E\u3057\u3087\u3046!`),O.forEach(s),c=d(f),w=p(f,"H2",{class:!0});var nt=_(w);D=p(nt,"A",{id:!0,class:!0,href:!0});var Ot=_(D);$=p(Ot,"SPAN",{});var Rs=_($);E(k.$$.fragment,Rs),Rs.forEach(s),Ot.forEach(s),q=d(nt),u=p(nt,"SPAN",{});var Kt=_(u);T=l(Kt,"DistilBERT\u3092\u{1F917} Accelerate\u3092\u4F7F\u3063\u3066\u5FAE\u8ABF\u6574\u3059\u308B"),Kt.forEach(s),nt.forEach(s),C=d(f),R=p(f,"P",{});var bs=_(R);L=p(bs,"CODE",{});var Ia=_(L);N=l(Ia,"Trainer"),Ia.forEach(s),F=l(bs,"\u3067\u898B\u305F\u3088\u3046\u306B\u3001\u30DE\u30B9\u30AF\u3055\u308C\u305F\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574\u306F"),B=p(bs,"A",{href:!0});var Rt=_(B);H=l(Rt,"\u7B2C3\u7AE0"),Rt.forEach(s),W=l(bs,"\u306E\u30C6\u30AD\u30B9\u30C8\u5206\u985E\u306E\u4F8B\u3068\u975E\u5E38\u306B\u3088\u304F\u4F3C\u3066\u3044\u307E\u3059\u3002\u5B9F\u969B\u3001\u552F\u4E00\u306E\u308F\u305A\u304B\u306A\u9055\u3044\u306F\u7279\u5225\u306A\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u3046\u3053\u3068\u3067\u3001\u305D\u308C\u306F\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u524D\u534A\u3067\u3059\u3067\u306B\u53D6\u308A\u4E0A\u3052\u307E\u3057\u305F!"),bs.forEach(s),j=d(f),P=p(f,"P",{});var ze=_(P);se=l(ze,"\u3057\u304B\u3057\u3001"),G=p(ze,"CODE",{});var ps=_(G);Z=l(ps,"DataCollatorForLanguageModeling"),ps.forEach(s),Y=l(ze,"\u306F\u8A55\u4FA1\u3054\u3068\u306B\u30E9\u30F3\u30C0\u30E0\u306A\u30DE\u30B9\u30AD\u30F3\u30B0\u3092\u884C\u3046\u306E\u3067\u3001\u5B66\u7FD2\u5B9F\u884C\u3054\u3068\u306B\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u30B9\u30B3\u30A2\u306B\u591A\u5C11\u306E\u5909\u52D5\u304C\u898B\u3089\u308C\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3057\u305F\u3002\u3053\u306E\u30E9\u30F3\u30C0\u30E0\u6027\u3092\u6392\u9664\u3059\u308B\u4E00\u3064\u306E\u65B9\u6CD5\u306F\u3001\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u5168\u4F53\u306B "),he=p(ze,"EM",{});var Xs=_(he);X=l(Xs,"\u4E00\u5EA6\u3060\u3051"),Xs.forEach(s),ie=l(ze," \u30DE\u30B9\u30AD\u30F3\u30B0\u3092\u9069\u7528\u3057\u3001\u305D\u306E\u5F8C\u{1F917} Transformers\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u7528\u3057\u3066\u3001\u8A55\u4FA1\u4E2D\u306B\u30D0\u30C3\u30C1\u3092\u53CE\u96C6\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u3053\u308C\u304C\u3069\u306E\u3088\u3046\u306B\u6A5F\u80FD\u3059\u308B\u304B\u3092\u898B\u308B\u305F\u3081\u306B\u3001"),I=p(ze,"CODE",{});var Ls=_(I);je=l(Ls,"DataCollatorForLanguageModeling"),Ls.forEach(s),U=l(ze," \u3092\u6700\u521D\u306B\u4F7F\u3063\u305F\u6642\u3068\u540C\u69D8\u306B\u3001\u30D0\u30C3\u30C1\u306B\u30DE\u30B9\u30AD\u30F3\u30B0\u3092\u9069\u7528\u3059\u308B\u7C21\u5358\u306A\u95A2\u6570\u3092\u5B9F\u88C5\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),ze.forEach(s),Oe=d(f),E(Q.$$.fragment,f),le=d(f),ce=p(f,"P",{});var Zs=_(ce);te=l(Zs,"\u6B21\u306B\u3001\u3053\u306E\u95A2\u6570\u3092\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306B\u9069\u7528\u3057\u3066\u3001\u30DE\u30B9\u30AF\u3055\u308C\u3066\u3044\u306A\u3044\u30AB\u30E9\u30E0\u3092\u524A\u9664\u3057\u3001\u30DE\u30B9\u30AF\u3055\u308C\u305F\u30AB\u30E9\u30E0\u306B\u7F6E\u304D\u63DB\u3048\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u4E0A\u306E "),ge=p(Zs,"CODE",{});var et=_(ge);Be=l(et,"data_collator"),et.forEach(s),Ie=l(Zs,` \u3092\u9069\u5207\u306A\u3082\u306E\u306B\u7F6E\u304D\u63DB\u3048\u308B\u3053\u3068\u3067\u3001\u5168\u5358\u8A9E\u5358\u4F4D\u3067\u306E\u30DE\u30B9\u30AD\u30F3\u30B0\u3092\u884C\u3046\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002
\u305D\u306E\u5834\u5408\u306F\u3001\u4EE5\u4E0B\u306E\u6700\u521D\u306E\u884C\u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),Zs.forEach(s),re=d(f),E(be.$$.fragment,f),Fe=d(f),fe=p(f,"P",{});var ot=_(fe);Ke=l(ot,"\u3042\u3068\u306F\u901A\u5E38\u901A\u308A\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u307E\u3059\u304C\u3001\u3053\u3053\u3067\u306F\u8A55\u4FA1\u30BB\u30C3\u30C8\u306B \u{1F917} Transformers \u306E "),ke=p(ot,"CODE",{});var Lt=_(ke);De=l(Lt,"default_data_collator"),Lt.forEach(s),pe=l(ot," \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002"),ot.forEach(s),ve=d(f),E($e.$$.fragment,f),Ee=d(f),_e=p(f,"P",{});var Bs=_(_e);Re=l(Bs,"\u3053\u3053\u3067\u306F\u3001\u{1F917} Accelerate\u3092\u4F7F\u3063\u305F\u6A19\u6E96\u7684\u306A\u30B9\u30C6\u30C3\u30D7\u306B\u5F93\u3044\u307E\u3059\u3002\u6700\u521D\u306B\u3084\u308B\u4E8B\u306F\u3001\u4E8B\u524D\u5B66\u7FD2\u3057\u305F\u30E2\u30C7\u30EB\u306E\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u3067\u3059\u3002"),Bs.forEach(s),me=d(f),E(Ae.$$.fragment,f),ye=d(f),S=p(f,"P",{});var it=_(S);ee=l(it,"\u6B21\u306B\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\u3053\u3053\u3067\u306F\u3001\u6A19\u6E96\u7684\u306A "),He=p(it,"CODE",{});var Bt=_(He);ae=l(Bt,"AdamW"),Bt.forEach(s),we=l(it," \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002"),it.forEach(s),Ve=d(f),E(ne.$$.fragment,f),qe=d(f),J=p(f,"P",{});var as=_(J);Le=l(as,"\u3053\u308C\u3089\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u3042\u308C\u3070\u3001\u3042\u3068\u306F "),Ge=p(as,"CODE",{});var Ga=_(Ge);Ne=l(Ga,"Accelerator"),Ga.forEach(s),Je=l(as," \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u4F7F\u3063\u3066\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u306E\u305F\u3081\u306E\u3059\u3079\u3066\u3092\u6E96\u5099\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),as.forEach(s),Me=d(f),E(Pe.$$.fragment,f),z=d(f),V=p(f,"P",{});var Fs=_(V);_s=l(Fs,"\u30E2\u30C7\u30EB\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u30FC\u3001\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u304C\u8A2D\u5B9A\u3055\u308C\u305F\u306E\u3067\u3001\u5B66\u7FD2\u7387\u30B9\u30B1\u30B8\u30E5\u30FC\u30E9\u30FC\u3092\u4EE5\u4E0B\u306E\u3088\u3046\u306B\u6307\u5B9A\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Fs.forEach(s),de=d(f),E(Qe.$$.fragment,f),Ue=d(f),cs=p(f,"P",{});var Ua=_(cs);ns=l(Ua,"\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u306E\u524D\u306B\u6700\u5F8C\u306B\u3059\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6\u306B\u30E2\u30C7\u30EB\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u{1F917} Hub \u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u4F7F\u3063\u3066\u3001\u307E\u305A\u30EC\u30DD\u30B8\u30C8\u30EA\u306E\u30D5\u30EB\u30CD\u30FC\u30E0\u3092\u751F\u6210\u3057\u307E\u3059\u3002"),Ua.forEach(s),fs=d(f),E(os.$$.fragment,f),xe=d(f),E(Xe.$$.fragment,f),Te=d(f),ue=p(f,"P",{});var pt=_(ue);ms=l(pt,"\u305D\u308C\u304B\u3089\u3001\u{1F917} Hub \u306E "),Ze=p(pt,"CODE",{});var _t=_(Ze);Ks=l(_t,"Repository"),_t.forEach(s),es=l(pt," \u30AF\u30E9\u30B9\u3092\u4F7F\u7528\u3057\u3066\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u4F5C\u6210\u3057\u3001\u30AF\u30ED\u30FC\u30F3\u3057\u307E\u3059\u3002"),pt.forEach(s),ss=d(f),E(ts.$$.fragment,f),oe=d(f),ds=p(f,"P",{});var Wa=_(ds);hs=l(Wa,"\u3053\u308C\u304C\u3067\u304D\u308C\u3070\u3001\u3042\u3068\u306F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3068\u8A55\u4FA1\u306E\u30EB\u30FC\u30D7\u3092\u3059\u3079\u3066\u66F8\u304D\u51FA\u3059\u3060\u3051\u3067\u3059\u3002"),Wa.forEach(s),at=d(f),E(Es.$$.fragment,f),gs=d(f),E(ys.$$.fragment,f),lt=d(f),is=p(f,"P",{});var Ya=_(is);St=l(Ya,`\u30A4\u30B1\u3066\u308B\uFF01
\u30A8\u30DD\u30C3\u30AF\u3054\u3068\u306B\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u8A55\u4FA1\u3057\u3001\u8907\u6570\u56DE\u306E\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u5B9F\u884C\u3057\u305F\u969B\u306E\u518D\u73FE\u6027\u3092\u78BA\u4FDD\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3057\u305F`),Ya.forEach(s),this.h()},h(){A(D,"id","distilbert-accelerate"),A(D,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),A(D,"href","#distilbert-accelerate"),A(w,"class","relative group"),A(B,"href","/course/ja/chapter3")},m(f,O){n(f,o,O),t(o,h),n(f,c,O),n(f,w,O),t(w,D),t(D,$),y(k,$,null),t(w,q),t(w,u),t(u,T),n(f,C,O),n(f,R,O),t(R,L),t(L,N),t(R,F),t(R,B),t(B,H),t(R,W),n(f,j,O),n(f,P,O),t(P,se),t(P,G),t(G,Z),t(P,Y),t(P,he),t(he,X),t(P,ie),t(P,I),t(I,je),t(P,U),n(f,Oe,O),y(Q,f,O),n(f,le,O),n(f,ce,O),t(ce,te),t(ce,ge),t(ge,Be),t(ce,Ie),n(f,re,O),y(be,f,O),n(f,Fe,O),n(f,fe,O),t(fe,Ke),t(fe,ke),t(ke,De),t(fe,pe),n(f,ve,O),y($e,f,O),n(f,Ee,O),n(f,_e,O),t(_e,Re),n(f,me,O),y(Ae,f,O),n(f,ye,O),n(f,S,O),t(S,ee),t(S,He),t(He,ae),t(S,we),n(f,Ve,O),y(ne,f,O),n(f,qe,O),n(f,J,O),t(J,Le),t(J,Ge),t(Ge,Ne),t(J,Je),n(f,Me,O),y(Pe,f,O),n(f,z,O),n(f,V,O),t(V,_s),n(f,de,O),y(Qe,f,O),n(f,Ue,O),n(f,cs,O),t(cs,ns),n(f,fs,O),y(os,f,O),n(f,xe,O),y(Xe,f,O),n(f,Te,O),n(f,ue,O),t(ue,ms),t(ue,Ze),t(Ze,Ks),t(ue,es),n(f,ss,O),y(ts,f,O),n(f,oe,O),n(f,ds,O),t(ds,hs),n(f,at,O),y(Es,f,O),n(f,gs,O),y(ys,f,O),n(f,lt,O),n(f,is,O),t(is,St),rt=!0},i(f){rt||(g(k.$$.fragment,f),g(Q.$$.fragment,f),g(be.$$.fragment,f),g($e.$$.fragment,f),g(Ae.$$.fragment,f),g(ne.$$.fragment,f),g(Pe.$$.fragment,f),g(Qe.$$.fragment,f),g(os.$$.fragment,f),g(Xe.$$.fragment,f),g(ts.$$.fragment,f),g(Es.$$.fragment,f),g(ys.$$.fragment,f),rt=!0)},o(f){b(k.$$.fragment,f),b(Q.$$.fragment,f),b(be.$$.fragment,f),b($e.$$.fragment,f),b(Ae.$$.fragment,f),b(ne.$$.fragment,f),b(Pe.$$.fragment,f),b(Qe.$$.fragment,f),b(os.$$.fragment,f),b(Xe.$$.fragment,f),b(ts.$$.fragment,f),b(Es.$$.fragment,f),b(ys.$$.fragment,f),rt=!1},d(f){f&&s(o),f&&s(c),f&&s(w),x(k),f&&s(C),f&&s(R),f&&s(j),f&&s(P),f&&s(Oe),x(Q,f),f&&s(le),f&&s(ce),f&&s(re),x(be,f),f&&s(Fe),f&&s(fe),f&&s(ve),x($e,f),f&&s(Ee),f&&s(_e),f&&s(me),x(Ae,f),f&&s(ye),f&&s(S),f&&s(Ve),x(ne,f),f&&s(qe),f&&s(J),f&&s(Me),x(Pe,f),f&&s(z),f&&s(V),f&&s(de),x(Qe,f),f&&s(Ue),f&&s(cs),f&&s(fs),x(os,f),f&&s(xe),x(Xe,f),f&&s(Te),f&&s(ue),f&&s(ss),x(ts,f),f&&s(oe),f&&s(ds),f&&s(at),x(Es,f),f&&s(gs),x(ys,f),f&&s(lt),f&&s(is)}}}function um(K){let o,h,c,w,D,$,k,q;return{c(){o=i("p"),h=a("\u270F\uFE0F "),c=i("strong"),w=a("\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),D=a(" \u30C9\u30E1\u30A4\u30F3\u9069\u5FDC\u306E\u5229\u70B9\u3092\u5B9A\u91CF\u5316\u3059\u308B\u305F\u3081\u306B\u3001IMDb\u30E9\u30D9\u30EB\u306E\u5206\u985E\u5668\u3092\u3001\u8A13\u7DF4\u524D\u3068\u5FAE\u8ABF\u6574\u3057\u305FDistilBERT\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u306E\u4E21\u65B9\u3067\u5FAE\u8ABF\u6574\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C6\u30AD\u30B9\u30C8\u5206\u985E\u306B\u3064\u3044\u3066\u5FA9\u7FD2\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F\u3001"),$=i("a"),k=a("\u7B2C3\u7AE0"),q=a("\u3092\u30C1\u30A7\u30C3\u30AF\u3057\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002"),this.h()},l(u){o=p(u,"P",{});var T=_(o);h=l(T,"\u270F\uFE0F "),c=p(T,"STRONG",{});var C=_(c);w=l(C,"\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),C.forEach(s),D=l(T," \u30C9\u30E1\u30A4\u30F3\u9069\u5FDC\u306E\u5229\u70B9\u3092\u5B9A\u91CF\u5316\u3059\u308B\u305F\u3081\u306B\u3001IMDb\u30E9\u30D9\u30EB\u306E\u5206\u985E\u5668\u3092\u3001\u8A13\u7DF4\u524D\u3068\u5FAE\u8ABF\u6574\u3057\u305FDistilBERT\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u306E\u4E21\u65B9\u3067\u5FAE\u8ABF\u6574\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C6\u30AD\u30B9\u30C8\u5206\u985E\u306B\u3064\u3044\u3066\u5FA9\u7FD2\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F\u3001"),$=p(T,"A",{href:!0});var R=_($);k=l(R,"\u7B2C3\u7AE0"),R.forEach(s),q=l(T,"\u3092\u30C1\u30A7\u30C3\u30AF\u3057\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002"),T.forEach(s),this.h()},h(){A($,"href","/course/ja/chapter3")},m(u,T){n(u,o,T),t(o,h),t(o,c),t(c,w),t(o,D),t(o,$),t($,k),t(o,q)},d(u){u&&s(o)}}}function hm(K){let o,h,c,w,D,$,k,q,u,T,C,R,L,N,F,B,H,W,j,P,se,G,Z,Y,he,X,ie,I,je,U,Oe,Q,le,ce,te,ge,Be,Ie,re,be,Fe,fe,Ke,ke,De,pe,ve,$e,Ee,_e,Re,me,Ae,ye,S,ee,He,ae,we,Ve,ne,qe,J,Le,Ge,Ne,Je,Me,Pe,z,V,_s,de,Qe,Ue,cs,ns,fs,os,xe,Xe,Te,ue,ms,Ze,Ks,es,ss,ts,oe,ds,hs,at,Es,gs,ys,lt,is,St,rt,f,O,nt,Ot,Rs,Kt,bs,Ia,Rt,ze,ps,Xs,Ls,Zs,et,ot,Lt,Bs,it,Bt,as,Ga,Fs,Ua,pt,_t,Wa,Ya,Br,Ft,Fr,Ht,Hr,ls,Bl,Go,Uo,Fl,Wo,Yo,Hl,Vo,Jo,Nl,Qo,Xo,Il,Zo,ei,Nr,Nt,Ir,It,Gr,Hs,si,Gl,ti,ai,Ul,li,ri,Ur,ct,Wr,ft,ni,Va,oi,ii,Yr,Gt,pi,Vr,Ut,Jr,Ja,_i,Qr,We,ci,Wl,fi,mi,Yl,di,ui,Qa,hi,gi,Vl,bi,ki,Jl,$i,wi,Xr,Wt,Zr,Yt,en,ks,ji,Ql,vi,Ei,Xl,yi,xi,Zl,Di,qi,sn,mt,Mi,er,Ti,zi,tn,Vt,an,Jt,ln,dt,Ai,sr,Pi,Ci,rn,ut,nn,Xa,Si,on,Qt,pn,ht,_n,Za,Oi,cn,Xt,fn,Zt,mn,el,Ki,dn,ea,un,sa,hn,sl,Ri,gn,Ns,Li,tr,Bi,Fi,ar,Hi,Ni,bn,ta,kn,aa,$n,tl,Ii,wn,gt,la,Gi,lr,Ui,Wi,Yi,ra,Vi,rr,Ji,Qi,jn,al,Xi,vn,na,En,us,nr,Zi,ep,or,sp,tp,ir,ap,lp,pr,rp,np,yn,Is,op,_r,ip,pp,cr,_p,cp,xn,oa,Dn,ia,qn,Ye,fp,fr,mp,dp,mr,up,hp,dr,gp,bp,ur,kp,$p,hr,wp,jp,Mn,pa,Tn,_a,zn,ll,vp,An,ca,Pn,fa,Cn,$s,Ep,gr,yp,xp,br,Dp,qp,kr,Mp,Tp,Sn,st,bt,$r,ma,zp,da,Ap,wr,Pp,Cp,On,ws,Sp,rl,Op,Kp,jr,Rp,Lp,vr,Bp,Fp,Kn,ua,Rn,kt,Hp,Er,Np,Ip,Ln,ha,Bn,ga,Fn,$t,Gp,yr,Up,Wp,Hn,wt,Yp,xr,Vp,Jp,Nn,jt,In,nl,vt,Qp,Dr,Xp,Zp,Gn,ol,e_,Un,Et,s_,qr,t_,a_,Wn,xs,Ds,il,pl,l_,Yn,ba,Vn,ka,Jn,yt,Qn,Gs,r_,_l,n_,o_,Mr,i_,p_,Xn,$a,Zn,wa,eo,Us,__,Tr,c_,f_,zr,m_,d_,so,cl,u_,to,ja,ao,fl,h_,lo,va,ro,ml,g_,no,qs,Ms,dl,Ea,b_,oo,ya,io,ul,k_,po,hl,$_,_o,Ts,zs,gl,xa,co,bl,w_,fo,As,Ps,kl,$l,j_,mo,Cs,Ss,wl,Da,uo,jl,v_,ho,vl,xt,go,El,qa,E_,bo,Ws,y_,Ar,x_,D_,Pr,q_,M_,ko,Ma,$o,yl,T_,wo,Ta,jo,za,vo,xl,z_,Eo,Aa,yo,Dt,A_,Dl,P_,C_,xo,qt,Do;c=new Gf({props:{fw:K[0]}});const S_=[Wf,Uf],Pa=[];function O_(e,r){return e[0]==="pt"?0:1}q=O_(K),u=Pa[q]=S_[q](K),De=new Io({props:{id:"mqElG5QJWUg"}}),ve=new Ct({props:{$$slots:{default:[Yf]},$$scope:{ctx:K}}});const K_=[Jf,Vf],Ca=[];function R_(e,r){return e[0]==="pt"?0:1}Te=R_(K),ue=Ca[Te]=K_[Te](K),ss=new M({props:{code:'text = "This is a great [MASK]."',highlighted:'text = <span class="hljs-string">&quot;This is a great [MASK].&quot;</span>'}}),Rs=new M({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)`}});const L_=[Xf,Qf],Sa=[];function B_(e,r){return e[0]==="pt"?0:1}ze=B_(K),ps=Sa[ze]=L_[ze](K),Ls=new M({props:{code:`'>>> This is a great deal.'
'>>> This is a great success.'
'>>> This is a great adventure.'
'>>> This is a great idea.'
'>>> This is a great feat.'`,highlighted:`<span class="hljs-string">&#x27;&gt;&gt;&gt; This is a great deal.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; This is a great success.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; This is a great adventure.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; This is a great idea.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; This is a great feat.&#x27;</span>`}}),Ft=new M({props:{code:`from datasets import load_dataset

imdb_dataset = load_dataset("imdb")
imdb_dataset`,highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

imdb_dataset = load_dataset(<span class="hljs-string">&quot;imdb&quot;</span>)
imdb_dataset`}}),Ht=new M({props:{code:`DatasetDict({
    train: Dataset({
        features: ['text', 'label'],
        num_rows: 25000
    })
    test: Dataset({
        features: ['text', 'label'],
        num_rows: 25000
    })
    unsupervised: Dataset({
        features: ['text', 'label'],
        num_rows: 50000
    })
})`,highlighted:`DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;text&#x27;</span>, <span class="hljs-string">&#x27;label&#x27;</span>],
        num_rows: <span class="hljs-number">25000</span>
    })
    test: Dataset({
        features: [<span class="hljs-string">&#x27;text&#x27;</span>, <span class="hljs-string">&#x27;label&#x27;</span>],
        num_rows: <span class="hljs-number">25000</span>
    })
    unsupervised: Dataset({
        features: [<span class="hljs-string">&#x27;text&#x27;</span>, <span class="hljs-string">&#x27;label&#x27;</span>],
        num_rows: <span class="hljs-number">50000</span>
    })
})`}}),Nt=new M({props:{code:`sample = imdb_dataset["train"].shuffle(seed=42).select(range(3))

for row in sample:
    print(f"\\n'>>> Review: {row['text']}'")
    print(f"'>>> Label: {row['label']}'")`,highlighted:`sample = imdb_dataset[<span class="hljs-string">&quot;train&quot;</span>].shuffle(seed=<span class="hljs-number">42</span>).select(<span class="hljs-built_in">range</span>(<span class="hljs-number">3</span>))

<span class="hljs-keyword">for</span> row <span class="hljs-keyword">in</span> sample:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;\\n&#x27;&gt;&gt;&gt; Review: <span class="hljs-subst">{row[<span class="hljs-string">&#x27;text&#x27;</span>]}</span>&#x27;&quot;</span>)
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&#x27;&gt;&gt;&gt; Label: <span class="hljs-subst">{row[<span class="hljs-string">&#x27;label&#x27;</span>]}</span>&#x27;&quot;</span>)`}}),It=new M({props:{code:`
'>>> Review: This is your typical Priyadarshan movie--a bunch of loony characters out on some silly mission. His signature climax has the entire cast of the film coming together and fighting each other in some crazy moshpit over hidden money. Whether it is a winning lottery ticket in Malamaal Weekly, black money in Hera Pheri, "kodokoo" in Phir Hera Pheri, etc., etc., the director is becoming ridiculously predictable. Don\\'t get me wrong; as clich\xE9d and preposterous his movies may be, I usually end up enjoying the comedy. However, in most his previous movies there has actually been some good humor, (Hungama and Hera Pheri being noteworthy ones). Now, the hilarity of his films is fading as he is using the same formula over and over again.<br /><br />Songs are good. Tanushree Datta looks awesome. Rajpal Yadav is irritating, and Tusshar is not a whole lot better. Kunal Khemu is OK, and Sharman Joshi is the best.'
'>>> Label: 0'

'>>> Review: Okay, the story makes no sense, the characters lack any dimensionally, the best dialogue is ad-libs about the low quality of movie, the cinematography is dismal, and only editing saves a bit of the muddle, but Sam" Peckinpah directed the film. Somehow, his direction is not enough. For those who appreciate Peckinpah and his great work, this movie is a disappointment. Even a great cast cannot redeem the time the viewer wastes with this minimal effort.<br /><br />The proper response to the movie is the contempt that the director San Peckinpah, James Caan, Robert Duvall, Burt Young, Bo Hopkins, Arthur Hill, and even Gig Young bring to their work. Watch the great Peckinpah films. Skip this mess.'
'>>> Label: 0'

'>>> Review: I saw this movie at the theaters when I was about 6 or 7 years old. I loved it then, and have recently come to own a VHS version. <br /><br />My 4 and 6 year old children love this movie and have been asking again and again to watch it. <br /><br />I have enjoyed watching it again too. Though I have to admit it is not as good on a little TV.<br /><br />I do not have older children so I do not know what they would think of it. <br /><br />The songs are very cute. My daughter keeps singing them over and over.<br /><br />Hope this helps.'
'>>> Label: 1'`,highlighted:`
<span class="hljs-string">&#x27;&gt;&gt;&gt; Review: This is your typical Priyadarshan movie--a bunch of loony characters out on some silly mission. His signature climax has the entire cast of the film coming together and fighting each other in some crazy moshpit over hidden money. Whether it is a winning lottery ticket in Malamaal Weekly, black money in Hera Pheri, &quot;kodokoo&quot; in Phir Hera Pheri, etc., etc., the director is becoming ridiculously predictable. Don\\&#x27;t get me wrong; as clich\xE9d and preposterous his movies may be, I usually end up enjoying the comedy. However, in most his previous movies there has actually been some good humor, (Hungama and Hera Pheri being noteworthy ones). Now, the hilarity of his films is fading as he is using the same formula over and over again.&lt;br /&gt;&lt;br /&gt;Songs are good. Tanushree Datta looks awesome. Rajpal Yadav is irritating, and Tusshar is not a whole lot better. Kunal Khemu is OK, and Sharman Joshi is the best.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Label: 0&#x27;</span>

<span class="hljs-string">&#x27;&gt;&gt;&gt; Review: Okay, the story makes no sense, the characters lack any dimensionally, the best dialogue is ad-libs about the low quality of movie, the cinematography is dismal, and only editing saves a bit of the muddle, but Sam&quot; Peckinpah directed the film. Somehow, his direction is not enough. For those who appreciate Peckinpah and his great work, this movie is a disappointment. Even a great cast cannot redeem the time the viewer wastes with this minimal effort.&lt;br /&gt;&lt;br /&gt;The proper response to the movie is the contempt that the director San Peckinpah, James Caan, Robert Duvall, Burt Young, Bo Hopkins, Arthur Hill, and even Gig Young bring to their work. Watch the great Peckinpah films. Skip this mess.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Label: 0&#x27;</span>

<span class="hljs-string">&#x27;&gt;&gt;&gt; Review: I saw this movie at the theaters when I was about 6 or 7 years old. I loved it then, and have recently come to own a VHS version. &lt;br /&gt;&lt;br /&gt;My 4 and 6 year old children love this movie and have been asking again and again to watch it. &lt;br /&gt;&lt;br /&gt;I have enjoyed watching it again too. Though I have to admit it is not as good on a little TV.&lt;br /&gt;&lt;br /&gt;I do not have older children so I do not know what they would think of it. &lt;br /&gt;&lt;br /&gt;The songs are very cute. My daughter keeps singing them over and over.&lt;br /&gt;&lt;br /&gt;Hope this helps.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Label: 1&#x27;</span>`}}),ct=new Ct({props:{$$slots:{default:[Zf]},$$scope:{ctx:K}}}),Ut=new Io({props:{id:"8PmhEIXhBvI"}}),Wt=new M({props:{code:`def tokenize_function(examples):
    result = tokenizer(examples["text"])
    if tokenizer.is_fast:
        result["word_ids"] = [result.word_ids(i) for i in range(len(result["input_ids"]))]
    return result


# Use batched=True to activate fast multithreading!
tokenized_datasets = imdb_dataset.map(
    tokenize_function, batched=True, remove_columns=["text", "label"]
)
tokenized_datasets`,highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">tokenize_function</span>(<span class="hljs-params">examples</span>):
    result = tokenizer(examples[<span class="hljs-string">&quot;text&quot;</span>])
    <span class="hljs-keyword">if</span> tokenizer.is_fast:
        result[<span class="hljs-string">&quot;word_ids&quot;</span>] = [result.word_ids(i) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-built_in">len</span>(result[<span class="hljs-string">&quot;input_ids&quot;</span>]))]
    <span class="hljs-keyword">return</span> result


<span class="hljs-comment"># Use batched=True to activate fast multithreading!</span>
tokenized_datasets = imdb_dataset.<span class="hljs-built_in">map</span>(
    tokenize_function, batched=<span class="hljs-literal">True</span>, remove_columns=[<span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;label&quot;</span>]
)
tokenized_datasets`}}),Yt=new M({props:{code:`DatasetDict({
    train: Dataset({
        features: ['attention_mask', 'input_ids', 'word_ids'],
        num_rows: 25000
    })
    test: Dataset({
        features: ['attention_mask', 'input_ids', 'word_ids'],
        num_rows: 25000
    })
    unsupervised: Dataset({
        features: ['attention_mask', 'input_ids', 'word_ids'],
        num_rows: 50000
    })
})`,highlighted:`DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;word_ids&#x27;</span>],
        num_rows: <span class="hljs-number">25000</span>
    })
    test: Dataset({
        features: [<span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;word_ids&#x27;</span>],
        num_rows: <span class="hljs-number">25000</span>
    })
    unsupervised: Dataset({
        features: [<span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;word_ids&#x27;</span>],
        num_rows: <span class="hljs-number">50000</span>
    })
})`}}),Vt=new M({props:{code:"tokenizer.model_max_length",highlighted:"tokenizer.model_max_length"}}),Jt=new M({props:{code:"512",highlighted:'<span class="hljs-number">512</span>'}}),ut=new Ct({props:{$$slots:{default:[em]},$$scope:{ctx:K}}}),Qt=new M({props:{code:"chunk_size = 128",highlighted:'chunk_size = <span class="hljs-number">128</span>'}}),ht=new Ct({props:{warning:!0,$$slots:{default:[sm]},$$scope:{ctx:K}}}),Xt=new M({props:{code:`# Slicing produces a list of lists for each feature
tokenized_samples = tokenized_datasets["train"][:3]

for idx, sample in enumerate(tokenized_samples["input_ids"]):
    print(f"'>>> Review {idx} length: {len(sample)}'")`,highlighted:`<span class="hljs-comment"># Slicing produces a list of lists for each feature</span>
tokenized_samples = tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>][:<span class="hljs-number">3</span>]

<span class="hljs-keyword">for</span> idx, sample <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(tokenized_samples[<span class="hljs-string">&quot;input_ids&quot;</span>]):
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&#x27;&gt;&gt;&gt; Review <span class="hljs-subst">{idx}</span> length: <span class="hljs-subst">{<span class="hljs-built_in">len</span>(sample)}</span>&#x27;&quot;</span>)`}}),Zt=new M({props:{code:`'>>> Review 0 length: 200'
'>>> Review 1 length: 559'
'>>> Review 2 length: 192'`,highlighted:`<span class="hljs-string">&#x27;&gt;&gt;&gt; Review 0 length: 200&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Review 1 length: 559&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Review 2 length: 192&#x27;</span>`}}),ea=new M({props:{code:`concatenated_examples = {
    k: sum(tokenized_samples[k], []) for k in tokenized_samples.keys()
}
total_length = len(concatenated_examples["input_ids"])
print(f"'>>> Concatenated reviews length: {total_length}'")`,highlighted:`concatenated_examples = {
    k: <span class="hljs-built_in">sum</span>(tokenized_samples[k], []) <span class="hljs-keyword">for</span> k <span class="hljs-keyword">in</span> tokenized_samples.keys()
}
total_length = <span class="hljs-built_in">len</span>(concatenated_examples[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&#x27;&gt;&gt;&gt; Concatenated reviews length: <span class="hljs-subst">{total_length}</span>&#x27;&quot;</span>)`}}),sa=new M({props:{code:"'>>> Concatenated reviews length: 951'",highlighted:'<span class="hljs-string">&#x27;&gt;&gt;&gt; Concatenated reviews length: 951&#x27;</span>'}}),ta=new M({props:{code:`chunks = {
    k: [t[i : i + chunk_size] for i in range(0, total_length, chunk_size)]
    for k, t in concatenated_examples.items()
}

for chunk in chunks["input_ids"]:
    print(f"'>>> Chunk length: {len(chunk)}'")`,highlighted:`chunks = {
    k: [t[i : i + chunk_size] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">0</span>, total_length, chunk_size)]
    <span class="hljs-keyword">for</span> k, t <span class="hljs-keyword">in</span> concatenated_examples.items()
}

<span class="hljs-keyword">for</span> chunk <span class="hljs-keyword">in</span> chunks[<span class="hljs-string">&quot;input_ids&quot;</span>]:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&#x27;&gt;&gt;&gt; Chunk length: <span class="hljs-subst">{<span class="hljs-built_in">len</span>(chunk)}</span>&#x27;&quot;</span>)`}}),aa=new M({props:{code:`'>>> Chunk length: 128'
'>>> Chunk length: 128'
'>>> Chunk length: 128'
'>>> Chunk length: 128'
'>>> Chunk length: 128'
'>>> Chunk length: 128'
'>>> Chunk length: 128'
'>>> Chunk length: 55'`,highlighted:`<span class="hljs-string">&#x27;&gt;&gt;&gt; Chunk length: 128&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Chunk length: 128&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Chunk length: 128&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Chunk length: 128&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Chunk length: 128&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Chunk length: 128&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Chunk length: 128&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; Chunk length: 55&#x27;</span>`}}),na=new M({props:{code:`def group_texts(examples):
    # Concatenate all texts
    concatenated_examples = {k: sum(examples[k], []) for k in examples.keys()}
    # Compute length of concatenated texts
    total_length = len(concatenated_examples[list(examples.keys())[0]])
    # We drop the last chunk if it's smaller than chunk_size
    total_length = (total_length // chunk_size) * chunk_size
    # Split by chunks of max_len
    result = {
        k: [t[i : i + chunk_size] for i in range(0, total_length, chunk_size)]
        for k, t in concatenated_examples.items()
    }
    # Create a new labels column
    result["labels"] = result["input_ids"].copy()
    return result`,highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">group_texts</span>(<span class="hljs-params">examples</span>):
    <span class="hljs-comment"># Concatenate all texts</span>
    concatenated_examples = {k: <span class="hljs-built_in">sum</span>(examples[k], []) <span class="hljs-keyword">for</span> k <span class="hljs-keyword">in</span> examples.keys()}
    <span class="hljs-comment"># Compute length of concatenated texts</span>
    total_length = <span class="hljs-built_in">len</span>(concatenated_examples[<span class="hljs-built_in">list</span>(examples.keys())[<span class="hljs-number">0</span>]])
    <span class="hljs-comment"># We drop the last chunk if it&#x27;s smaller than chunk_size</span>
    total_length = (total_length // chunk_size) * chunk_size
    <span class="hljs-comment"># Split by chunks of max_len</span>
    result = {
        k: [t[i : i + chunk_size] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">0</span>, total_length, chunk_size)]
        <span class="hljs-keyword">for</span> k, t <span class="hljs-keyword">in</span> concatenated_examples.items()
    }
    <span class="hljs-comment"># Create a new labels column</span>
    result[<span class="hljs-string">&quot;labels&quot;</span>] = result[<span class="hljs-string">&quot;input_ids&quot;</span>].copy()
    <span class="hljs-keyword">return</span> result`}}),oa=new M({props:{code:`lm_datasets = tokenized_datasets.map(group_texts, batched=True)
lm_datasets`,highlighted:`lm_datasets = tokenized_datasets.<span class="hljs-built_in">map</span>(group_texts, batched=<span class="hljs-literal">True</span>)
lm_datasets`}}),ia=new M({props:{code:`DatasetDict({
    train: Dataset({
        features: ['attention_mask', 'input_ids', 'labels', 'word_ids'],
        num_rows: 61289
    })
    test: Dataset({
        features: ['attention_mask', 'input_ids', 'labels', 'word_ids'],
        num_rows: 59905
    })
    unsupervised: Dataset({
        features: ['attention_mask', 'input_ids', 'labels', 'word_ids'],
        num_rows: 122963
    })
})`,highlighted:`DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;labels&#x27;</span>, <span class="hljs-string">&#x27;word_ids&#x27;</span>],
        num_rows: <span class="hljs-number">61289</span>
    })
    test: Dataset({
        features: [<span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;labels&#x27;</span>, <span class="hljs-string">&#x27;word_ids&#x27;</span>],
        num_rows: <span class="hljs-number">59905</span>
    })
    unsupervised: Dataset({
        features: [<span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;labels&#x27;</span>, <span class="hljs-string">&#x27;word_ids&#x27;</span>],
        num_rows: <span class="hljs-number">122963</span>
    })
})`}}),pa=new M({props:{code:'tokenizer.decode(lm_datasets["train"][1]["input_ids"])',highlighted:'tokenizer.decode(lm_datasets[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">1</span>][<span class="hljs-string">&quot;input_ids&quot;</span>])'}}),_a=new M({props:{code:`".... at.......... high. a classic line : inspector : i'm here to sack one of your teachers. student : welcome to bromwell high. i expect that many adults of my age think that bromwell high is far fetched. what a pity that it isn't! [SEP] [CLS] homelessness ( or houselessness as george carlin stated ) has been an issue for years but never a plan to help those on the street that were once considered human who did everything from going to school, work, or vote for the matter. most people think of the homeless"`,highlighted:'<span class="hljs-string">&quot;.... at.......... high. a classic line : inspector : i&#x27;m here to sack one of your teachers. student : welcome to bromwell high. i expect that many adults of my age think that bromwell high is far fetched. what a pity that it isn&#x27;t! [SEP] [CLS] homelessness ( or houselessness as george carlin stated ) has been an issue for years but never a plan to help those on the street that were once considered human who did everything from going to school, work, or vote for the matter. most people think of the homeless&quot;</span>'}}),ca=new M({props:{code:'tokenizer.decode(lm_datasets["train"][1]["labels"])',highlighted:'tokenizer.decode(lm_datasets[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">1</span>][<span class="hljs-string">&quot;labels&quot;</span>])'}}),fa=new M({props:{code:`".... at.......... high. a classic line : inspector : i'm here to sack one of your teachers. student : welcome to bromwell high. i expect that many adults of my age think that bromwell high is far fetched. what a pity that it isn't! [SEP] [CLS] homelessness ( or houselessness as george carlin stated ) has been an issue for years but never a plan to help those on the street that were once considered human who did everything from going to school, work, or vote for the matter. most people think of the homeless"`,highlighted:'<span class="hljs-string">&quot;.... at.......... high. a classic line : inspector : i&#x27;m here to sack one of your teachers. student : welcome to bromwell high. i expect that many adults of my age think that bromwell high is far fetched. what a pity that it isn&#x27;t! [SEP] [CLS] homelessness ( or houselessness as george carlin stated ) has been an issue for years but never a plan to help those on the street that were once considered human who did everything from going to school, work, or vote for the matter. most people think of the homeless&quot;</span>'}}),ma=new Rf({}),ua=new M({props:{code:`from transformers import DataCollatorForLanguageModeling

data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm_probability=0.15)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm_probability=<span class="hljs-number">0.15</span>)`}}),ha=new M({props:{code:`samples = [lm_datasets["train"][i] for i in range(2)]
for sample in samples:
    _ = sample.pop("word_ids")

for chunk in data_collator(samples)["input_ids"]:
    print(f"\\n'>>> {tokenizer.decode(chunk)}'")`,highlighted:`samples = [lm_datasets[<span class="hljs-string">&quot;train&quot;</span>][i] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">2</span>)]
<span class="hljs-keyword">for</span> sample <span class="hljs-keyword">in</span> samples:
    _ = sample.pop(<span class="hljs-string">&quot;word_ids&quot;</span>)

<span class="hljs-keyword">for</span> chunk <span class="hljs-keyword">in</span> data_collator(samples)[<span class="hljs-string">&quot;input_ids&quot;</span>]:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;\\n&#x27;&gt;&gt;&gt; <span class="hljs-subst">{tokenizer.decode(chunk)}</span>&#x27;&quot;</span>)`}}),ga=new M({props:{code:`'>>> [CLS] bromwell [MASK] is a cartoon comedy. it ran at the same [MASK] as some other [MASK] about school life, [MASK] as " teachers ". [MASK] [MASK] [MASK] in the teaching [MASK] lead [MASK] to believe that bromwell high\\'[MASK] satire is much closer to reality than is " teachers ". the scramble [MASK] [MASK] financially, the [MASK]ful students whogn [MASK] right through [MASK] pathetic teachers\\'pomp, the pettiness of the whole situation, distinction remind me of the schools i knew and their students. when i saw [MASK] episode in [MASK] a student repeatedly tried to burn down the school, [MASK] immediately recalled. [MASK]...'

'>>> .... at.. [MASK]... [MASK]... high. a classic line plucked inspector : i\\'[MASK] here to [MASK] one of your [MASK]. student : welcome to bromwell [MASK]. i expect that many adults of my age think that [MASK]mwell [MASK] is [MASK] fetched. what a pity that it isn\\'t! [SEP] [CLS] [MASK]ness ( or [MASK]lessness as george \u5B87in stated )\u516C been an issue for years but never [MASK] plan to help those on the street that were once considered human [MASK] did everything from going to school, [MASK], [MASK] vote for the matter. most people think [MASK] the homeless'`,highlighted:`<span class="hljs-string">&#x27;&gt;&gt;&gt; [CLS] bromwell [MASK] is a cartoon comedy. it ran at the same [MASK] as some other [MASK] about school life, [MASK] as &quot; teachers &quot;. [MASK] [MASK] [MASK] in the teaching [MASK] lead [MASK] to believe that bromwell high\\&#x27;[MASK] satire is much closer to reality than is &quot; teachers &quot;. the scramble [MASK] [MASK] financially, the [MASK]ful students whogn [MASK] right through [MASK] pathetic teachers\\&#x27;pomp, the pettiness of the whole situation, distinction remind me of the schools i knew and their students. when i saw [MASK] episode in [MASK] a student repeatedly tried to burn down the school, [MASK] immediately recalled. [MASK]...&#x27;</span>

<span class="hljs-string">&#x27;&gt;&gt;&gt; .... at.. [MASK]... [MASK]... high. a classic line plucked inspector : i\\&#x27;[MASK] here to [MASK] one of your [MASK]. student : welcome to bromwell [MASK]. i expect that many adults of my age think that [MASK]mwell [MASK] is [MASK] fetched. what a pity that it isn\\&#x27;t! [SEP] [CLS] [MASK]ness ( or [MASK]lessness as george \u5B87in stated )\u516C been an issue for years but never [MASK] plan to help those on the street that were once considered human [MASK] did everything from going to school, [MASK], [MASK] vote for the matter. most people think [MASK] the homeless&#x27;</span>`}}),jt=new Ct({props:{$$slots:{default:[tm]},$$scope:{ctx:K}}});let rs=K[0]==="pt"&&Sf();const F_=[lm,am],Oa=[];function H_(e,r){return e[0]==="pt"?0:1}xs=H_(K),Ds=Oa[xs]=F_[xs](K),ba=new M({props:{code:`samples = [lm_datasets["train"][i] for i in range(2)]
batch = whole_word_masking_data_collator(samples)

for chunk in batch["input_ids"]:
    print(f"\\n'>>> {tokenizer.decode(chunk)}'")`,highlighted:`samples = [lm_datasets[<span class="hljs-string">&quot;train&quot;</span>][i] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">2</span>)]
batch = whole_word_masking_data_collator(samples)

<span class="hljs-keyword">for</span> chunk <span class="hljs-keyword">in</span> batch[<span class="hljs-string">&quot;input_ids&quot;</span>]:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;\\n&#x27;&gt;&gt;&gt; <span class="hljs-subst">{tokenizer.decode(chunk)}</span>&#x27;&quot;</span>)`}}),ka=new M({props:{code:`'>>> [CLS] bromwell high is a cartoon comedy [MASK] it ran at the same time as some other programs about school life, such as " teachers ". my 35 years in the teaching profession lead me to believe that bromwell high\\'s satire is much closer to reality than is " teachers ". the scramble to survive financially, the insightful students who can see right through their pathetic teachers\\'pomp, the pettiness of the whole situation, all remind me of the schools i knew and their students. when i saw the episode in which a student repeatedly tried to burn down the school, i immediately recalled.....'

'>>> .... [MASK] [MASK] [MASK] [MASK]....... high. a classic line : inspector : i\\'m here to sack one of your teachers. student : welcome to bromwell high. i expect that many adults of my age think that bromwell high is far fetched. what a pity that it isn\\'t! [SEP] [CLS] homelessness ( or houselessness as george carlin stated ) has been an issue for years but never a plan to help those on the street that were once considered human who did everything from going to school, work, or vote for the matter. most people think of the homeless'`,highlighted:`<span class="hljs-string">&#x27;&gt;&gt;&gt; [CLS] bromwell high is a cartoon comedy [MASK] it ran at the same time as some other programs about school life, such as &quot; teachers &quot;. my 35 years in the teaching profession lead me to believe that bromwell high\\&#x27;s satire is much closer to reality than is &quot; teachers &quot;. the scramble to survive financially, the insightful students who can see right through their pathetic teachers\\&#x27;pomp, the pettiness of the whole situation, all remind me of the schools i knew and their students. when i saw the episode in which a student repeatedly tried to burn down the school, i immediately recalled.....&#x27;</span>

<span class="hljs-string">&#x27;&gt;&gt;&gt; .... [MASK] [MASK] [MASK] [MASK]....... high. a classic line : inspector : i\\&#x27;m here to sack one of your teachers. student : welcome to bromwell high. i expect that many adults of my age think that bromwell high is far fetched. what a pity that it isn\\&#x27;t! [SEP] [CLS] homelessness ( or houselessness as george carlin stated ) has been an issue for years but never a plan to help those on the street that were once considered human who did everything from going to school, work, or vote for the matter. most people think of the homeless&#x27;</span>`}}),yt=new Ct({props:{$$slots:{default:[rm]},$$scope:{ctx:K}}}),$a=new M({props:{code:`train_size = 10_000
test_size = int(0.1 * train_size)

downsampled_dataset = lm_datasets["train"].train_test_split(
    train_size=train_size, test_size=test_size, seed=42
)
downsampled_dataset`,highlighted:`train_size = <span class="hljs-number">10_000</span>
test_size = <span class="hljs-built_in">int</span>(<span class="hljs-number">0.1</span> * train_size)

downsampled_dataset = lm_datasets[<span class="hljs-string">&quot;train&quot;</span>].train_test_split(
    train_size=train_size, test_size=test_size, seed=<span class="hljs-number">42</span>
)
downsampled_dataset`}}),wa=new M({props:{code:`DatasetDict({
    train: Dataset({
        features: ['attention_mask', 'input_ids', 'labels', 'word_ids'],
        num_rows: 10000
    })
    test: Dataset({
        features: ['attention_mask', 'input_ids', 'labels', 'word_ids'],
        num_rows: 1000
    })
})`,highlighted:`DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;labels&#x27;</span>, <span class="hljs-string">&#x27;word_ids&#x27;</span>],
        num_rows: <span class="hljs-number">10000</span>
    })
    test: Dataset({
        features: [<span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;labels&#x27;</span>, <span class="hljs-string">&#x27;word_ids&#x27;</span>],
        num_rows: <span class="hljs-number">1000</span>
    })
})`}}),ja=new M({props:{code:`from huggingface_hub import notebook_login

notebook_login()`,highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`}}),va=new M({props:{code:"huggingface-cli login",highlighted:'huggingface-<span class="hljs-keyword">cli</span> login'}});const N_=[om,nm],Ka=[];function I_(e,r){return e[0]==="tf"?0:1}qs=I_(K),Ms=Ka[qs]=N_[qs](K),ya=new Io({props:{id:"NURcDHhYe98"}});const G_=[pm,im],Ra=[];function U_(e,r){return e[0]==="pt"?0:1}Ts=U_(K),zs=Ra[Ts]=G_[Ts](K),xa=new M({props:{code:"Perplexity: 21.75",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>Perplexity: <span class="hljs-number">21.75</span>'}});const W_=[cm,_m],La=[];function Y_(e,r){return e[0]==="pt"?0:1}As=Y_(K),Ps=La[As]=W_[As](K);const V_=[mm,fm],Ba=[];function J_(e,r){return e[0]==="pt"?0:1}Cs=J_(K),Ss=Ba[Cs]=V_[Cs](K),Da=new M({props:{code:"Perplexity: 11.32",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>Perplexity: <span class="hljs-number">11.32</span>'}});let Ce=K[0]==="pt"&&Of();xt=new Ct({props:{$$slots:{default:[dm]},$$scope:{ctx:K}}});let Se=K[0]==="pt"&&Kf();return Ma=new M({props:{code:`from transformers import pipeline

mask_filler = pipeline(
    "fill-mask", model="huggingface-course/distilbert-base-uncased-finetuned-imdb"
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

mask_filler = pipeline(
    <span class="hljs-string">&quot;fill-mask&quot;</span>, model=<span class="hljs-string">&quot;huggingface-course/distilbert-base-uncased-finetuned-imdb&quot;</span>
)`}}),Ta=new M({props:{code:`preds = mask_filler(text)

for pred in preds:
    print(f">>> {pred['sequence']}")`,highlighted:`preds = mask_filler(text)

<span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;&gt;&gt;&gt; <span class="hljs-subst">{pred[<span class="hljs-string">&#x27;sequence&#x27;</span>]}</span>&quot;</span>)`}}),za=new M({props:{code:`'>>> this is a great movie.'
'>>> this is a great film.'
'>>> this is a great story.'
'>>> this is a great movies.'
'>>> this is a great character.'`,highlighted:`<span class="hljs-string">&#x27;&gt;&gt;&gt; this is a great movie.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; this is a great film.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; this is a great story.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; this is a great movies.&#x27;</span>
<span class="hljs-string">&#x27;&gt;&gt;&gt; this is a great character.&#x27;</span>`}}),Aa=new Io({props:{id:"0Oxphw4Q9fo"}}),qt=new Ct({props:{$$slots:{default:[um]},$$scope:{ctx:K}}}),{c(){o=i("meta"),h=m(),v(c.$$.fragment),w=m(),D=i("h1"),$=a("\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574"),k=m(),u.c(),T=m(),C=i("p"),R=a("Transformer\u30E2\u30C7\u30EB\u3092\u542B\u3080\u591A\u304F\u306ENLP\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3067\u306F\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6\u304B\u3089\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u306E\u30E2\u30C7\u30EB\u3092\u53D6\u308A\u51FA\u3057\u3001\u81EA\u5206\u304C\u5B9F\u884C\u3057\u305F\u3044\u30BF\u30B9\u30AF\u7528\u306E\u30C7\u30FC\u30BF\u3092\u76F4\u63A5\u4F7F\u3063\u3066\u5FAE\u8ABF\u6574\u3092\u884C\u3046\u3060\u3051\u3067\u3088\u3044\u306E\u3067\u3059\u3002\u4E8B\u524D\u5B66\u7FD2\u306B\u4F7F\u308F\u308C\u305F\u30B3\u30FC\u30D1\u30B9\u3068\u5FAE\u8ABF\u6574\u306B\u4F7F\u3046\u30B3\u30FC\u30D1\u30B9\u304C\u3042\u307E\u308A\u9055\u308F\u306A\u3044\u9650\u308A\u3001\u8EE2\u79FB\u5B66\u7FD2\u306F\u901A\u5E38\u826F\u3044\u7D50\u679C\u3092\u751F\u307F\u51FA\u3057\u307E\u3059\u3002"),L=m(),N=i("p"),F=a("\u3057\u304B\u3057\u3001\u30E2\u30C7\u30EB\u306E\u30D8\u30C3\u30C9\u90E8\u3060\u3051\u3092\u5BFE\u8C61\u306B\u30BF\u30B9\u30AF\u306B\u7279\u5316\u3057\u305F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u884C\u3046\u524D\u306B\u3001\u307E\u305A\u30C7\u30FC\u30BF\u3092\u4F7F\u3063\u3066\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u5FAE\u8ABF\u6574\u3057\u305F\u3044\u30B1\u30FC\u30B9\u3082\u3044\u304F\u3064\u304B\u3042\u308A\u307E\u3059\u3002\u4F8B\u3048\u3070\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u6CD5\u7684\u5951\u7D04\u3084\u79D1\u5B66\u8AD6\u6587\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5834\u5408\u3001BERT\u306E\u3088\u3046\u306A\u7D20\u306ETransformer\u30E2\u30C7\u30EB\u306F\u901A\u5E38\u3001\u30B3\u30FC\u30D1\u30B9\u5185\u306E\u30C9\u30E1\u30A4\u30F3\u7279\u6709\u306E\u5358\u8A9E\u3092\u7A00\u306A\u30C8\u30FC\u30AF\u30F3\u3068\u3057\u3066\u6271\u3046\u305F\u3081\u3001\u7D50\u679C\u3068\u3057\u3066\u6E80\u8DB3\u306E\u3044\u304F\u6027\u80FD\u304C\u5F97\u3089\u308C\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30C9\u30E1\u30A4\u30F3\u5185\u30C7\u30FC\u30BF\u3067\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u5FAE\u8ABF\u6574\u3059\u308B\u3053\u3068\u3067\u3001\u591A\u304F\u306E\u4E0B\u6D41\u30BF\u30B9\u30AF\u306E\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u3092\u5411\u4E0A\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u3001\u3053\u306E\u30B9\u30C6\u30C3\u30D7\u306F\u901A\u5E38\u4E00\u5EA6\u3060\u3051\u884C\u3048\u3070\u3088\u3044\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002"),B=m(),H=i("p"),W=a("\u3053\u306E\u3088\u3046\u306B\u3001\u4E8B\u524D\u306B\u5B66\u7FD2\u3057\u305F\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u30C9\u30E1\u30A4\u30F3\u5185\u30C7\u30FC\u30BF\u3067\u5FAE\u8ABF\u6574\u3059\u308B\u30D7\u30ED\u30BB\u30B9\u306F\u3001\u901A\u5E38"),j=i("em"),P=a("\u30C9\u30E1\u30A4\u30F3\u9069\u5FDC"),se=a("\u3068\u547C\u3070\u308C\u307E\u3059\u3002\u3053\u308C\u306F2018\u5E74\u306B"),G=i("a"),Z=a("ULMFiT"),Y=a("\u306B\u3088\u3063\u3066\u666E\u53CA\u3057\u307E\u3057\u305F\u3002\u8EE2\u79FB\u5B66\u7FD2\u3092NLP\u3067\u672C\u5F53\u306B\u4F7F\u3048\u308B\u3088\u3046\u306B\u3057\u305F\u6700\u521D\u306E\u30CB\u30E5\u30FC\u30E9\u30EB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\uFF08LSTM\u304C\u30D9\u30FC\u30B9\uFF09\u306E1\u3064\u3067\u3059\u3002ULMFiT\u306B\u3088\u308B\u30C9\u30E1\u30A4\u30F3\u9069\u5FDC\u306E\u4F8B\u3092\u4E0B\u306E\u753B\u50CF\u306B\u793A\u3057\u307E\u3059\u3002\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3067\u306F\u3001LSTM\u306E\u4EE3\u308F\u308A\u306BTransformer\u3092\u4F7F\u3063\u3066\u3001\u540C\u69D8\u306E\u3053\u3068\u3092\u884C\u3044\u307E\u3059\uFF01"),he=m(),X=i("div"),ie=i("img"),je=m(),U=i("img"),Q=m(),le=i("p"),ce=a("\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u7D42\u308F\u308A\u306B\u306F\u3001\u4EE5\u4E0B\u306E\u3088\u3046\u306A\u6587\u7AE0\u3092\u81EA\u52D5\u88DC\u5B8C\u3067\u304D\u308B"),te=i("a"),ge=a("\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB"),Be=a("\u304CHub\u4E0A\u306B\u3067\u304D\u3066\u3044\u308B\u3053\u3068\u3067\u3057\u3087\u3046\u3002"),Ie=m(),re=i("iframe"),Fe=m(),fe=i("p"),Ke=a("\u305D\u308C\u3067\u306F\u59CB\u3081\u307E\u3057\u3087\u3046\uFF01"),ke=m(),v(De.$$.fragment),pe=m(),v(ve.$$.fragment),$e=m(),Ee=i("h2"),_e=a("\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u7528\u306E\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u9078\u629E"),Re=m(),me=i("p"),Ae=a("\u307E\u305A\u3001\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u306B\u9069\u3057\u305F\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u3092\u9078\u3073\u307E\u3057\u3087\u3046\u3002\u4EE5\u4E0B\u306E\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u306E\u3088\u3046\u306B\u3001"),ye=i("a"),S=a("\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6"),ee=a("\u306E \u201CFill-Mask \u201C\u30D5\u30A3\u30EB\u30BF\u3092\u9069\u7528\u3059\u308B\u3068\u3001\u5019\u88DC\u306E\u30EA\u30B9\u30C8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002"),He=m(),ae=i("div"),we=i("img"),ne=m(),qe=i("p"),J=a("BERT \u3068 RoBERTa \u30E2\u30C7\u30EB\u306E\u30D5\u30A1\u30DF\u30EA\u30FC\u304C\u6700\u3082\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u3053\u3053\u3067\u306F "),Le=i("a"),Ge=a("DistilBERT"),Ne=a(" \u3068\u547C\u3070\u308C\u308B\u30E2\u30C7\u30EB\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002\u3053\u306E\u30E2\u30C7\u30EB\u306F\u3001\u4E0B\u6D41\u30BF\u30B9\u30AF\u306E\u6027\u80FD\u3092\u307B\u3068\u3093\u3069\u640D\u306A\u3046\u3053\u3068\u306A\u304F\u3001\u3088\u308A\u9AD8\u901F\u306B\u5B66\u7FD2\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Je=m(),Me=i("p"),Pe=a("\u3053\u306E\u30E2\u30C7\u30EB\u306F\u3001"),z=i("a"),V=i("em"),_s=a("\u77E5\u8B58\u84B8\u7559"),de=a("\u3068\u547C\u3070\u308C\u308B\u7279\u5225\u306A\u6280\u8853\u3092\u4F7F\u7528\u3057\u3066\u8A13\u7DF4\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u306E\u624B\u6CD5\u306F\u3001BERT\u306E\u3088\u3046\u306A\u5927\u304D\u306A\u300C\u6559\u5E2B\u30E2\u30C7\u30EB\u300D\u304C\u3001\u305D\u308C\u3088\u308A\u306F\u308B\u304B\u306B\u5C11\u306A\u3044\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064\u300C\u751F\u5F92\u30E2\u30C7\u30EB\u300D\u306E\u8A13\u7DF4\u3092\u5C0E\u304F\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u3002"),Qe=m(),Ue=i("p"),cs=a("\u77E5\u8B58\u84B8\u6E9C\u306E\u8A73\u7D30\u3092\u8AAC\u660E\u3059\u308B\u3068\u3001\u3053\u306E\u7AE0\u306E\u5185\u5BB9\u304B\u3089\u96E2\u308C\u3059\u304E\u3066\u3057\u307E\u3044\u307E\u3059\u304C\u3001\u3082\u3057\u8208\u5473\u304C\u3042\u308C\u3070\u3001"),ns=i("a"),fs=i("em"),os=a("Natural Language Processing with Transformers"),xe=a(" \uFF08\u901A\u79F0Transformers\u6559\u79D1\u66F8\uFF09\u3067\u305D\u308C\u306B\u3064\u3044\u3066\u3059\u3079\u3066\u8AAD\u3080\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Xe=m(),ue.c(),ms=m(),Ze=i("p"),Ks=a("\u7D046,700\u4E07\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064DistilBERT\u306F\u3001BERT\u306E\u57FA\u672C\u30E2\u30C7\u30EB\u3088\u308A\u3082\u7D042\u500D\u5C0F\u3055\u304F\u3001\u3053\u308C\u306F\u3001\u5B66\u7FD2\u6642\u306B\u7D042\u500D\u306E\u30B9\u30D4\u30FC\u30C9\u30A2\u30C3\u30D7\u306B\u76F8\u5F53\u3057\u307E\u3059\uFF08\u7D20\u6674\u3089\u3057\u3044\uFF01\uFF09\u3002\u305D\u308C\u3067\u306F\u3001\u3053\u306E\u30E2\u30C7\u30EB\u304C\u4E88\u6E2C\u3059\u308B\u3001\u5C0F\u3055\u306A\u30C6\u30AD\u30B9\u30C8\u30B5\u30F3\u30D7\u30EB\u306E\u6700\u3082\u53EF\u80FD\u6027\u306E\u9AD8\u3044\u5B8C\u6210\u5F62\u306F\u3069\u306E\u3088\u3046\u306A\u7A2E\u985E\u306E\u30C8\u30FC\u30AF\u30F3\u3067\u3042\u308B\u304B\u3092\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),es=m(),v(ss.$$.fragment),ts=m(),oe=i("p"),ds=a("\u4EBA\u9593\u306A\u3089 "),hs=i("code"),at=a("[MASK]"),Es=a(" \u30C8\u30FC\u30AF\u30F3\u306B\u5BFE\u3057\u3066\u3001\u201Cday\u201D, \u201Cride\u201D, \u201Cpainting\u201D \u306A\u3069\u306E\u591A\u304F\u306E\u53EF\u80FD\u6027\u3092\u60F3\u50CF\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u5834\u5408\u3001\u4E88\u6E2C\u5024\u306F\u30E2\u30C7\u30EB\u304C\u5B66\u7FD2\u3057\u305F\u30B3\u30FC\u30D1\u30B9\u306B\u4F9D\u5B58\u3057\u307E\u3059\u3002\u306A\u305C\u306A\u3089\u3001\u30E2\u30C7\u30EB\u306F\u30C7\u30FC\u30BF\u306B\u5B58\u5728\u3059\u308B\u7D71\u8A08\u7684\u30D1\u30BF\u30FC\u30F3\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u306B\u5B66\u7FD2\u3059\u308B\u304B\u3089\u3067\u3059\u3002BERT\u3068\u540C\u69D8\u306B\u3001DistilBERT\u306F"),gs=i("a"),ys=a("English Wikipedia"),lt=a(" \u3068 "),is=i("a"),St=a("BookCorpus"),rt=a(" \u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3067\u4E8B\u524D\u5B66\u7FD2\u3055\u308C\u3066\u3044\u308B\u306E\u3067\u3001"),f=i("code"),O=a("[MASK]"),nt=a("\u306E\u4E88\u6E2C\u306F\u3053\u308C\u3089\u306E\u30C9\u30E1\u30A4\u30F3\u3092\u53CD\u6620\u3059\u308B\u3068\u4E88\u60F3\u3055\u308C\u307E\u3059\u3002\u30DE\u30B9\u30AF\u3092\u4E88\u6E2C\u3059\u308B\u305F\u3081\u306B\u306F\u3001\u30E2\u30C7\u30EB\u306E\u5165\u529B\u751F\u6210\u7528\u306BDistilBERT\u306Etokenizer\u304C\u5FC5\u8981\u306A\u306E\u3067\u3001\u3053\u308C\u3082Hub\u304B\u3089\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u307E\u3057\u3087\u3046\u3002"),Ot=m(),v(Rs.$$.fragment),Kt=m(),bs=i("p"),Ia=a("tokenizer\u30E2\u30C7\u30EB\u304C\u3042\u308C\u3070\u3001\u30C6\u30AD\u30B9\u30C8\u30B5\u30F3\u30D7\u30EB\u3092\u30E2\u30C7\u30EB\u306B\u6E21\u3057\u3001\u30ED\u30B8\u30C3\u30C8\u3092\u62BD\u51FA\u3057\u3001\u4E0A\u4F4D5\u3064\u306E\u5019\u88DC\u3092\u51FA\u529B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Rt=m(),ps.c(),Xs=m(),v(Ls.$$.fragment),Zs=m(),et=i("p"),ot=a("\u51FA\u529B\u304B\u3089\u3001\u30E2\u30C7\u30EB\u306E\u4E88\u6E2C\u306F\u65E5\u5E38\u7684\u306A\u7528\u8A9E\u306B\u8A00\u53CA\u3057\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u304C\u3001\u3053\u308C\u306F\u82F1\u8A9E\u7248\u30A6\u30A3\u30AD\u30DA\u30C7\u30A3\u30A2\u304C\u57FA\u76E4\u3068\u306A\u3063\u3066\u3044\u308B\u4E8B\u3092\u8003\u3048\u308C\u3070\u9A5A\u304F\u3053\u3068\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u3067\u306F\u3001\u3053\u306E\u9818\u57DF\u3092\u3082\u3046\u5C11\u3057\u30CB\u30C3\u30C1\u306A\u3082\u306E\u3001\u3064\u307E\u308A\u3001\u5206\u88C2\u3057\u3066\u3044\u308B\u6620\u753B\u8A55\u4FA1\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u5909\u3048\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Lt=m(),Bs=i("h2"),it=a("\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8"),Bt=m(),as=i("p"),Ga=a("\u30C9\u30E1\u30A4\u30F3\u9069\u5FDC\u306E\u4F8B\u3092\u793A\u3059\u305F\u3081\u306B\u3001\u79C1\u305F\u3061\u306F\u6709\u540D\u306A"),Fs=i("a"),Ua=a("Large Movie Review Dataset"),pt=a(" (\u7565\u3057\u3066IMDb)\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u3053\u308C\u306F\u3001\u611F\u60C5\u5206\u6790\u30E2\u30C7\u30EB\u306E\u30D9\u30F3\u30C1\u30DE\u30FC\u30AF\u306B\u3088\u304F\u4F7F\u308F\u308C\u308B\u3001\u6620\u753B\u306E\u30EC\u30D3\u30E5\u30FC\u306E\u30B3\u30FC\u30D1\u30B9\u3067\u3059\u3002\u3053\u306E\u30B3\u30FC\u30D1\u30B9\u3067DistilBERT\u3092\u5FAE\u8ABF\u6574\u3059\u308B\u3053\u3068\u3067\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u304C\u4E8B\u524D\u5B66\u7FD2\u3057\u305FWikipedia\u306E\u4E8B\u5B9F\u306B\u57FA\u3065\u304F\u30C7\u30FC\u30BF\u304B\u3089\u3001\u6620\u753B\u30EC\u30D3\u30E5\u30FC\u306E\u3088\u308A\u4E3B\u89B3\u7684\u306A\u8981\u7D20\u306B\u8A9E\u5F59\u3092\u9069\u5FDC\u3055\u305B\u308B\u3053\u3068\u304C\u671F\u5F85\u3055\u308C\u307E\u3059\u3002\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6\u306E\u30C7\u30FC\u30BF\u306F\u3001\u{1F917} Datasets\u306E "),_t=i("code"),Wa=a("load_dataset()"),Ya=a(" \u95A2\u6570\u3067\u53D6\u5F97\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Br=m(),v(Ft.$$.fragment),Fr=m(),v(Ht.$$.fragment),Hr=m(),ls=i("p"),Bl=i("code"),Go=a("train"),Uo=a(" \u3068 "),Fl=i("code"),Wo=a("test"),Yo=a(" \u7528\u306E\u30C7\u30FC\u30BF\u5206\u5272\u306B\u306F\u305D\u308C\u305E\u308C25,000\u4EF6\u306E\u30EC\u30D3\u30E5\u30FC\u304B\u3089\u69CB\u6210\u3055\u308C\u3001\u30E9\u30D9\u30EB\u4ED8\u3051\u3055\u308C\u3066\u3044\u306A\u3044 "),Hl=i("code"),Vo=a("unsupervised"),Jo=a(" \u3068\u3044\u3046\u5206\u5272\u306B\u306F50,000\u4EF6\u306E\u30EC\u30D3\u30E5\u30FC\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u3069\u306E\u3088\u3046\u306A\u30C6\u30AD\u30B9\u30C8\u3092\u6271\u3063\u3066\u3044\u308B\u304B\u77E5\u308B\u305F\u3081\u306B\u3001\u3044\u304F\u3064\u304B\u306E\u30B5\u30F3\u30D7\u30EB\u3092\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u3053\u306E\u30B3\u30FC\u30B9\u306E\u524D\u306E\u7AE0\u3067\u884C\u3063\u305F\u3088\u3046\u306B\u3001 "),Nl=i("code"),Qo=a("Dataset.shuffle()"),Xo=a(" \u3068 "),Il=i("code"),Zo=a("Dataset.select()"),ei=a(" \u95A2\u6570\u3092\u9023\u9396\u3055\u305B\u3066\u3001\u30E9\u30F3\u30C0\u30E0\u306A\u30B5\u30F3\u30D7\u30EB\u3092\u4F5C\u6210\u3057\u307E\u3057\u3087\u3046\u3002"),Nr=m(),v(Nt.$$.fragment),Ir=m(),v(It.$$.fragment),Gr=m(),Hs=i("p"),si=a("\u305D\u3046\u3001\u3053\u308C\u3089\u306F\u78BA\u304B\u306B\u6620\u753B\u306E\u30EC\u30D3\u30E5\u30FC\u3067\u3059\u3002\u3082\u3057\u3042\u306A\u305F\u304C\u5341\u5206\u306B\u5E74\u3092\u53D6\u3063\u3066\u3044\u308B\u306A\u3089\u3001\u6700\u5F8C\u306E\u30EC\u30D3\u30E5\u30FC\u306B\u3042\u308BVHS\u7248\u3092\u6240\u6709\u3057\u3066\u3044\u308B\u3068\u3044\u3046\u30B3\u30E1\u30F3\u30C8\u3055\u3048\u7406\u89E3\u3067\u304D\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093\u{1F61C}! \u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u306B\u306F\u30E9\u30D9\u30EB\u306F\u5FC5\u8981\u3042\u308A\u307E\u305B\u3093\u304C\u3001"),Gl=i("code"),ti=a("0"),ai=a("\u306F\u5426\u5B9A\u7684\u306A\u30EC\u30D3\u30E5\u30FC\u3001"),Ul=i("code"),li=a("1"),ri=a("\u306F\u80AF\u5B9A\u7684\u306A\u30EC\u30D3\u30E5\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u3053\u3068\u304C\u3082\u3046\u308F\u304B\u308A\u307E\u3057\u305F\u3002"),Ur=m(),v(ct.$$.fragment),Wr=m(),ft=i("p"),ni=a("\u3055\u3066\u3001\u30C7\u30FC\u30BF\u3092\u3056\u3063\u3068\u898B\u305F\u3068\u3053\u308D\u3067\u3001\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u306E\u305F\u3081\u306E\u6E96\u5099\u306B\u53D6\u308A\u304B\u304B\u308A\u307E\u3057\u3087\u3046\u3002"),Va=i("a"),oi=a("\u7B2C3\u7AE0"),ii=a("\u3067\u898B\u305F\u30B7\u30FC\u30B1\u30F3\u30B9\u5206\u985E\u306E\u30BF\u30B9\u30AF\u3068\u6BD4\u8F03\u3059\u308B\u3068\u3001\u3044\u304F\u3064\u304B\u306E\u8FFD\u52A0\u30B9\u30C6\u30C3\u30D7\u304C\u5FC5\u8981\u3067\u3042\u308B\u3053\u3068\u304C\u308F\u304B\u308B\u3067\u3057\u3087\u3046\u3002\u3055\u3042\u3001\u59CB\u3081\u307E\u3057\u3087\u3046\uFF01"),Yr=m(),Gt=i("h2"),pi=a("\u30C7\u30FC\u30BF\u306E\u524D\u51E6\u7406"),Vr=m(),v(Ut.$$.fragment),Jr=m(),Ja=i("p"),_i=a("\u81EA\u5DF1\u56DE\u5E30\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u3082\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u3082\u3001\u5171\u901A\u306E\u524D\u51E6\u7406\u3068\u3057\u3066\u3001\u3059\u3079\u3066\u306E\u7528\u4F8B\u3092\u9023\u7D50\u3057\u3001\u30B3\u30FC\u30D1\u30B9\u5168\u4F53\u3092\u540C\u3058\u5927\u304D\u3055\u306E\u65AD\u7247\u306B\u5206\u5272\u3059\u308B\u3053\u3068\u304C\u884C\u308F\u308C\u307E\u3059\u3002\u3053\u308C\u306F\u3001\u500B\u3005\u306E\u30B5\u30F3\u30D7\u30EB\u3092\u5358\u7D14\u306B\u30C8\u30FC\u30AF\u30F3\u5316\u3059\u308B\u3068\u3044\u3046\u3001\u79C1\u9054\u306E\u901A\u5E38\u306E\u30A2\u30D7\u30ED\u30FC\u30C1\u3068\u306F\u5168\u304F\u7570\u306A\u308B\u3082\u306E\u3067\u3059\u3002\u306A\u305C\u3059\u3079\u3066\u3092\u9023\u7D50\u3059\u308B\u306E\u3067\u3057\u3087\u3046\u304B\uFF1F\u305D\u308C\u306F\u3001\u500B\u3005\u306E\u4F8B\u6587\u304C\u9577\u3059\u304E\u308B\u3068\u5207\u308A\u6368\u3066\u3089\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u3001\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u30BF\u30B9\u30AF\u306B\u5F79\u7ACB\u3064\u304B\u3082\u3057\u308C\u306A\u3044\u60C5\u5831\u304C\u5931\u308F\u308C\u3066\u3057\u307E\u3046\u304B\u3089\u3067\u3059\uFF01"),Qr=m(),We=i("p"),ci=a("\u305D\u3053\u3067\u3001\u307E\u305A\u3044\u3064\u3082\u306E\u3088\u3046\u306B\u30B3\u30FC\u30D1\u30B9\u3092\u30C8\u30FC\u30AF\u30F3\u5316\u3057\u307E\u3059\u3002\u305F\u3060\u3057\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3059\u308B\u969B\u306B "),Wl=i("code"),fi=a("truncation=True"),mi=a(" \u30AA\u30D7\u30B7\u30E7\u30F3\u3092tokenizer\u306B"),Yl=i("em"),di=a("\u8A2D\u5B9A\u3057\u306A\u3044"),ui=a("\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u307E\u305F\u3001\u5358\u8A9EID\u304C\u3042\u308C\u3070\u305D\u308C\u3092\u53D6\u5F97\u3057\u307E\u3059\uFF08"),Qa=i("a"),hi=a("6\u7AE0"),gi=a("\u3067\u8AAC\u660E\u3057\u305F\u9AD8\u901Ftokenizer\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u305D\u3046\u306A\u308A\u307E\u3059\uFF09\u3002\u5F8C\u3067\u5358\u8A9E\u5168\u4F53\u3092\u30DE\u30B9\u30AD\u30F3\u30B0\u3059\u308B\u305F\u3081\u306B\u5FC5\u8981\u306B\u306A\u308B\u304B\u3089\u3067\u3059\u3002\u3053\u308C\u3092\u30B7\u30F3\u30D7\u30EB\u306A\u95A2\u6570\u306B\u307E\u3068\u3081\u3001\u3064\u3044\u3067\u306B "),Vl=i("code"),bi=a("text"),ki=a(" \u3068 "),Jl=i("code"),$i=a("label"),wi=a(" \u30AB\u30E9\u30E0\u3082\u4E0D\u8981\u306B\u306A\u3063\u305F\u306E\u3067\u524A\u9664\u3057\u3066\u3057\u307E\u3044\u307E\u3057\u3087\u3046\u3002"),Xr=m(),v(Wt.$$.fragment),Zr=m(),v(Yt.$$.fragment),en=m(),ks=i("p"),ji=a("DistilBERT\u306FBERT\u306B\u4F3C\u305F\u30E2\u30C7\u30EB\u306A\u306E\u3067\u3001\u30A8\u30F3\u30B3\u30FC\u30C9\u3055\u308C\u305F\u30C6\u30AD\u30B9\u30C8\u306F\u3001\u4ED6\u306E\u7AE0\u3067\u898B\u305F "),Ql=i("code"),vi=a("input_ids"),Ei=a(" \u3068 "),Xl=i("code"),yi=a("attention_mask"),xi=a(" \u306B\u52A0\u3048\u3001\u79C1\u9054\u304C\u8FFD\u52A0\u3057\u305F "),Zl=i("code"),Di=a("word_ids"),qi=a(" \u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002"),sn=m(),mt=i("p"),Mi=a("\u3055\u3066\u3001\u6620\u753B\u306E\u30EC\u30D3\u30E5\u30FC\u3092\u30C8\u30FC\u30AF\u30F3\u5316\u3057\u305F\u306E\u3067\u3001\u6B21\u306E\u30B9\u30C6\u30C3\u30D7\u306F\u305D\u308C\u3089\u3092\u3059\u3079\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3057\u3066\u3001\u7D50\u679C\u3092\u65AD\u7247\u306B\u5206\u5272\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u3057\u304B\u3057\u3001\u3053\u306E\u65AD\u7247\u306E\u5927\u304D\u3055\u306F\u3069\u306E\u7A0B\u5EA6\u306B\u3059\u3079\u304D\u3067\u3057\u3087\u3046\u304B\uFF1F\u3053\u308C\u306F\u6700\u7D42\u7684\u306B\u306F\u5229\u7528\u53EF\u80FD\u306A GPU \u30E1\u30E2\u30EA\u306E\u91CF\u306B\u3088\u3063\u3066\u6C7A\u307E\u308A\u307E\u3059\u304C\u3001\u826F\u3044\u51FA\u767A\u70B9\u306F\u30E2\u30C7\u30EB\u306E\u6700\u5927\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u304C\u4F55\u3067\u3042\u308B\u304B\u3092\u898B\u308B\u3053\u3068\u3067\u3059\u3002\u3053\u308C\u306Ftokenizer\u306E "),er=i("code"),Ti=a("model_max_length"),zi=a(" \u5C5E\u6027\u3092\u8ABF\u3079\u308B\u3053\u3068\u3067\u63A8\u6E2C\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),tn=m(),v(Vt.$$.fragment),an=m(),v(Jt.$$.fragment),ln=m(),dt=i("p"),Ai=a("\u3053\u306E\u5024\u306F\u3001\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u305F "),sr=i("em"),Pi=a("tokenizer_config.json"),Ci=a(" \u30D5\u30A1\u30A4\u30EB\u304B\u3089\u53D6\u5F97\u3057\u307E\u3059\u3002\u3053\u306E\u5834\u5408\u3001BERT \u3068\u540C\u69D8\u306B\u3001\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u304C 512 \u30C8\u30FC\u30AF\u30F3\u3067\u3042\u308B\u3053\u3068\u304C\u5206\u304B\u308A\u307E\u3059\u3002"),rn=m(),v(ut.$$.fragment),nn=m(),Xa=i("p"),Si=a("\u3055\u308C\u3001Google Colab\u5185\u3067\u5229\u7528\u53EF\u80FD\u306AGPU\u3067\u5B9F\u9A13\u3092\u884C\u3046\u305F\u3081\u306B\u3001\u30E1\u30E2\u30EA\u306B\u53CE\u307E\u308B\u3088\u3046\u306A\u5C11\u3057\u5C0F\u3055\u3081\u306E\u3082\u306E\u3092\u9078\u3076\u3053\u3068\u306B\u3057\u307E\u3059\u3002"),on=m(),v(Qt.$$.fragment),pn=m(),v(ht.$$.fragment),_n=m(),Za=i("p"),Oi=a("\u3055\u3066\u3001\u3053\u3053\u304B\u3089\u304C\u697D\u3057\u3044\u3068\u3053\u308D\u3067\u3059\u3002\u9023\u7D50\u304C\u3069\u306E\u3088\u3046\u306B\u6A5F\u80FD\u3059\u308B\u304B\u3092\u793A\u3059\u305F\u3081\u306B\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3055\u308C\u305F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u304B\u3089\u3044\u304F\u3064\u304B\u306E\u30EC\u30D3\u30E5\u30FC\u3092\u53D6\u308A\u51FA\u3057\u3001\u30EC\u30D3\u30E5\u30FC\u6BCE\u306E\u30C8\u30FC\u30AF\u30F3\u6570\u3092\u51FA\u529B\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),cn=m(),v(Xt.$$.fragment),fn=m(),v(Zt.$$.fragment),mn=m(),el=i("p"),Ki=a("\u305D\u3057\u3066\u3001\u3053\u308C\u3089\u306E\u4F8B\u3092\u3059\u3079\u3066\u3092\u30B7\u30F3\u30D7\u30EB\u306A\u8F9E\u66F8\u5185\u5305\u8868\u8A18\u3092\u4F7F\u3063\u3066\u9023\u7D50\u3059\u308B\u3068\u3001\u6B21\u306E\u3088\u3046\u306B\u306A\u308A\u307E\u3059\u3002"),dn=m(),v(ea.$$.fragment),un=m(),v(sa.$$.fragment),hn=m(),sl=i("p"),Ri=a("\u7D20\u6674\u3089\u3057\u3044\uFF01\u5168\u4F53\u306E\u9577\u3055\u306E\u88CF\u4ED8\u3051\u304C\u3068\u308C\u307E\u3057\u305F\u3002"),gn=m(),Ns=i("p"),Li=a("\u3067\u306F\u3001\u9023\u7D50\u3055\u308C\u305F\u30EC\u30D3\u30E5\u30FC\u3092 "),tr=i("code"),Bi=a("block_size"),Fi=a(" \u3067\u6307\u5B9A\u3055\u308C\u305F\u30B5\u30A4\u30BA\u306E\u65AD\u7247\u306B\u5206\u5272\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u305D\u306E\u305F\u3081\u306B\u3001 "),ar=i("code"),Hi=a("concatenated_examples"),Ni=a(" \u3092\u7E70\u308A\u8FD4\u3057\u51E6\u7406\u3057\u3001\u30EA\u30B9\u30C8\u5185\u5305\u8868\u8A18\u3092\u4F7F\u7528\u3057\u3066\u5404\u7279\u5FB4\u306E\u30B9\u30E9\u30A4\u30B9\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\u305D\u306E\u7D50\u679C\u3001\u65AD\u7247\u306E\u8F9E\u66F8\u304C\u3067\u304D\u3042\u304C\u308A\u307E\u3059\u3002"),bn=m(),v(ta.$$.fragment),kn=m(),v(aa.$$.fragment),$n=m(),tl=i("p"),Ii=a("\u3053\u306E\u4F8B\u3067\u308F\u304B\u308B\u3088\u3046\u306B\u3001\u4E00\u822C\u7684\u306B\u6700\u5F8C\u306E\u65AD\u7247\u306F\u6700\u5927\u65AD\u7247\u30B5\u30A4\u30BA\u3088\u308A\u5C0F\u3055\u304F\u306A\u308A\u307E\u3059\u3002\u3053\u308C\u3092\u6271\u3046\u306B\u306F\u3001\u4E3B\u306B 2 \u3064\u306E\u65B9\u6CD5\u304C\u3042\u308A\u307E\u3059\u3002"),wn=m(),gt=i("ul"),la=i("li"),Gi=a("\u6700\u5F8C\u306E\u65AD\u7247\u304C "),lr=i("code"),Ui=a("chunk_size"),Wi=a(" \u3088\u308A\u3082\u5C0F\u3055\u3051\u308C\u3070\u524A\u9664\u3059\u308B"),Yi=m(),ra=i("li"),Vi=a("\u6700\u5F8C\u306E\u65AD\u7247\u306E\u9577\u3055\u304C "),rr=i("code"),Ji=a("chunk_size"),Qi=a(" \u3068\u7B49\u3057\u304F\u306A\u308B\u307E\u3067\u3001\u6700\u5F8C\u306E\u65AD\u7247\u306B\u30C0\u30DF\u30FC\u30C7\u30FC\u30BF\u3092\u8A70\u3081\u8FBC\u3080"),jn=m(),al=i("p"),Xi=a("\u3053\u3053\u3067\u306F\u3001\u6700\u521D\u306E\u30A2\u30D7\u30ED\u30FC\u30C1\u3092\u3068\u308A\u307E\u3059\u3002\u4E0A\u8A18\u306E\u30ED\u30B8\u30C3\u30AF\u3092\u3059\u3079\u3066\u3072\u3068\u3064\u306E\u95A2\u6570\u306B\u307E\u3068\u3081\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u9069\u7528\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),vn=m(),v(na.$$.fragment),En=m(),us=i("p"),nr=i("code"),Zi=a("group_texts()"),ep=a(" \u306E\u6700\u5F8C\u306E\u30B9\u30C6\u30C3\u30D7\u3067\u306F\u3001 "),or=i("code"),sp=a("input_ids"),tp=a(" \u5217\u306E\u30B3\u30D4\u30FC\u3067\u3042\u308B\u65B0\u3057\u3044 "),ir=i("code"),ap=a("labels"),lp=a(" \u5217\u3092\u4F5C\u6210\u3057\u3066\u3044\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u3053\u308C\u304B\u3089\u8AAC\u660E\u3059\u308B\u3088\u3046\u306B\u3001\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u306F\u3001\u5165\u529B\u90E8\u306B\u542B\u307E\u308C\u308B\u30E9\u30F3\u30C0\u30E0\u306A\u30DE\u30B9\u30AF\u30C8\u30FC\u30AF\u30F3\u3092\u4E88\u6E2C\u3059\u308B\u3053\u3068\u304C\u76EE\u7684\u3067\u3059\u3002 "),pr=i("code"),rp=a("labels"),np=a(" \u5217\u306F\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u304C\u5B66\u7FD2\u306E\u969B\u306B\u53C2\u8003\u3059\u308B\u771F\u5B9F\u306E\u5024\u3092\u63D0\u4F9B\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002"),yn=m(),Is=i("p"),op=a("\u305D\u308C\u3067\u306F\u3001\u4FE1\u983C\u3067\u304D\u308B "),_r=i("code"),ip=a("Dataset.map()"),pp=a(" \u95A2\u6570\u3092\u4F7F\u3063\u3066\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B "),cr=i("code"),_p=a("group_texts()"),cp=a(" \u3092\u9069\u7528\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),xn=m(),v(oa.$$.fragment),Dn=m(),v(ia.$$.fragment),qn=m(),Ye=i("p"),fp=a("\u30C6\u30AD\u30B9\u30C8\u3092\u30B0\u30EB\u30FC\u30D7\u5316\u3057\u3001\u65AD\u7247\u306B\u5206\u3051\u305F\u3053\u3068\u3067"),fr=i("code"),mp=a("train"),dp=a("\u3068"),mr=i("code"),up=a("test"),hp=a("\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306725,000\u3088\u308A\u3082\u591A\u304F\u306E\u30B5\u30F3\u30D7\u30EB\u304C\u751F\u6210\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u3053\u308C\u306F\u3001\u5143\u306E\u30B3\u30FC\u30D1\u30B9\u306B\u8907\u6570\u306E\u30EC\u30D3\u30E5\u30FC\u3092\u542B\u3080\u3082\u306E\u304C\u3042\u308B\u305F\u3081 "),dr=i("em"),gp=a("\u9023\u7D9A\u30C8\u30FC\u30AF\u30F3"),bp=a(" \u3092\u542B\u3080\u30B5\u30F3\u30D7\u30EB\u304C\u3067\u304D\u305F\u304B\u3089\u3067\u3059\u3002\u3053\u306E\u3053\u3068\u306F\u3001\u65AD\u7247\u306E1\u3064\u306B\u3042\u308B\u7279\u5225\u306A "),ur=i("code"),kp=a("[SEP]"),$p=a(" \u3068 "),hr=i("code"),wp=a("[CLS]"),jp=a(" \u30C8\u30FC\u30AF\u30F3\u3092\u63A2\u3059\u3053\u3068\u3067\u660E\u78BA\u306B\u308F\u304B\u308A\u307E\u3059\u3002"),Mn=m(),v(pa.$$.fragment),Tn=m(),v(_a.$$.fragment),zn=m(),ll=i("p"),vp=a("\u4E0A\u306E\u4F8B\u3067\u306F\u3001\u9AD8\u6821\u306B\u95A2\u3059\u308B\u6620\u753B\u3068\u30DB\u30FC\u30E0\u30EC\u30B9\u306B\u95A2\u3059\u308B\u6620\u753B\u306E\u30EC\u30D3\u30E5\u30FC\u304C2\u3064\u91CD\u8907\u3057\u3066\u3044\u308B\u306E\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u307E\u305F\u3001\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u306E\u30E9\u30D9\u30EB\u304C\u3069\u306E\u3088\u3046\u306B\u898B\u3048\u308B\u304B\u78BA\u8A8D\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),An=m(),v(ca.$$.fragment),Pn=m(),v(fa.$$.fragment),Cn=m(),$s=i("p"),Ep=a("\u4E0A\u306E "),gr=i("code"),yp=a("group_texts()"),xp=a(" \u95A2\u6570\u304B\u3089\u4E88\u60F3\u3055\u308C\u308B\u3088\u3046\u306B\u3001\u3053\u308C\u306F\u30C7\u30B3\u30FC\u30C9\u3055\u308C\u305F "),br=i("code"),Dp=a("input_ids"),qp=a(" \u3068\u540C\u3058\u306B\u898B\u3048\u307E\u3059\u3002\u3057\u304B\u3057\u3001\u305D\u308C\u3067\u306F\u3053\u306E\u30E2\u30C7\u30EB\u306F\u3069\u3046\u3084\u3063\u3066\u4F55\u304B\u3092\u5B66\u7FD2\u3059\u308B\u306E\u3067\u3057\u3087\u3046\u304B\uFF1F\u5165\u529B\u306E\u30E9\u30F3\u30C0\u30E0\u306A\u4F4D\u7F6E\u306B "),kr=i("code"),Mp=a("[MASK]"),Tp=a(" \u30C8\u30FC\u30AF\u30F3\u3092\u633F\u5165\u3059\u308B\u3001\u3068\u3044\u3046\u91CD\u8981\u306A\u30B9\u30C6\u30C3\u30D7\u304C\u629C\u3051\u3066\u3044\u308B\u306E\u3067\u3059\u3002\u305D\u308C\u3067\u306F\u3001\u7279\u5225\u306A\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u3063\u3066\u3001\u5FAE\u8ABF\u6574\u306E\u969B\u306B\u3069\u306E\u3088\u3046\u306B\u3053\u308C\u3092\u884C\u3046\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Sn=m(),st=i("h2"),bt=i("a"),$r=i("span"),v(ma.$$.fragment),zp=m(),da=i("span"),Ap=a("DistilBERT\u3092"),wr=i("code"),Pp=a("Trainer"),Cp=a("API\u3067\u5FAE\u8ABF\u6574\u3059\u308B"),On=m(),ws=i("p"),Sp=a("\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574\u306F\u3001"),rl=i("a"),Op=a("\u7B2C3\u7AE0"),Kp=a("\u3067\u884C\u3063\u305F\u3088\u3046\u306A\u30B7\u30FC\u30B1\u30F3\u30B9\u5206\u985E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574\u3068\u307B\u307C\u540C\u3058\u3067\u3059\u3002\u552F\u4E00\u306E\u9055\u3044\u306F\u3001\u5404\u30D0\u30C3\u30C1\u306E\u30C6\u30AD\u30B9\u30C8\u306B\u542B\u307E\u308C\u308B\u3044\u304F\u3064\u304B\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u30E9\u30F3\u30C0\u30E0\u306B\u30DE\u30B9\u30AF\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u7279\u5225\u306A\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u304C\u5FC5\u8981\u3067\u3042\u308B\u3053\u3068\u3067\u3059\u3002\u5E78\u3044\u306A\u3053\u3068\u306B\u3001\u{1F917} Transformers\u306B\u306F\u3053\u306E\u30BF\u30B9\u30AF\u306E\u305F\u3081\u306B\u5C02\u7528\u306E "),jr=i("code"),Rp=a("DataCollatorForLanguageModeling"),Lp=a(" \u304C\u7528\u610F\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u79C1\u305F\u3061\u306Ftokenizer\u3068\u3001\u30DE\u30B9\u30AF\u3059\u308B\u30C8\u30FC\u30AF\u30F3\u306E\u5272\u5408\u3092\u6307\u5B9A\u3059\u308B "),vr=i("code"),Bp=a("mlm_probability"),Fp=a(" \u5F15\u6570\u3092\u6E21\u3059\u3060\u3051\u3067\u3088\u3044\u306E\u3067\u3059\u3002\u3053\u3053\u3067\u306F\u3001BERT\u3067\u4F7F\u7528\u3055\u308C\u3001\u6587\u732E\u4E0A\u3067\u3082\u4E00\u822C\u7684\u306A\u9078\u629E\u3067\u3042\u308B15\uFF05\u3092\u9078\u3073\u307E\u3059\u3002"),Kn=m(),v(ua.$$.fragment),Rn=m(),kt=i("p"),Hp=a("\u30E9\u30F3\u30C0\u30E0\u30DE\u30B9\u30AF\u304C\u3069\u306E\u3088\u3046\u306B\u6A5F\u80FD\u3059\u308B\u304B\u3092\u898B\u308B\u305F\u3081\u306B\u3001\u3044\u304F\u3064\u304B\u306E\u4F8B\u3092 data_collator \u306B\u4E0E\u3048\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u30B3\u30EC\u30FC\u30BF\u30FC\u306F\u8F9E\u66F8\u578B \u306E\u30EA\u30B9\u30C8\u3092\u60F3\u5B9A\u3057\u3066\u304A\u308A\u3001\u5404 \u8F9E\u66F8\u306F\u9023\u7D9A\u3057\u305F\u30C6\u30AD\u30B9\u30C8\u306E\u584A\u3092\u8868\u3059\u306E\u3067\u3001\u307E\u305A\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u7E70\u308A\u8FD4\u3057\u51E6\u7406\u3057\u3066\u304B\u3089\u30B3\u30EC\u30FC\u30BF\u30FC\u306B\u30D0\u30C3\u30C1\u3092\u6E21\u3057\u307E\u3059\u3002\u3053\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u306F "),Er=i("code"),Np=a('"word_ids"'),Ip=a(" \u30AD\u30FC\u3092\u5FC5\u8981\u3068\u3057\u306A\u3044\u306E\u3067\u3001\u3053\u308C\u3092\u524A\u9664\u3057\u307E\u3059\u3002"),Ln=m(),v(ha.$$.fragment),Bn=m(),v(ga.$$.fragment),Fn=m(),$t=i("p"),Gp=a(`\u3044\u3044\u3067\u3059\u306D\u3001\u3046\u307E\u304F\u3044\u304D\u307E\u3057\u305F\uFF01
`),yr=i("code"),Up=a("[MASK]"),Wp=a("\u30C8\u30FC\u30AF\u30F3\u304C\u30C6\u30AD\u30B9\u30C8\u306E\u69D8\u3005\u306A\u5834\u6240\u306B\u30E9\u30F3\u30C0\u30E0\u306B\u633F\u5165\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002"),Hn=m(),wt=i("p"),Yp=a("\u3053\u308C\u3089\u304C\u5B66\u7FD2\u4E2D\u306B\u30E2\u30C7\u30EB\u304C\u4E88\u6E2C\u3057\u306A\u3051\u308C\u3070\u306A\u3089\u306A\u3044\u30C8\u30FC\u30AF\u30F3\u306B\u306A\u308A\u307E\u3059\u3002\u305D\u3057\u3066\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u306E\u7D20\u6674\u3089\u3057\u3044\u3068\u3053\u308D\u306F\u3001\u30D0\u30C3\u30C1\u3054\u3068\u306B"),xr=i("code"),Vp=a("[MASK]"),Jp=a("\u306E\u633F\u5165\u3092\u30E9\u30F3\u30C0\u30E0\u306B\u3059\u308B\u3053\u3068\u3067\u3059!"),Nn=m(),v(jt.$$.fragment),In=m(),rs&&rs.c(),nl=m(),vt=i("p"),Qp=a("\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3059\u308B\u5834\u5408\u3001\u500B\u3005\u306E\u30C8\u30FC\u30AF\u30F3\u3067\u306F\u306A\u304F\u3001\u5358\u8A9E\u5168\u4F53\u3092\u30DE\u30B9\u30AD\u30F3\u30B0\u3059\u308B\u624B\u6CD5\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u624B\u6CD5\u306F "),Dr=i("em"),Xp=a("whole word masking"),Zp=a(" \u3068\u547C\u3070\u308C\u307E\u3059\u3002\u5358\u8A9E\u5168\u4F53\u3092\u30DE\u30B9\u30AD\u30F3\u30B0\u3059\u308B\u5834\u5408\u3001\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u81EA\u4F5C\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3068\u306F\u3001\u30B5\u30F3\u30D7\u30EB\u306E\u30EA\u30B9\u30C8\u3092\u53D7\u3051\u53D6\u308A\u3001\u305D\u308C\u3092\u30D0\u30C3\u30C1\u5909\u63DB\u3059\u308B\u95A2\u6570\u306E\u3053\u3068\u3067\u3059\u3002"),Gn=m(),ol=i("p"),e_=a("\u4ECA\u304B\u3089\u3084\u3063\u3066\u307F\u307E\u3057\u3087\u3046\uFF01"),Un=m(),Et=i("p"),s_=a("\u5148\u307B\u3069\u8A08\u7B97\u3057\u305F\u5358\u8A9EID\u3092\u4F7F\u3063\u3066\u3001\u5358\u8A9E\u306E\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3068\u5BFE\u5FDC\u3059\u308B\u30C8\u30FC\u30AF\u30F3\u306E\u30DE\u30C3\u30D7\u3092\u4F5C\u308B\u4E8B\u306B\u3057\u307E\u3059\u3002\u3069\u306E\u5358\u8A9E\u3092\u30DE\u30B9\u30AF\u3059\u308B\u304B\u3092\u30E9\u30F3\u30C0\u30E0\u306B\u6C7A\u3081\u3066\u3001\u305D\u306E\u30DE\u30B9\u30AF\u3092\u5165\u529B\u306B\u9069\u7528\u3057\u307E\u3059\u3002\u306A\u304A\u3001\u30E9\u30D9\u30EB\u306F\u30DE\u30B9\u30AF\u3059\u308B\u5358\u8A9E\u3092\u9664\u3044\u3066\u5168\u3066"),qr=i("code"),t_=a("-100"),a_=a("\u3067\u3059\u3002"),Wn=m(),Ds.c(),il=m(),pl=i("p"),l_=a("\u6B21\u306B\u3001\u5148\u307B\u3069\u3068\u540C\u3058\u30B5\u30F3\u30D7\u30EB\u3067\u8A66\u3057\u3066\u307F\u307E\u3059\u3002"),Yn=m(),v(ba.$$.fragment),Vn=m(),v(ka.$$.fragment),Jn=m(),v(yt.$$.fragment),Qn=m(),Gs=i("p"),r_=a("\u3053\u308C\u30672\u3064\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u304C\u63C3\u3044\u307E\u3057\u305F\u306E\u3067\u3001\u6B8B\u308A\u306E\u5FAE\u8ABF\u6574\u30B9\u30C6\u30C3\u30D7\u306F\u6A19\u6E96\u7684\u306A\u3082\u306E\u3067\u3059\u3002Google Colab\u3067\u3001\u795E\u8A71\u306B\u51FA\u3066\u304F\u308BP100 GPU\u3092\u904B\u826F\u304F\u5272\u308A\u5F53\u3066\u3089\u308C\u306A\u304B\u3063\u305F\u5834\u5408\u3001\u5B66\u7FD2\u306B\u6642\u9593\u304C\u304B\u304B\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u{1F62D}\u305D\u3053\u3067\u3001\u307E\u305A\u5B66\u7FD2\u30BB\u30C3\u30C8\u306E\u30B5\u30A4\u30BA\u3092\u6570\u5343\u4E8B\u4F8B\u307E\u3067\u30C0\u30A6\u30F3\u30B5\u30F3\u30D7\u30EB\u3057\u307E\u3059\u3002\u5FC3\u914D\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3001\u305D\u308C\u3067\u3082\u304B\u306A\u308A\u307E\u3068\u3082\u306A\u8A00\u8A9E\u30E2\u30C7\u30EB\u304C\u3067\u304D\u307E\u3059\u3088\u3002\u{1F917} Datasets \u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F"),_l=i("a"),n_=a("\u7B2C5\u7AE0"),o_=a("\u3067\u7D39\u4ECB\u3057\u305F "),Mr=i("code"),i_=a("Dataset.train_test_split()"),p_=a(" \u95A2\u6570\u3067\u7C21\u5358\u306B\u30C0\u30A6\u30F3\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Xn=m(),v($a.$$.fragment),Zn=m(),v(wa.$$.fragment),eo=m(),Us=i("p"),__=a("\u3053\u308C\u306F\u81EA\u52D5\u7684\u306B\u65B0\u3057\u3044 "),Tr=i("code"),c_=a("train"),f_=a(" \u3068 "),zr=i("code"),m_=a("test"),d_=a(" \u306B\u30C7\u30FC\u30BF\u3092\u5206\u5272\u3057\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u306E\u30B5\u30A4\u30BA\u3092 10,000 \u4E8B\u4F8B\u306B\u3001\u691C\u8A3C\u30BB\u30C3\u30C8\u3092\u305D\u306E 10%\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F\u3002\u3082\u3057\u5F37\u529B\u306AGPU\u3092\u304A\u6301\u3061\u306A\u3089\u3001\u3053\u306E\u5024\u3092\u81EA\u7531\u306B\u5897\u3084\u3057\u3066\u304F\u3060\u3055\u3044\uFF01"),so=m(),cl=i("p"),u_=a("\u6B21\u306B\u5FC5\u8981\u306A\u3053\u3068\u306F\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6\u306B\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u3053\u306E\u30B3\u30FC\u30C9\u3092notebook\u3067\u5B9F\u884C\u3059\u308B\u5834\u5408\u306F\u3001\u6B21\u306E\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u95A2\u6570\u3067\u5B9F\u884C\u3067\u304D\u307E\u3059\u3002"),to=m(),v(ja.$$.fragment),ao=m(),fl=i("p"),h_=a("\u4E0A\u8A18\u3092\u5B9F\u884C\u3059\u308B\u3068\u3001\u5165\u529B\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u304C\u8868\u793A\u3055\u308C\u3001\u8A8D\u8A3C\u60C5\u5831\u3092\u5165\u529B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u307E\u305F\u5B9F\u884C\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002"),lo=m(),v(va.$$.fragment),ro=m(),ml=i("p"),g_=a("\u597D\u307F\u306B\u5FDC\u3058\u3066\u3001\u30BF\u30FC\u30DF\u30CA\u30EB\u3092\u8D77\u52D5\u3057\u3001\u305D\u3053\u304B\u3089\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),no=m(),Ms.c(),dl=m(),Ea=i("h3"),b_=a("\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"),oo=m(),v(ya.$$.fragment),io=m(),ul=i("p"),k_=a("\u30C6\u30AD\u30B9\u30C8\u306E\u5206\u985E\u3084\u8CEA\u554F\u5FDC\u7B54\u306E\u3088\u3046\u306B\u3001\u30E9\u30D9\u30EB\u4ED8\u3051\u3055\u308C\u305F\u30B3\u30FC\u30D1\u30B9\u3092\u7528\u3044\u3066\u5B66\u7FD2\u3059\u308B\u4ED6\u306E\u30BF\u30B9\u30AF\u3068\u306F\u7570\u306A\u308A\u3001\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u306F\u660E\u793A\u7684\u306A\u30E9\u30D9\u30EB\u3092\u4E00\u5207\u6301\u3061\u307E\u305B\u3093\u3002\u3067\u306F\u3001\u4F55\u304C\u826F\u3044\u8A00\u8A9E\u30E2\u30C7\u30EB\u306A\u306E\u304B\u3001\u3069\u306E\u3088\u3046\u306B\u5224\u65AD\u3059\u308C\u3070\u3088\u3044\u306E\u3067\u3057\u3087\u3046\u304B\uFF1F"),po=m(),hl=i("p"),$_=a("\u643A\u5E2F\u96FB\u8A71\u306E\u81EA\u52D5\u88DC\u6B63\u6A5F\u80FD\u306E\u3088\u3046\u306B\u3001\u6587\u6CD5\u7684\u306B\u6B63\u3057\u3044\u6587\u306B\u306F\u9AD8\u3044\u78BA\u7387\u3067\u3001\u7121\u610F\u5473\u306A\u6587\u306B\u306F\u4F4E\u3044\u78BA\u7387\u3067\u5272\u308A\u5F53\u3066\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u3082\u306E\u304C\u826F\u3044\u8A00\u8A9E\u30E2\u30C7\u30EB\u3067\u3059\u3002\u81EA\u52D5\u88DC\u6B63\u306E\u5931\u6557\u4F8B\u3068\u3057\u3066\u3001\u643A\u5E2F\u96FB\u8A71\u306B\u642D\u8F09\u3055\u308C\u305F\u81EA\u52D5\u88DC\u6B63\u30E2\u30C7\u30EB\u304C\u3001\u304A\u304B\u3057\u306A\uFF08\u305D\u3057\u3066\u5F80\u3005\u306B\u3057\u3066\u4E0D\u9069\u5207\u306A\uFF09\u6587\u7AE0\u3092\u751F\u6210\u3057\u3066\u3044\u308B\u4F8B\u304C\u30CD\u30C3\u30C8\u4E0A\u306B\u591A\u6570\u7D39\u4ECB\u3055\u308C\u3066\u3044\u307E\u3059\u3002"),_o=m(),zs.c(),gl=m(),v(xa.$$.fragment),co=m(),bl=i("p"),w_=a(`\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u30B9\u30B3\u30A2\u304C\u4F4E\u3044\u307B\u3069\u3001\u826F\u3044\u8A00\u8A9E\u30E2\u30C7\u30EB\u3068\u3044\u3046\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002
\u79C1\u9054\u306E\u958B\u59CB\u6642\u306E\u30E2\u30C7\u30EB\u306E\u5024\u306F\u3084\u3084\u5927\u304D\u3044\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002
\u3067\u306F\u3001\u5FAE\u8ABF\u6574\u306B\u3088\u3063\u3066\u3053\u306E\u5024\u3092\u4E0B\u3052\u3089\u308C\u308B\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u305D\u306E\u305F\u3081\u306B\u3001\u307E\u305A\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u5B9F\u884C\u3057\u307E\u3059\u3002`),fo=m(),Ps.c(),kl=m(),$l=i("p"),j_=a("\u305D\u308C\u304B\u3089\u8A08\u7B97\u3092\u5B9F\u884C\u3057\u3001\u305D\u306E\u7D50\u679C\u5F97\u3089\u308C\u305F\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306B\u5BFE\u3059\u308B\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u5148\u307B\u3069\u3068\u540C\u69D8\u306B\u8A08\u7B97\u3057\u307E\u3059\u3002"),mo=m(),Ss.c(),wl=m(),v(Da.$$.fragment),uo=m(),jl=i("p"),v_=a(`\u7D20\u6575\uFF01\u304B\u306A\u308A\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u6E1B\u3089\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u3057\u305F\u3002
\u3053\u308C\u306F\u3001\u30E2\u30C7\u30EB\u304C\u6620\u753B\u30EC\u30D3\u30E5\u30FC\u306E\u9818\u57DF\u306B\u3064\u3044\u3066\u4F55\u304B\u3092\u5B66\u3093\u3060\u3053\u3068\u3092\u793A\u3057\u3066\u3044\u307E\u3059\u3002`),ho=m(),Ce&&Ce.c(),vl=m(),v(xt.$$.fragment),go=m(),Se&&Se.c(),El=m(),qa=i("h2"),E_=a("\u5FAE\u8ABF\u6574\u3057\u305F\u30E2\u30C7\u30EB\u3092\u4F7F\u3046"),bo=m(),Ws=i("p"),y_=a("\u5FAE\u8ABF\u6574\u3057\u305F\u30E2\u30C7\u30EB\u306F\u3001Hub\u4E0A\u306E\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u3092\u4F7F\u3046\u304B\u3001\u{1F917} Transformers\u306E "),Ar=i("code"),x_=a("pipeline"),D_=a(" \u3092\u4F7F\u3063\u3066\u30ED\u30FC\u30AB\u30EB\u74B0\u5883\u3067\u64CD\u4F5C\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u305D\u308C\u3067\u306F\u5F8C\u8005\u306B\u6311\u6226\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Pr=i("code"),q_=a("fill-mask"),M_=a("\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u3092\u4F7F\u7528\u3057\u3066\u30E2\u30C7\u30EB\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002"),ko=m(),v(Ma.$$.fragment),$o=m(),yl=i("p"),T_=a("\u305D\u3057\u3066\u300C\u3053\u308C\u306F\u7D20\u6674\u3089\u3057\u3044[MASK]\u3067\u3059\u300D\u3068\u3044\u3046\u30B5\u30F3\u30D7\u30EB\u30C6\u30AD\u30B9\u30C8\u3092\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u306B\u9001\u308A\u3001\u4E0A\u4F4D5\u3064\u306E\u4E88\u6E2C\u3092\u78BA\u8A8D\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),wo=m(),v(Ta.$$.fragment),jo=m(),v(za.$$.fragment),vo=m(),xl=i("p"),z_=a(`\u3059\u3063\u304D\u308A\u3057\u307E\u3057\u305F\u3002
\u3053\u306E\u30E2\u30C7\u30EB\u306F\u3001\u6620\u753B\u3068\u95A2\u9023\u3059\u308B\u5358\u8A9E\u3092\u3088\u308A\u5F37\u304F\u4E88\u6E2C\u3059\u308B\u3088\u3046\u306B\u3001\u660E\u3089\u304B\u306B\u91CD\u307F\u3092\u9069\u5FDC\u3055\u305B\u3066\u3044\u307E\u3059\u306D\uFF01`),Eo=m(),v(Aa.$$.fragment),yo=m(),Dt=i("p"),A_=a("\u3053\u308C\u3067\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u5B66\u7FD2\u3059\u308B\u305F\u3081\u306E\u6700\u521D\u306E\u5B9F\u9A13\u3092\u7D42\u3048\u307E\u3057\u305F\u3002"),Dl=i("a"),P_=a("\u30BB\u30AF\u30B7\u30E7\u30F36"),C_=a("\u3067\u306F\u3001GPT-2\u306E\u3088\u3046\u306A\u81EA\u5DF1\u56DE\u5E30\u30E2\u30C7\u30EB\u3092\u30BC\u30ED\u304B\u3089\u5B66\u7FD2\u3059\u308B\u65B9\u6CD5\u3092\u5B66\u3073\u307E\u3059\u3002\u3082\u3057\u3001\u3042\u306A\u305F\u81EA\u8EAB\u306ETransformer\u30E2\u30C7\u30EB\u3092\u3069\u3046\u3084\u3063\u3066\u4E8B\u524D\u5B66\u7FD2\u3059\u308B\u304B\u898B\u305F\u3044\u306A\u3089\u3001\u305D\u3061\u3089\u306B\u5411\u304B\u3063\u3066\u304F\u3060\u3055\u3044"),xo=m(),v(qt.$$.fragment),this.h()},l(e){const r=Nf('[data-svelte="svelte-1phssyn"]',document.head);o=p(r,"META",{name:!0,content:!0}),r.forEach(s),h=d(e),E(c.$$.fragment,e),w=d(e),D=p(e,"H1",{id:!0});var Cr=_(D);$=l(Cr,"\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574"),Cr.forEach(s),k=d(e),u.l(e),T=d(e),C=p(e,"P",{});var ql=_(C);R=l(ql,"Transformer\u30E2\u30C7\u30EB\u3092\u542B\u3080\u591A\u304F\u306ENLP\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3067\u306F\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6\u304B\u3089\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u306E\u30E2\u30C7\u30EB\u3092\u53D6\u308A\u51FA\u3057\u3001\u81EA\u5206\u304C\u5B9F\u884C\u3057\u305F\u3044\u30BF\u30B9\u30AF\u7528\u306E\u30C7\u30FC\u30BF\u3092\u76F4\u63A5\u4F7F\u3063\u3066\u5FAE\u8ABF\u6574\u3092\u884C\u3046\u3060\u3051\u3067\u3088\u3044\u306E\u3067\u3059\u3002\u4E8B\u524D\u5B66\u7FD2\u306B\u4F7F\u308F\u308C\u305F\u30B3\u30FC\u30D1\u30B9\u3068\u5FAE\u8ABF\u6574\u306B\u4F7F\u3046\u30B3\u30FC\u30D1\u30B9\u304C\u3042\u307E\u308A\u9055\u308F\u306A\u3044\u9650\u308A\u3001\u8EE2\u79FB\u5B66\u7FD2\u306F\u901A\u5E38\u826F\u3044\u7D50\u679C\u3092\u751F\u307F\u51FA\u3057\u307E\u3059\u3002"),ql.forEach(s),L=d(e),N=p(e,"P",{});var Sr=_(N);F=l(Sr,"\u3057\u304B\u3057\u3001\u30E2\u30C7\u30EB\u306E\u30D8\u30C3\u30C9\u90E8\u3060\u3051\u3092\u5BFE\u8C61\u306B\u30BF\u30B9\u30AF\u306B\u7279\u5316\u3057\u305F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u884C\u3046\u524D\u306B\u3001\u307E\u305A\u30C7\u30FC\u30BF\u3092\u4F7F\u3063\u3066\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u5FAE\u8ABF\u6574\u3057\u305F\u3044\u30B1\u30FC\u30B9\u3082\u3044\u304F\u3064\u304B\u3042\u308A\u307E\u3059\u3002\u4F8B\u3048\u3070\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u6CD5\u7684\u5951\u7D04\u3084\u79D1\u5B66\u8AD6\u6587\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5834\u5408\u3001BERT\u306E\u3088\u3046\u306A\u7D20\u306ETransformer\u30E2\u30C7\u30EB\u306F\u901A\u5E38\u3001\u30B3\u30FC\u30D1\u30B9\u5185\u306E\u30C9\u30E1\u30A4\u30F3\u7279\u6709\u306E\u5358\u8A9E\u3092\u7A00\u306A\u30C8\u30FC\u30AF\u30F3\u3068\u3057\u3066\u6271\u3046\u305F\u3081\u3001\u7D50\u679C\u3068\u3057\u3066\u6E80\u8DB3\u306E\u3044\u304F\u6027\u80FD\u304C\u5F97\u3089\u308C\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30C9\u30E1\u30A4\u30F3\u5185\u30C7\u30FC\u30BF\u3067\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u5FAE\u8ABF\u6574\u3059\u308B\u3053\u3068\u3067\u3001\u591A\u304F\u306E\u4E0B\u6D41\u30BF\u30B9\u30AF\u306E\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u3092\u5411\u4E0A\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u3001\u3053\u306E\u30B9\u30C6\u30C3\u30D7\u306F\u901A\u5E38\u4E00\u5EA6\u3060\u3051\u884C\u3048\u3070\u3088\u3044\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002"),Sr.forEach(s),B=d(e),H=p(e,"P",{});var Ys=_(H);W=l(Ys,"\u3053\u306E\u3088\u3046\u306B\u3001\u4E8B\u524D\u306B\u5B66\u7FD2\u3057\u305F\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u30C9\u30E1\u30A4\u30F3\u5185\u30C7\u30FC\u30BF\u3067\u5FAE\u8ABF\u6574\u3059\u308B\u30D7\u30ED\u30BB\u30B9\u306F\u3001\u901A\u5E38"),j=p(Ys,"EM",{});var Ml=_(j);P=l(Ml,"\u30C9\u30E1\u30A4\u30F3\u9069\u5FDC"),Ml.forEach(s),se=l(Ys,"\u3068\u547C\u3070\u308C\u307E\u3059\u3002\u3053\u308C\u306F2018\u5E74\u306B"),G=p(Ys,"A",{href:!0,rel:!0});var Or=_(G);Z=l(Or,"ULMFiT"),Or.forEach(s),Y=l(Ys,"\u306B\u3088\u3063\u3066\u666E\u53CA\u3057\u307E\u3057\u305F\u3002\u8EE2\u79FB\u5B66\u7FD2\u3092NLP\u3067\u672C\u5F53\u306B\u4F7F\u3048\u308B\u3088\u3046\u306B\u3057\u305F\u6700\u521D\u306E\u30CB\u30E5\u30FC\u30E9\u30EB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\uFF08LSTM\u304C\u30D9\u30FC\u30B9\uFF09\u306E1\u3064\u3067\u3059\u3002ULMFiT\u306B\u3088\u308B\u30C9\u30E1\u30A4\u30F3\u9069\u5FDC\u306E\u4F8B\u3092\u4E0B\u306E\u753B\u50CF\u306B\u793A\u3057\u307E\u3059\u3002\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3067\u306F\u3001LSTM\u306E\u4EE3\u308F\u308A\u306BTransformer\u3092\u4F7F\u3063\u3066\u3001\u540C\u69D8\u306E\u3053\u3068\u3092\u884C\u3044\u307E\u3059\uFF01"),Ys.forEach(s),he=d(e),X=p(e,"DIV",{class:!0});var Fa=_(X);ie=p(Fa,"IMG",{class:!0,src:!0,alt:!0}),je=d(Fa),U=p(Fa,"IMG",{class:!0,src:!0,alt:!0}),Fa.forEach(s),Q=d(e),le=p(e,"P",{});var Ha=_(le);ce=l(Ha,"\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u7D42\u308F\u308A\u306B\u306F\u3001\u4EE5\u4E0B\u306E\u3088\u3046\u306A\u6587\u7AE0\u3092\u81EA\u52D5\u88DC\u5B8C\u3067\u304D\u308B"),te=p(Ha,"A",{href:!0,rel:!0});var Kr=_(te);ge=l(Kr,"\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB"),Kr.forEach(s),Be=l(Ha,"\u304CHub\u4E0A\u306B\u3067\u304D\u3066\u3044\u308B\u3053\u3068\u3067\u3057\u3087\u3046\u3002"),Ha.forEach(s),Ie=d(e),re=p(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),_(re).forEach(s),Fe=d(e),fe=p(e,"P",{});var Tl=_(fe);Ke=l(Tl,"\u305D\u308C\u3067\u306F\u59CB\u3081\u307E\u3057\u3087\u3046\uFF01"),Tl.forEach(s),ke=d(e),E(De.$$.fragment,e),pe=d(e),E(ve.$$.fragment,e),$e=d(e),Ee=p(e,"H2",{id:!0});var Rr=_(Ee);_e=l(Rr,"\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u7528\u306E\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u9078\u629E"),Rr.forEach(s),Re=d(e),me=p(e,"P",{});var Mt=_(me);Ae=l(Mt,"\u307E\u305A\u3001\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u306B\u9069\u3057\u305F\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u3092\u9078\u3073\u307E\u3057\u3087\u3046\u3002\u4EE5\u4E0B\u306E\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u306E\u3088\u3046\u306B\u3001"),ye=p(Mt,"A",{href:!0,rel:!0});var zl=_(ye);S=l(zl,"\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6"),zl.forEach(s),ee=l(Mt,"\u306E \u201CFill-Mask \u201C\u30D5\u30A3\u30EB\u30BF\u3092\u9069\u7528\u3059\u308B\u3068\u3001\u5019\u88DC\u306E\u30EA\u30B9\u30C8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002"),Mt.forEach(s),He=d(e),ae=p(e,"DIV",{class:!0});var Al=_(ae);we=p(Al,"IMG",{src:!0,alt:!0,width:!0}),Al.forEach(s),ne=d(e),qe=p(e,"P",{});var Tt=_(qe);J=l(Tt,"BERT \u3068 RoBERTa \u30E2\u30C7\u30EB\u306E\u30D5\u30A1\u30DF\u30EA\u30FC\u304C\u6700\u3082\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u3053\u3053\u3067\u306F "),Le=p(Tt,"A",{href:!0,rel:!0});var Lr=_(Le);Ge=l(Lr,"DistilBERT"),Lr.forEach(s),Ne=l(Tt," \u3068\u547C\u3070\u308C\u308B\u30E2\u30C7\u30EB\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002\u3053\u306E\u30E2\u30C7\u30EB\u306F\u3001\u4E0B\u6D41\u30BF\u30B9\u30AF\u306E\u6027\u80FD\u3092\u307B\u3068\u3093\u3069\u640D\u306A\u3046\u3053\u3068\u306A\u304F\u3001\u3088\u308A\u9AD8\u901F\u306B\u5B66\u7FD2\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Tt.forEach(s),Je=d(e),Me=p(e,"P",{});var Na=_(Me);Pe=l(Na,"\u3053\u306E\u30E2\u30C7\u30EB\u306F\u3001"),z=p(Na,"A",{href:!0,rel:!0});var Q_=_(z);V=p(Q_,"EM",{});var X_=_(V);_s=l(X_,"\u77E5\u8B58\u84B8\u7559"),X_.forEach(s),Q_.forEach(s),de=l(Na,"\u3068\u547C\u3070\u308C\u308B\u7279\u5225\u306A\u6280\u8853\u3092\u4F7F\u7528\u3057\u3066\u8A13\u7DF4\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u306E\u624B\u6CD5\u306F\u3001BERT\u306E\u3088\u3046\u306A\u5927\u304D\u306A\u300C\u6559\u5E2B\u30E2\u30C7\u30EB\u300D\u304C\u3001\u305D\u308C\u3088\u308A\u306F\u308B\u304B\u306B\u5C11\u306A\u3044\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064\u300C\u751F\u5F92\u30E2\u30C7\u30EB\u300D\u306E\u8A13\u7DF4\u3092\u5C0E\u304F\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u3002"),Na.forEach(s),Qe=d(e),Ue=p(e,"P",{});var qo=_(Ue);cs=l(qo,"\u77E5\u8B58\u84B8\u6E9C\u306E\u8A73\u7D30\u3092\u8AAC\u660E\u3059\u308B\u3068\u3001\u3053\u306E\u7AE0\u306E\u5185\u5BB9\u304B\u3089\u96E2\u308C\u3059\u304E\u3066\u3057\u307E\u3044\u307E\u3059\u304C\u3001\u3082\u3057\u8208\u5473\u304C\u3042\u308C\u3070\u3001"),ns=p(qo,"A",{href:!0,rel:!0});var Z_=_(ns);fs=p(Z_,"EM",{});var ec=_(fs);os=l(ec,"Natural Language Processing with Transformers"),ec.forEach(s),Z_.forEach(s),xe=l(qo," \uFF08\u901A\u79F0Transformers\u6559\u79D1\u66F8\uFF09\u3067\u305D\u308C\u306B\u3064\u3044\u3066\u3059\u3079\u3066\u8AAD\u3080\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),qo.forEach(s),Xe=d(e),ue.l(e),ms=d(e),Ze=p(e,"P",{});var sc=_(Ze);Ks=l(sc,"\u7D046,700\u4E07\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064DistilBERT\u306F\u3001BERT\u306E\u57FA\u672C\u30E2\u30C7\u30EB\u3088\u308A\u3082\u7D042\u500D\u5C0F\u3055\u304F\u3001\u3053\u308C\u306F\u3001\u5B66\u7FD2\u6642\u306B\u7D042\u500D\u306E\u30B9\u30D4\u30FC\u30C9\u30A2\u30C3\u30D7\u306B\u76F8\u5F53\u3057\u307E\u3059\uFF08\u7D20\u6674\u3089\u3057\u3044\uFF01\uFF09\u3002\u305D\u308C\u3067\u306F\u3001\u3053\u306E\u30E2\u30C7\u30EB\u304C\u4E88\u6E2C\u3059\u308B\u3001\u5C0F\u3055\u306A\u30C6\u30AD\u30B9\u30C8\u30B5\u30F3\u30D7\u30EB\u306E\u6700\u3082\u53EF\u80FD\u6027\u306E\u9AD8\u3044\u5B8C\u6210\u5F62\u306F\u3069\u306E\u3088\u3046\u306A\u7A2E\u985E\u306E\u30C8\u30FC\u30AF\u30F3\u3067\u3042\u308B\u304B\u3092\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),sc.forEach(s),es=d(e),E(ss.$$.fragment,e),ts=d(e),oe=p(e,"P",{});var Vs=_(oe);ds=l(Vs,"\u4EBA\u9593\u306A\u3089 "),hs=p(Vs,"CODE",{});var tc=_(hs);at=l(tc,"[MASK]"),tc.forEach(s),Es=l(Vs," \u30C8\u30FC\u30AF\u30F3\u306B\u5BFE\u3057\u3066\u3001\u201Cday\u201D, \u201Cride\u201D, \u201Cpainting\u201D \u306A\u3069\u306E\u591A\u304F\u306E\u53EF\u80FD\u6027\u3092\u60F3\u50CF\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u5834\u5408\u3001\u4E88\u6E2C\u5024\u306F\u30E2\u30C7\u30EB\u304C\u5B66\u7FD2\u3057\u305F\u30B3\u30FC\u30D1\u30B9\u306B\u4F9D\u5B58\u3057\u307E\u3059\u3002\u306A\u305C\u306A\u3089\u3001\u30E2\u30C7\u30EB\u306F\u30C7\u30FC\u30BF\u306B\u5B58\u5728\u3059\u308B\u7D71\u8A08\u7684\u30D1\u30BF\u30FC\u30F3\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u306B\u5B66\u7FD2\u3059\u308B\u304B\u3089\u3067\u3059\u3002BERT\u3068\u540C\u69D8\u306B\u3001DistilBERT\u306F"),gs=p(Vs,"A",{href:!0,rel:!0});var ac=_(gs);ys=l(ac,"English Wikipedia"),ac.forEach(s),lt=l(Vs," \u3068 "),is=p(Vs,"A",{href:!0,rel:!0});var lc=_(is);St=l(lc,"BookCorpus"),lc.forEach(s),rt=l(Vs," \u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3067\u4E8B\u524D\u5B66\u7FD2\u3055\u308C\u3066\u3044\u308B\u306E\u3067\u3001"),f=p(Vs,"CODE",{});var rc=_(f);O=l(rc,"[MASK]"),rc.forEach(s),nt=l(Vs,"\u306E\u4E88\u6E2C\u306F\u3053\u308C\u3089\u306E\u30C9\u30E1\u30A4\u30F3\u3092\u53CD\u6620\u3059\u308B\u3068\u4E88\u60F3\u3055\u308C\u307E\u3059\u3002\u30DE\u30B9\u30AF\u3092\u4E88\u6E2C\u3059\u308B\u305F\u3081\u306B\u306F\u3001\u30E2\u30C7\u30EB\u306E\u5165\u529B\u751F\u6210\u7528\u306BDistilBERT\u306Etokenizer\u304C\u5FC5\u8981\u306A\u306E\u3067\u3001\u3053\u308C\u3082Hub\u304B\u3089\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u307E\u3057\u3087\u3046\u3002"),Vs.forEach(s),Ot=d(e),E(Rs.$$.fragment,e),Kt=d(e),bs=p(e,"P",{});var nc=_(bs);Ia=l(nc,"tokenizer\u30E2\u30C7\u30EB\u304C\u3042\u308C\u3070\u3001\u30C6\u30AD\u30B9\u30C8\u30B5\u30F3\u30D7\u30EB\u3092\u30E2\u30C7\u30EB\u306B\u6E21\u3057\u3001\u30ED\u30B8\u30C3\u30C8\u3092\u62BD\u51FA\u3057\u3001\u4E0A\u4F4D5\u3064\u306E\u5019\u88DC\u3092\u51FA\u529B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),nc.forEach(s),Rt=d(e),ps.l(e),Xs=d(e),E(Ls.$$.fragment,e),Zs=d(e),et=p(e,"P",{});var oc=_(et);ot=l(oc,"\u51FA\u529B\u304B\u3089\u3001\u30E2\u30C7\u30EB\u306E\u4E88\u6E2C\u306F\u65E5\u5E38\u7684\u306A\u7528\u8A9E\u306B\u8A00\u53CA\u3057\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u304C\u3001\u3053\u308C\u306F\u82F1\u8A9E\u7248\u30A6\u30A3\u30AD\u30DA\u30C7\u30A3\u30A2\u304C\u57FA\u76E4\u3068\u306A\u3063\u3066\u3044\u308B\u4E8B\u3092\u8003\u3048\u308C\u3070\u9A5A\u304F\u3053\u3068\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u3067\u306F\u3001\u3053\u306E\u9818\u57DF\u3092\u3082\u3046\u5C11\u3057\u30CB\u30C3\u30C1\u306A\u3082\u306E\u3001\u3064\u307E\u308A\u3001\u5206\u88C2\u3057\u3066\u3044\u308B\u6620\u753B\u8A55\u4FA1\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u5909\u3048\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),oc.forEach(s),Lt=d(e),Bs=p(e,"H2",{id:!0});var ic=_(Bs);it=l(ic,"\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8"),ic.forEach(s),Bt=d(e),as=p(e,"P",{});var Pl=_(as);Ga=l(Pl,"\u30C9\u30E1\u30A4\u30F3\u9069\u5FDC\u306E\u4F8B\u3092\u793A\u3059\u305F\u3081\u306B\u3001\u79C1\u305F\u3061\u306F\u6709\u540D\u306A"),Fs=p(Pl,"A",{href:!0,rel:!0});var pc=_(Fs);Ua=l(pc,"Large Movie Review Dataset"),pc.forEach(s),pt=l(Pl," (\u7565\u3057\u3066IMDb)\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u3053\u308C\u306F\u3001\u611F\u60C5\u5206\u6790\u30E2\u30C7\u30EB\u306E\u30D9\u30F3\u30C1\u30DE\u30FC\u30AF\u306B\u3088\u304F\u4F7F\u308F\u308C\u308B\u3001\u6620\u753B\u306E\u30EC\u30D3\u30E5\u30FC\u306E\u30B3\u30FC\u30D1\u30B9\u3067\u3059\u3002\u3053\u306E\u30B3\u30FC\u30D1\u30B9\u3067DistilBERT\u3092\u5FAE\u8ABF\u6574\u3059\u308B\u3053\u3068\u3067\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u304C\u4E8B\u524D\u5B66\u7FD2\u3057\u305FWikipedia\u306E\u4E8B\u5B9F\u306B\u57FA\u3065\u304F\u30C7\u30FC\u30BF\u304B\u3089\u3001\u6620\u753B\u30EC\u30D3\u30E5\u30FC\u306E\u3088\u308A\u4E3B\u89B3\u7684\u306A\u8981\u7D20\u306B\u8A9E\u5F59\u3092\u9069\u5FDC\u3055\u305B\u308B\u3053\u3068\u304C\u671F\u5F85\u3055\u308C\u307E\u3059\u3002\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6\u306E\u30C7\u30FC\u30BF\u306F\u3001\u{1F917} Datasets\u306E "),_t=p(Pl,"CODE",{});var _c=_(_t);Wa=l(_c,"load_dataset()"),_c.forEach(s),Ya=l(Pl," \u95A2\u6570\u3067\u53D6\u5F97\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Pl.forEach(s),Br=d(e),E(Ft.$$.fragment,e),Fr=d(e),E(Ht.$$.fragment,e),Hr=d(e),ls=p(e,"P",{});var Os=_(ls);Bl=p(Os,"CODE",{});var cc=_(Bl);Go=l(cc,"train"),cc.forEach(s),Uo=l(Os," \u3068 "),Fl=p(Os,"CODE",{});var fc=_(Fl);Wo=l(fc,"test"),fc.forEach(s),Yo=l(Os," \u7528\u306E\u30C7\u30FC\u30BF\u5206\u5272\u306B\u306F\u305D\u308C\u305E\u308C25,000\u4EF6\u306E\u30EC\u30D3\u30E5\u30FC\u304B\u3089\u69CB\u6210\u3055\u308C\u3001\u30E9\u30D9\u30EB\u4ED8\u3051\u3055\u308C\u3066\u3044\u306A\u3044 "),Hl=p(Os,"CODE",{});var mc=_(Hl);Vo=l(mc,"unsupervised"),mc.forEach(s),Jo=l(Os," \u3068\u3044\u3046\u5206\u5272\u306B\u306F50,000\u4EF6\u306E\u30EC\u30D3\u30E5\u30FC\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u3069\u306E\u3088\u3046\u306A\u30C6\u30AD\u30B9\u30C8\u3092\u6271\u3063\u3066\u3044\u308B\u304B\u77E5\u308B\u305F\u3081\u306B\u3001\u3044\u304F\u3064\u304B\u306E\u30B5\u30F3\u30D7\u30EB\u3092\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u3053\u306E\u30B3\u30FC\u30B9\u306E\u524D\u306E\u7AE0\u3067\u884C\u3063\u305F\u3088\u3046\u306B\u3001 "),Nl=p(Os,"CODE",{});var dc=_(Nl);Qo=l(dc,"Dataset.shuffle()"),dc.forEach(s),Xo=l(Os," \u3068 "),Il=p(Os,"CODE",{});var uc=_(Il);Zo=l(uc,"Dataset.select()"),uc.forEach(s),ei=l(Os," \u95A2\u6570\u3092\u9023\u9396\u3055\u305B\u3066\u3001\u30E9\u30F3\u30C0\u30E0\u306A\u30B5\u30F3\u30D7\u30EB\u3092\u4F5C\u6210\u3057\u307E\u3057\u3087\u3046\u3002"),Os.forEach(s),Nr=d(e),E(Nt.$$.fragment,e),Ir=d(e),E(It.$$.fragment,e),Gr=d(e),Hs=p(e,"P",{});var Cl=_(Hs);si=l(Cl,"\u305D\u3046\u3001\u3053\u308C\u3089\u306F\u78BA\u304B\u306B\u6620\u753B\u306E\u30EC\u30D3\u30E5\u30FC\u3067\u3059\u3002\u3082\u3057\u3042\u306A\u305F\u304C\u5341\u5206\u306B\u5E74\u3092\u53D6\u3063\u3066\u3044\u308B\u306A\u3089\u3001\u6700\u5F8C\u306E\u30EC\u30D3\u30E5\u30FC\u306B\u3042\u308BVHS\u7248\u3092\u6240\u6709\u3057\u3066\u3044\u308B\u3068\u3044\u3046\u30B3\u30E1\u30F3\u30C8\u3055\u3048\u7406\u89E3\u3067\u304D\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093\u{1F61C}! \u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u306B\u306F\u30E9\u30D9\u30EB\u306F\u5FC5\u8981\u3042\u308A\u307E\u305B\u3093\u304C\u3001"),Gl=p(Cl,"CODE",{});var hc=_(Gl);ti=l(hc,"0"),hc.forEach(s),ai=l(Cl,"\u306F\u5426\u5B9A\u7684\u306A\u30EC\u30D3\u30E5\u30FC\u3001"),Ul=p(Cl,"CODE",{});var gc=_(Ul);li=l(gc,"1"),gc.forEach(s),ri=l(Cl,"\u306F\u80AF\u5B9A\u7684\u306A\u30EC\u30D3\u30E5\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u3053\u3068\u304C\u3082\u3046\u308F\u304B\u308A\u307E\u3057\u305F\u3002"),Cl.forEach(s),Ur=d(e),E(ct.$$.fragment,e),Wr=d(e),ft=p(e,"P",{});var Mo=_(ft);ni=l(Mo,"\u3055\u3066\u3001\u30C7\u30FC\u30BF\u3092\u3056\u3063\u3068\u898B\u305F\u3068\u3053\u308D\u3067\u3001\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u306E\u305F\u3081\u306E\u6E96\u5099\u306B\u53D6\u308A\u304B\u304B\u308A\u307E\u3057\u3087\u3046\u3002"),Va=p(Mo,"A",{href:!0});var bc=_(Va);oi=l(bc,"\u7B2C3\u7AE0"),bc.forEach(s),ii=l(Mo,"\u3067\u898B\u305F\u30B7\u30FC\u30B1\u30F3\u30B9\u5206\u985E\u306E\u30BF\u30B9\u30AF\u3068\u6BD4\u8F03\u3059\u308B\u3068\u3001\u3044\u304F\u3064\u304B\u306E\u8FFD\u52A0\u30B9\u30C6\u30C3\u30D7\u304C\u5FC5\u8981\u3067\u3042\u308B\u3053\u3068\u304C\u308F\u304B\u308B\u3067\u3057\u3087\u3046\u3002\u3055\u3042\u3001\u59CB\u3081\u307E\u3057\u3087\u3046\uFF01"),Mo.forEach(s),Yr=d(e),Gt=p(e,"H2",{id:!0});var kc=_(Gt);pi=l(kc,"\u30C7\u30FC\u30BF\u306E\u524D\u51E6\u7406"),kc.forEach(s),Vr=d(e),E(Ut.$$.fragment,e),Jr=d(e),Ja=p(e,"P",{});var $c=_(Ja);_i=l($c,"\u81EA\u5DF1\u56DE\u5E30\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u3082\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u3082\u3001\u5171\u901A\u306E\u524D\u51E6\u7406\u3068\u3057\u3066\u3001\u3059\u3079\u3066\u306E\u7528\u4F8B\u3092\u9023\u7D50\u3057\u3001\u30B3\u30FC\u30D1\u30B9\u5168\u4F53\u3092\u540C\u3058\u5927\u304D\u3055\u306E\u65AD\u7247\u306B\u5206\u5272\u3059\u308B\u3053\u3068\u304C\u884C\u308F\u308C\u307E\u3059\u3002\u3053\u308C\u306F\u3001\u500B\u3005\u306E\u30B5\u30F3\u30D7\u30EB\u3092\u5358\u7D14\u306B\u30C8\u30FC\u30AF\u30F3\u5316\u3059\u308B\u3068\u3044\u3046\u3001\u79C1\u9054\u306E\u901A\u5E38\u306E\u30A2\u30D7\u30ED\u30FC\u30C1\u3068\u306F\u5168\u304F\u7570\u306A\u308B\u3082\u306E\u3067\u3059\u3002\u306A\u305C\u3059\u3079\u3066\u3092\u9023\u7D50\u3059\u308B\u306E\u3067\u3057\u3087\u3046\u304B\uFF1F\u305D\u308C\u306F\u3001\u500B\u3005\u306E\u4F8B\u6587\u304C\u9577\u3059\u304E\u308B\u3068\u5207\u308A\u6368\u3066\u3089\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u3001\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u30BF\u30B9\u30AF\u306B\u5F79\u7ACB\u3064\u304B\u3082\u3057\u308C\u306A\u3044\u60C5\u5831\u304C\u5931\u308F\u308C\u3066\u3057\u307E\u3046\u304B\u3089\u3067\u3059\uFF01"),$c.forEach(s),Qr=d(e),We=p(e,"P",{});var js=_(We);ci=l(js,"\u305D\u3053\u3067\u3001\u307E\u305A\u3044\u3064\u3082\u306E\u3088\u3046\u306B\u30B3\u30FC\u30D1\u30B9\u3092\u30C8\u30FC\u30AF\u30F3\u5316\u3057\u307E\u3059\u3002\u305F\u3060\u3057\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3059\u308B\u969B\u306B "),Wl=p(js,"CODE",{});var wc=_(Wl);fi=l(wc,"truncation=True"),wc.forEach(s),mi=l(js," \u30AA\u30D7\u30B7\u30E7\u30F3\u3092tokenizer\u306B"),Yl=p(js,"EM",{});var jc=_(Yl);di=l(jc,"\u8A2D\u5B9A\u3057\u306A\u3044"),jc.forEach(s),ui=l(js,"\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u307E\u305F\u3001\u5358\u8A9EID\u304C\u3042\u308C\u3070\u305D\u308C\u3092\u53D6\u5F97\u3057\u307E\u3059\uFF08"),Qa=p(js,"A",{href:!0});var vc=_(Qa);hi=l(vc,"6\u7AE0"),vc.forEach(s),gi=l(js,"\u3067\u8AAC\u660E\u3057\u305F\u9AD8\u901Ftokenizer\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u305D\u3046\u306A\u308A\u307E\u3059\uFF09\u3002\u5F8C\u3067\u5358\u8A9E\u5168\u4F53\u3092\u30DE\u30B9\u30AD\u30F3\u30B0\u3059\u308B\u305F\u3081\u306B\u5FC5\u8981\u306B\u306A\u308B\u304B\u3089\u3067\u3059\u3002\u3053\u308C\u3092\u30B7\u30F3\u30D7\u30EB\u306A\u95A2\u6570\u306B\u307E\u3068\u3081\u3001\u3064\u3044\u3067\u306B "),Vl=p(js,"CODE",{});var Ec=_(Vl);bi=l(Ec,"text"),Ec.forEach(s),ki=l(js," \u3068 "),Jl=p(js,"CODE",{});var yc=_(Jl);$i=l(yc,"label"),yc.forEach(s),wi=l(js," \u30AB\u30E9\u30E0\u3082\u4E0D\u8981\u306B\u306A\u3063\u305F\u306E\u3067\u524A\u9664\u3057\u3066\u3057\u307E\u3044\u307E\u3057\u3087\u3046\u3002"),js.forEach(s),Xr=d(e),E(Wt.$$.fragment,e),Zr=d(e),E(Yt.$$.fragment,e),en=d(e),ks=p(e,"P",{});var zt=_(ks);ji=l(zt,"DistilBERT\u306FBERT\u306B\u4F3C\u305F\u30E2\u30C7\u30EB\u306A\u306E\u3067\u3001\u30A8\u30F3\u30B3\u30FC\u30C9\u3055\u308C\u305F\u30C6\u30AD\u30B9\u30C8\u306F\u3001\u4ED6\u306E\u7AE0\u3067\u898B\u305F "),Ql=p(zt,"CODE",{});var xc=_(Ql);vi=l(xc,"input_ids"),xc.forEach(s),Ei=l(zt," \u3068 "),Xl=p(zt,"CODE",{});var Dc=_(Xl);yi=l(Dc,"attention_mask"),Dc.forEach(s),xi=l(zt," \u306B\u52A0\u3048\u3001\u79C1\u9054\u304C\u8FFD\u52A0\u3057\u305F "),Zl=p(zt,"CODE",{});var qc=_(Zl);Di=l(qc,"word_ids"),qc.forEach(s),qi=l(zt," \u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002"),zt.forEach(s),sn=d(e),mt=p(e,"P",{});var To=_(mt);Mi=l(To,"\u3055\u3066\u3001\u6620\u753B\u306E\u30EC\u30D3\u30E5\u30FC\u3092\u30C8\u30FC\u30AF\u30F3\u5316\u3057\u305F\u306E\u3067\u3001\u6B21\u306E\u30B9\u30C6\u30C3\u30D7\u306F\u305D\u308C\u3089\u3092\u3059\u3079\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3057\u3066\u3001\u7D50\u679C\u3092\u65AD\u7247\u306B\u5206\u5272\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u3057\u304B\u3057\u3001\u3053\u306E\u65AD\u7247\u306E\u5927\u304D\u3055\u306F\u3069\u306E\u7A0B\u5EA6\u306B\u3059\u3079\u304D\u3067\u3057\u3087\u3046\u304B\uFF1F\u3053\u308C\u306F\u6700\u7D42\u7684\u306B\u306F\u5229\u7528\u53EF\u80FD\u306A GPU \u30E1\u30E2\u30EA\u306E\u91CF\u306B\u3088\u3063\u3066\u6C7A\u307E\u308A\u307E\u3059\u304C\u3001\u826F\u3044\u51FA\u767A\u70B9\u306F\u30E2\u30C7\u30EB\u306E\u6700\u5927\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u304C\u4F55\u3067\u3042\u308B\u304B\u3092\u898B\u308B\u3053\u3068\u3067\u3059\u3002\u3053\u308C\u306Ftokenizer\u306E "),er=p(To,"CODE",{});var Mc=_(er);Ti=l(Mc,"model_max_length"),Mc.forEach(s),zi=l(To," \u5C5E\u6027\u3092\u8ABF\u3079\u308B\u3053\u3068\u3067\u63A8\u6E2C\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),To.forEach(s),tn=d(e),E(Vt.$$.fragment,e),an=d(e),E(Jt.$$.fragment,e),ln=d(e),dt=p(e,"P",{});var zo=_(dt);Ai=l(zo,"\u3053\u306E\u5024\u306F\u3001\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u305F "),sr=p(zo,"EM",{});var Tc=_(sr);Pi=l(Tc,"tokenizer_config.json"),Tc.forEach(s),Ci=l(zo," \u30D5\u30A1\u30A4\u30EB\u304B\u3089\u53D6\u5F97\u3057\u307E\u3059\u3002\u3053\u306E\u5834\u5408\u3001BERT \u3068\u540C\u69D8\u306B\u3001\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u304C 512 \u30C8\u30FC\u30AF\u30F3\u3067\u3042\u308B\u3053\u3068\u304C\u5206\u304B\u308A\u307E\u3059\u3002"),zo.forEach(s),rn=d(e),E(ut.$$.fragment,e),nn=d(e),Xa=p(e,"P",{});var zc=_(Xa);Si=l(zc,"\u3055\u308C\u3001Google Colab\u5185\u3067\u5229\u7528\u53EF\u80FD\u306AGPU\u3067\u5B9F\u9A13\u3092\u884C\u3046\u305F\u3081\u306B\u3001\u30E1\u30E2\u30EA\u306B\u53CE\u307E\u308B\u3088\u3046\u306A\u5C11\u3057\u5C0F\u3055\u3081\u306E\u3082\u306E\u3092\u9078\u3076\u3053\u3068\u306B\u3057\u307E\u3059\u3002"),zc.forEach(s),on=d(e),E(Qt.$$.fragment,e),pn=d(e),E(ht.$$.fragment,e),_n=d(e),Za=p(e,"P",{});var Ac=_(Za);Oi=l(Ac,"\u3055\u3066\u3001\u3053\u3053\u304B\u3089\u304C\u697D\u3057\u3044\u3068\u3053\u308D\u3067\u3059\u3002\u9023\u7D50\u304C\u3069\u306E\u3088\u3046\u306B\u6A5F\u80FD\u3059\u308B\u304B\u3092\u793A\u3059\u305F\u3081\u306B\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3055\u308C\u305F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u304B\u3089\u3044\u304F\u3064\u304B\u306E\u30EC\u30D3\u30E5\u30FC\u3092\u53D6\u308A\u51FA\u3057\u3001\u30EC\u30D3\u30E5\u30FC\u6BCE\u306E\u30C8\u30FC\u30AF\u30F3\u6570\u3092\u51FA\u529B\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Ac.forEach(s),cn=d(e),E(Xt.$$.fragment,e),fn=d(e),E(Zt.$$.fragment,e),mn=d(e),el=p(e,"P",{});var Pc=_(el);Ki=l(Pc,"\u305D\u3057\u3066\u3001\u3053\u308C\u3089\u306E\u4F8B\u3092\u3059\u3079\u3066\u3092\u30B7\u30F3\u30D7\u30EB\u306A\u8F9E\u66F8\u5185\u5305\u8868\u8A18\u3092\u4F7F\u3063\u3066\u9023\u7D50\u3059\u308B\u3068\u3001\u6B21\u306E\u3088\u3046\u306B\u306A\u308A\u307E\u3059\u3002"),Pc.forEach(s),dn=d(e),E(ea.$$.fragment,e),un=d(e),E(sa.$$.fragment,e),hn=d(e),sl=p(e,"P",{});var Cc=_(sl);Ri=l(Cc,"\u7D20\u6674\u3089\u3057\u3044\uFF01\u5168\u4F53\u306E\u9577\u3055\u306E\u88CF\u4ED8\u3051\u304C\u3068\u308C\u307E\u3057\u305F\u3002"),Cc.forEach(s),gn=d(e),Ns=p(e,"P",{});var Sl=_(Ns);Li=l(Sl,"\u3067\u306F\u3001\u9023\u7D50\u3055\u308C\u305F\u30EC\u30D3\u30E5\u30FC\u3092 "),tr=p(Sl,"CODE",{});var Sc=_(tr);Bi=l(Sc,"block_size"),Sc.forEach(s),Fi=l(Sl," \u3067\u6307\u5B9A\u3055\u308C\u305F\u30B5\u30A4\u30BA\u306E\u65AD\u7247\u306B\u5206\u5272\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u305D\u306E\u305F\u3081\u306B\u3001 "),ar=p(Sl,"CODE",{});var Oc=_(ar);Hi=l(Oc,"concatenated_examples"),Oc.forEach(s),Ni=l(Sl," \u3092\u7E70\u308A\u8FD4\u3057\u51E6\u7406\u3057\u3001\u30EA\u30B9\u30C8\u5185\u5305\u8868\u8A18\u3092\u4F7F\u7528\u3057\u3066\u5404\u7279\u5FB4\u306E\u30B9\u30E9\u30A4\u30B9\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\u305D\u306E\u7D50\u679C\u3001\u65AD\u7247\u306E\u8F9E\u66F8\u304C\u3067\u304D\u3042\u304C\u308A\u307E\u3059\u3002"),Sl.forEach(s),bn=d(e),E(ta.$$.fragment,e),kn=d(e),E(aa.$$.fragment,e),$n=d(e),tl=p(e,"P",{});var Kc=_(tl);Ii=l(Kc,"\u3053\u306E\u4F8B\u3067\u308F\u304B\u308B\u3088\u3046\u306B\u3001\u4E00\u822C\u7684\u306B\u6700\u5F8C\u306E\u65AD\u7247\u306F\u6700\u5927\u65AD\u7247\u30B5\u30A4\u30BA\u3088\u308A\u5C0F\u3055\u304F\u306A\u308A\u307E\u3059\u3002\u3053\u308C\u3092\u6271\u3046\u306B\u306F\u3001\u4E3B\u306B 2 \u3064\u306E\u65B9\u6CD5\u304C\u3042\u308A\u307E\u3059\u3002"),Kc.forEach(s),wn=d(e),gt=p(e,"UL",{});var Ao=_(gt);la=p(Ao,"LI",{});var Po=_(la);Gi=l(Po,"\u6700\u5F8C\u306E\u65AD\u7247\u304C "),lr=p(Po,"CODE",{});var Rc=_(lr);Ui=l(Rc,"chunk_size"),Rc.forEach(s),Wi=l(Po," \u3088\u308A\u3082\u5C0F\u3055\u3051\u308C\u3070\u524A\u9664\u3059\u308B"),Po.forEach(s),Yi=d(Ao),ra=p(Ao,"LI",{});var Co=_(ra);Vi=l(Co,"\u6700\u5F8C\u306E\u65AD\u7247\u306E\u9577\u3055\u304C "),rr=p(Co,"CODE",{});var Lc=_(rr);Ji=l(Lc,"chunk_size"),Lc.forEach(s),Qi=l(Co," \u3068\u7B49\u3057\u304F\u306A\u308B\u307E\u3067\u3001\u6700\u5F8C\u306E\u65AD\u7247\u306B\u30C0\u30DF\u30FC\u30C7\u30FC\u30BF\u3092\u8A70\u3081\u8FBC\u3080"),Co.forEach(s),Ao.forEach(s),jn=d(e),al=p(e,"P",{});var Bc=_(al);Xi=l(Bc,"\u3053\u3053\u3067\u306F\u3001\u6700\u521D\u306E\u30A2\u30D7\u30ED\u30FC\u30C1\u3092\u3068\u308A\u307E\u3059\u3002\u4E0A\u8A18\u306E\u30ED\u30B8\u30C3\u30AF\u3092\u3059\u3079\u3066\u3072\u3068\u3064\u306E\u95A2\u6570\u306B\u307E\u3068\u3081\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u9069\u7528\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Bc.forEach(s),vn=d(e),E(na.$$.fragment,e),En=d(e),us=p(e,"P",{});var tt=_(us);nr=p(tt,"CODE",{});var Fc=_(nr);Zi=l(Fc,"group_texts()"),Fc.forEach(s),ep=l(tt," \u306E\u6700\u5F8C\u306E\u30B9\u30C6\u30C3\u30D7\u3067\u306F\u3001 "),or=p(tt,"CODE",{});var Hc=_(or);sp=l(Hc,"input_ids"),Hc.forEach(s),tp=l(tt," \u5217\u306E\u30B3\u30D4\u30FC\u3067\u3042\u308B\u65B0\u3057\u3044 "),ir=p(tt,"CODE",{});var Nc=_(ir);ap=l(Nc,"labels"),Nc.forEach(s),lp=l(tt," \u5217\u3092\u4F5C\u6210\u3057\u3066\u3044\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u3053\u308C\u304B\u3089\u8AAC\u660E\u3059\u308B\u3088\u3046\u306B\u3001\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u306F\u3001\u5165\u529B\u90E8\u306B\u542B\u307E\u308C\u308B\u30E9\u30F3\u30C0\u30E0\u306A\u30DE\u30B9\u30AF\u30C8\u30FC\u30AF\u30F3\u3092\u4E88\u6E2C\u3059\u308B\u3053\u3068\u304C\u76EE\u7684\u3067\u3059\u3002 "),pr=p(tt,"CODE",{});var Ic=_(pr);rp=l(Ic,"labels"),Ic.forEach(s),np=l(tt," \u5217\u306F\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u304C\u5B66\u7FD2\u306E\u969B\u306B\u53C2\u8003\u3059\u308B\u771F\u5B9F\u306E\u5024\u3092\u63D0\u4F9B\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002"),tt.forEach(s),yn=d(e),Is=p(e,"P",{});var Ol=_(Is);op=l(Ol,"\u305D\u308C\u3067\u306F\u3001\u4FE1\u983C\u3067\u304D\u308B "),_r=p(Ol,"CODE",{});var Gc=_(_r);ip=l(Gc,"Dataset.map()"),Gc.forEach(s),pp=l(Ol," \u95A2\u6570\u3092\u4F7F\u3063\u3066\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B "),cr=p(Ol,"CODE",{});var Uc=_(cr);_p=l(Uc,"group_texts()"),Uc.forEach(s),cp=l(Ol," \u3092\u9069\u7528\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Ol.forEach(s),xn=d(e),E(oa.$$.fragment,e),Dn=d(e),E(ia.$$.fragment,e),qn=d(e),Ye=p(e,"P",{});var vs=_(Ye);fp=l(vs,"\u30C6\u30AD\u30B9\u30C8\u3092\u30B0\u30EB\u30FC\u30D7\u5316\u3057\u3001\u65AD\u7247\u306B\u5206\u3051\u305F\u3053\u3068\u3067"),fr=p(vs,"CODE",{});var Wc=_(fr);mp=l(Wc,"train"),Wc.forEach(s),dp=l(vs,"\u3068"),mr=p(vs,"CODE",{});var Yc=_(mr);up=l(Yc,"test"),Yc.forEach(s),hp=l(vs,"\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306725,000\u3088\u308A\u3082\u591A\u304F\u306E\u30B5\u30F3\u30D7\u30EB\u304C\u751F\u6210\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u3053\u308C\u306F\u3001\u5143\u306E\u30B3\u30FC\u30D1\u30B9\u306B\u8907\u6570\u306E\u30EC\u30D3\u30E5\u30FC\u3092\u542B\u3080\u3082\u306E\u304C\u3042\u308B\u305F\u3081 "),dr=p(vs,"EM",{});var Vc=_(dr);gp=l(Vc,"\u9023\u7D9A\u30C8\u30FC\u30AF\u30F3"),Vc.forEach(s),bp=l(vs," \u3092\u542B\u3080\u30B5\u30F3\u30D7\u30EB\u304C\u3067\u304D\u305F\u304B\u3089\u3067\u3059\u3002\u3053\u306E\u3053\u3068\u306F\u3001\u65AD\u7247\u306E1\u3064\u306B\u3042\u308B\u7279\u5225\u306A "),ur=p(vs,"CODE",{});var Jc=_(ur);kp=l(Jc,"[SEP]"),Jc.forEach(s),$p=l(vs," \u3068 "),hr=p(vs,"CODE",{});var Qc=_(hr);wp=l(Qc,"[CLS]"),Qc.forEach(s),jp=l(vs," \u30C8\u30FC\u30AF\u30F3\u3092\u63A2\u3059\u3053\u3068\u3067\u660E\u78BA\u306B\u308F\u304B\u308A\u307E\u3059\u3002"),vs.forEach(s),Mn=d(e),E(pa.$$.fragment,e),Tn=d(e),E(_a.$$.fragment,e),zn=d(e),ll=p(e,"P",{});var Xc=_(ll);vp=l(Xc,"\u4E0A\u306E\u4F8B\u3067\u306F\u3001\u9AD8\u6821\u306B\u95A2\u3059\u308B\u6620\u753B\u3068\u30DB\u30FC\u30E0\u30EC\u30B9\u306B\u95A2\u3059\u308B\u6620\u753B\u306E\u30EC\u30D3\u30E5\u30FC\u304C2\u3064\u91CD\u8907\u3057\u3066\u3044\u308B\u306E\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u307E\u305F\u3001\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u306E\u30E9\u30D9\u30EB\u304C\u3069\u306E\u3088\u3046\u306B\u898B\u3048\u308B\u304B\u78BA\u8A8D\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Xc.forEach(s),An=d(e),E(ca.$$.fragment,e),Pn=d(e),E(fa.$$.fragment,e),Cn=d(e),$s=p(e,"P",{});var At=_($s);Ep=l(At,"\u4E0A\u306E "),gr=p(At,"CODE",{});var Zc=_(gr);yp=l(Zc,"group_texts()"),Zc.forEach(s),xp=l(At," \u95A2\u6570\u304B\u3089\u4E88\u60F3\u3055\u308C\u308B\u3088\u3046\u306B\u3001\u3053\u308C\u306F\u30C7\u30B3\u30FC\u30C9\u3055\u308C\u305F "),br=p(At,"CODE",{});var ef=_(br);Dp=l(ef,"input_ids"),ef.forEach(s),qp=l(At," \u3068\u540C\u3058\u306B\u898B\u3048\u307E\u3059\u3002\u3057\u304B\u3057\u3001\u305D\u308C\u3067\u306F\u3053\u306E\u30E2\u30C7\u30EB\u306F\u3069\u3046\u3084\u3063\u3066\u4F55\u304B\u3092\u5B66\u7FD2\u3059\u308B\u306E\u3067\u3057\u3087\u3046\u304B\uFF1F\u5165\u529B\u306E\u30E9\u30F3\u30C0\u30E0\u306A\u4F4D\u7F6E\u306B "),kr=p(At,"CODE",{});var sf=_(kr);Mp=l(sf,"[MASK]"),sf.forEach(s),Tp=l(At," \u30C8\u30FC\u30AF\u30F3\u3092\u633F\u5165\u3059\u308B\u3001\u3068\u3044\u3046\u91CD\u8981\u306A\u30B9\u30C6\u30C3\u30D7\u304C\u629C\u3051\u3066\u3044\u308B\u306E\u3067\u3059\u3002\u305D\u308C\u3067\u306F\u3001\u7279\u5225\u306A\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u4F7F\u3063\u3066\u3001\u5FAE\u8ABF\u6574\u306E\u969B\u306B\u3069\u306E\u3088\u3046\u306B\u3053\u308C\u3092\u884C\u3046\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),At.forEach(s),Sn=d(e),st=p(e,"H2",{class:!0});var So=_(st);bt=p(So,"A",{id:!0,class:!0,href:!0});var tf=_(bt);$r=p(tf,"SPAN",{});var af=_($r);E(ma.$$.fragment,af),af.forEach(s),tf.forEach(s),zp=d(So),da=p(So,"SPAN",{});var Oo=_(da);Ap=l(Oo,"DistilBERT\u3092"),wr=p(Oo,"CODE",{});var lf=_(wr);Pp=l(lf,"Trainer"),lf.forEach(s),Cp=l(Oo,"API\u3067\u5FAE\u8ABF\u6574\u3059\u308B"),Oo.forEach(s),So.forEach(s),On=d(e),ws=p(e,"P",{});var Pt=_(ws);Sp=l(Pt,"\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574\u306F\u3001"),rl=p(Pt,"A",{href:!0});var rf=_(rl);Op=l(rf,"\u7B2C3\u7AE0"),rf.forEach(s),Kp=l(Pt,"\u3067\u884C\u3063\u305F\u3088\u3046\u306A\u30B7\u30FC\u30B1\u30F3\u30B9\u5206\u985E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574\u3068\u307B\u307C\u540C\u3058\u3067\u3059\u3002\u552F\u4E00\u306E\u9055\u3044\u306F\u3001\u5404\u30D0\u30C3\u30C1\u306E\u30C6\u30AD\u30B9\u30C8\u306B\u542B\u307E\u308C\u308B\u3044\u304F\u3064\u304B\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u30E9\u30F3\u30C0\u30E0\u306B\u30DE\u30B9\u30AF\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u7279\u5225\u306A\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u304C\u5FC5\u8981\u3067\u3042\u308B\u3053\u3068\u3067\u3059\u3002\u5E78\u3044\u306A\u3053\u3068\u306B\u3001\u{1F917} Transformers\u306B\u306F\u3053\u306E\u30BF\u30B9\u30AF\u306E\u305F\u3081\u306B\u5C02\u7528\u306E "),jr=p(Pt,"CODE",{});var nf=_(jr);Rp=l(nf,"DataCollatorForLanguageModeling"),nf.forEach(s),Lp=l(Pt," \u304C\u7528\u610F\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u79C1\u305F\u3061\u306Ftokenizer\u3068\u3001\u30DE\u30B9\u30AF\u3059\u308B\u30C8\u30FC\u30AF\u30F3\u306E\u5272\u5408\u3092\u6307\u5B9A\u3059\u308B "),vr=p(Pt,"CODE",{});var of=_(vr);Bp=l(of,"mlm_probability"),of.forEach(s),Fp=l(Pt," \u5F15\u6570\u3092\u6E21\u3059\u3060\u3051\u3067\u3088\u3044\u306E\u3067\u3059\u3002\u3053\u3053\u3067\u306F\u3001BERT\u3067\u4F7F\u7528\u3055\u308C\u3001\u6587\u732E\u4E0A\u3067\u3082\u4E00\u822C\u7684\u306A\u9078\u629E\u3067\u3042\u308B15\uFF05\u3092\u9078\u3073\u307E\u3059\u3002"),Pt.forEach(s),Kn=d(e),E(ua.$$.fragment,e),Rn=d(e),kt=p(e,"P",{});var Ko=_(kt);Hp=l(Ko,"\u30E9\u30F3\u30C0\u30E0\u30DE\u30B9\u30AF\u304C\u3069\u306E\u3088\u3046\u306B\u6A5F\u80FD\u3059\u308B\u304B\u3092\u898B\u308B\u305F\u3081\u306B\u3001\u3044\u304F\u3064\u304B\u306E\u4F8B\u3092 data_collator \u306B\u4E0E\u3048\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u30B3\u30EC\u30FC\u30BF\u30FC\u306F\u8F9E\u66F8\u578B \u306E\u30EA\u30B9\u30C8\u3092\u60F3\u5B9A\u3057\u3066\u304A\u308A\u3001\u5404 \u8F9E\u66F8\u306F\u9023\u7D9A\u3057\u305F\u30C6\u30AD\u30B9\u30C8\u306E\u584A\u3092\u8868\u3059\u306E\u3067\u3001\u307E\u305A\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u7E70\u308A\u8FD4\u3057\u51E6\u7406\u3057\u3066\u304B\u3089\u30B3\u30EC\u30FC\u30BF\u30FC\u306B\u30D0\u30C3\u30C1\u3092\u6E21\u3057\u307E\u3059\u3002\u3053\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u306F "),Er=p(Ko,"CODE",{});var pf=_(Er);Np=l(pf,'"word_ids"'),pf.forEach(s),Ip=l(Ko," \u30AD\u30FC\u3092\u5FC5\u8981\u3068\u3057\u306A\u3044\u306E\u3067\u3001\u3053\u308C\u3092\u524A\u9664\u3057\u307E\u3059\u3002"),Ko.forEach(s),Ln=d(e),E(ha.$$.fragment,e),Bn=d(e),E(ga.$$.fragment,e),Fn=d(e),$t=p(e,"P",{});var Ro=_($t);Gp=l(Ro,`\u3044\u3044\u3067\u3059\u306D\u3001\u3046\u307E\u304F\u3044\u304D\u307E\u3057\u305F\uFF01
`),yr=p(Ro,"CODE",{});var _f=_(yr);Up=l(_f,"[MASK]"),_f.forEach(s),Wp=l(Ro,"\u30C8\u30FC\u30AF\u30F3\u304C\u30C6\u30AD\u30B9\u30C8\u306E\u69D8\u3005\u306A\u5834\u6240\u306B\u30E9\u30F3\u30C0\u30E0\u306B\u633F\u5165\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002"),Ro.forEach(s),Hn=d(e),wt=p(e,"P",{});var Lo=_(wt);Yp=l(Lo,"\u3053\u308C\u3089\u304C\u5B66\u7FD2\u4E2D\u306B\u30E2\u30C7\u30EB\u304C\u4E88\u6E2C\u3057\u306A\u3051\u308C\u3070\u306A\u3089\u306A\u3044\u30C8\u30FC\u30AF\u30F3\u306B\u306A\u308A\u307E\u3059\u3002\u305D\u3057\u3066\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u306E\u7D20\u6674\u3089\u3057\u3044\u3068\u3053\u308D\u306F\u3001\u30D0\u30C3\u30C1\u3054\u3068\u306B"),xr=p(Lo,"CODE",{});var cf=_(xr);Vp=l(cf,"[MASK]"),cf.forEach(s),Jp=l(Lo,"\u306E\u633F\u5165\u3092\u30E9\u30F3\u30C0\u30E0\u306B\u3059\u308B\u3053\u3068\u3067\u3059!"),Lo.forEach(s),Nn=d(e),E(jt.$$.fragment,e),In=d(e),rs&&rs.l(e),nl=d(e),vt=p(e,"P",{});var Bo=_(vt);Qp=l(Bo,"\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3059\u308B\u5834\u5408\u3001\u500B\u3005\u306E\u30C8\u30FC\u30AF\u30F3\u3067\u306F\u306A\u304F\u3001\u5358\u8A9E\u5168\u4F53\u3092\u30DE\u30B9\u30AD\u30F3\u30B0\u3059\u308B\u624B\u6CD5\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u624B\u6CD5\u306F "),Dr=p(Bo,"EM",{});var ff=_(Dr);Xp=l(ff,"whole word masking"),ff.forEach(s),Zp=l(Bo," \u3068\u547C\u3070\u308C\u307E\u3059\u3002\u5358\u8A9E\u5168\u4F53\u3092\u30DE\u30B9\u30AD\u30F3\u30B0\u3059\u308B\u5834\u5408\u3001\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u81EA\u4F5C\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3068\u306F\u3001\u30B5\u30F3\u30D7\u30EB\u306E\u30EA\u30B9\u30C8\u3092\u53D7\u3051\u53D6\u308A\u3001\u305D\u308C\u3092\u30D0\u30C3\u30C1\u5909\u63DB\u3059\u308B\u95A2\u6570\u306E\u3053\u3068\u3067\u3059\u3002"),Bo.forEach(s),Gn=d(e),ol=p(e,"P",{});var mf=_(ol);e_=l(mf,"\u4ECA\u304B\u3089\u3084\u3063\u3066\u307F\u307E\u3057\u3087\u3046\uFF01"),mf.forEach(s),Un=d(e),Et=p(e,"P",{});var Fo=_(Et);s_=l(Fo,"\u5148\u307B\u3069\u8A08\u7B97\u3057\u305F\u5358\u8A9EID\u3092\u4F7F\u3063\u3066\u3001\u5358\u8A9E\u306E\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3068\u5BFE\u5FDC\u3059\u308B\u30C8\u30FC\u30AF\u30F3\u306E\u30DE\u30C3\u30D7\u3092\u4F5C\u308B\u4E8B\u306B\u3057\u307E\u3059\u3002\u3069\u306E\u5358\u8A9E\u3092\u30DE\u30B9\u30AF\u3059\u308B\u304B\u3092\u30E9\u30F3\u30C0\u30E0\u306B\u6C7A\u3081\u3066\u3001\u305D\u306E\u30DE\u30B9\u30AF\u3092\u5165\u529B\u306B\u9069\u7528\u3057\u307E\u3059\u3002\u306A\u304A\u3001\u30E9\u30D9\u30EB\u306F\u30DE\u30B9\u30AF\u3059\u308B\u5358\u8A9E\u3092\u9664\u3044\u3066\u5168\u3066"),qr=p(Fo,"CODE",{});var df=_(qr);t_=l(df,"-100"),df.forEach(s),a_=l(Fo,"\u3067\u3059\u3002"),Fo.forEach(s),Wn=d(e),Ds.l(e),il=d(e),pl=p(e,"P",{});var uf=_(pl);l_=l(uf,"\u6B21\u306B\u3001\u5148\u307B\u3069\u3068\u540C\u3058\u30B5\u30F3\u30D7\u30EB\u3067\u8A66\u3057\u3066\u307F\u307E\u3059\u3002"),uf.forEach(s),Yn=d(e),E(ba.$$.fragment,e),Vn=d(e),E(ka.$$.fragment,e),Jn=d(e),E(yt.$$.fragment,e),Qn=d(e),Gs=p(e,"P",{});var Kl=_(Gs);r_=l(Kl,"\u3053\u308C\u30672\u3064\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u304C\u63C3\u3044\u307E\u3057\u305F\u306E\u3067\u3001\u6B8B\u308A\u306E\u5FAE\u8ABF\u6574\u30B9\u30C6\u30C3\u30D7\u306F\u6A19\u6E96\u7684\u306A\u3082\u306E\u3067\u3059\u3002Google Colab\u3067\u3001\u795E\u8A71\u306B\u51FA\u3066\u304F\u308BP100 GPU\u3092\u904B\u826F\u304F\u5272\u308A\u5F53\u3066\u3089\u308C\u306A\u304B\u3063\u305F\u5834\u5408\u3001\u5B66\u7FD2\u306B\u6642\u9593\u304C\u304B\u304B\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u{1F62D}\u305D\u3053\u3067\u3001\u307E\u305A\u5B66\u7FD2\u30BB\u30C3\u30C8\u306E\u30B5\u30A4\u30BA\u3092\u6570\u5343\u4E8B\u4F8B\u307E\u3067\u30C0\u30A6\u30F3\u30B5\u30F3\u30D7\u30EB\u3057\u307E\u3059\u3002\u5FC3\u914D\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3001\u305D\u308C\u3067\u3082\u304B\u306A\u308A\u307E\u3068\u3082\u306A\u8A00\u8A9E\u30E2\u30C7\u30EB\u304C\u3067\u304D\u307E\u3059\u3088\u3002\u{1F917} Datasets \u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F"),_l=p(Kl,"A",{href:!0});var hf=_(_l);n_=l(hf,"\u7B2C5\u7AE0"),hf.forEach(s),o_=l(Kl,"\u3067\u7D39\u4ECB\u3057\u305F "),Mr=p(Kl,"CODE",{});var gf=_(Mr);i_=l(gf,"Dataset.train_test_split()"),gf.forEach(s),p_=l(Kl," \u95A2\u6570\u3067\u7C21\u5358\u306B\u30C0\u30A6\u30F3\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Kl.forEach(s),Xn=d(e),E($a.$$.fragment,e),Zn=d(e),E(wa.$$.fragment,e),eo=d(e),Us=p(e,"P",{});var Rl=_(Us);__=l(Rl,"\u3053\u308C\u306F\u81EA\u52D5\u7684\u306B\u65B0\u3057\u3044 "),Tr=p(Rl,"CODE",{});var bf=_(Tr);c_=l(bf,"train"),bf.forEach(s),f_=l(Rl," \u3068 "),zr=p(Rl,"CODE",{});var kf=_(zr);m_=l(kf,"test"),kf.forEach(s),d_=l(Rl," \u306B\u30C7\u30FC\u30BF\u3092\u5206\u5272\u3057\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u306E\u30B5\u30A4\u30BA\u3092 10,000 \u4E8B\u4F8B\u306B\u3001\u691C\u8A3C\u30BB\u30C3\u30C8\u3092\u305D\u306E 10%\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F\u3002\u3082\u3057\u5F37\u529B\u306AGPU\u3092\u304A\u6301\u3061\u306A\u3089\u3001\u3053\u306E\u5024\u3092\u81EA\u7531\u306B\u5897\u3084\u3057\u3066\u304F\u3060\u3055\u3044\uFF01"),Rl.forEach(s),so=d(e),cl=p(e,"P",{});var $f=_(cl);u_=l($f,"\u6B21\u306B\u5FC5\u8981\u306A\u3053\u3068\u306F\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6\u306B\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u3053\u306E\u30B3\u30FC\u30C9\u3092notebook\u3067\u5B9F\u884C\u3059\u308B\u5834\u5408\u306F\u3001\u6B21\u306E\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u95A2\u6570\u3067\u5B9F\u884C\u3067\u304D\u307E\u3059\u3002"),$f.forEach(s),to=d(e),E(ja.$$.fragment,e),ao=d(e),fl=p(e,"P",{});var wf=_(fl);h_=l(wf,"\u4E0A\u8A18\u3092\u5B9F\u884C\u3059\u308B\u3068\u3001\u5165\u529B\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u304C\u8868\u793A\u3055\u308C\u3001\u8A8D\u8A3C\u60C5\u5831\u3092\u5165\u529B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u307E\u305F\u5B9F\u884C\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002"),wf.forEach(s),lo=d(e),E(va.$$.fragment,e),ro=d(e),ml=p(e,"P",{});var jf=_(ml);g_=l(jf,"\u597D\u307F\u306B\u5FDC\u3058\u3066\u3001\u30BF\u30FC\u30DF\u30CA\u30EB\u3092\u8D77\u52D5\u3057\u3001\u305D\u3053\u304B\u3089\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),jf.forEach(s),no=d(e),Ms.l(e),dl=d(e),Ea=p(e,"H3",{id:!0});var vf=_(Ea);b_=l(vf,"\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"),vf.forEach(s),oo=d(e),E(ya.$$.fragment,e),io=d(e),ul=p(e,"P",{});var Ef=_(ul);k_=l(Ef,"\u30C6\u30AD\u30B9\u30C8\u306E\u5206\u985E\u3084\u8CEA\u554F\u5FDC\u7B54\u306E\u3088\u3046\u306B\u3001\u30E9\u30D9\u30EB\u4ED8\u3051\u3055\u308C\u305F\u30B3\u30FC\u30D1\u30B9\u3092\u7528\u3044\u3066\u5B66\u7FD2\u3059\u308B\u4ED6\u306E\u30BF\u30B9\u30AF\u3068\u306F\u7570\u306A\u308A\u3001\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u306F\u660E\u793A\u7684\u306A\u30E9\u30D9\u30EB\u3092\u4E00\u5207\u6301\u3061\u307E\u305B\u3093\u3002\u3067\u306F\u3001\u4F55\u304C\u826F\u3044\u8A00\u8A9E\u30E2\u30C7\u30EB\u306A\u306E\u304B\u3001\u3069\u306E\u3088\u3046\u306B\u5224\u65AD\u3059\u308C\u3070\u3088\u3044\u306E\u3067\u3057\u3087\u3046\u304B\uFF1F"),Ef.forEach(s),po=d(e),hl=p(e,"P",{});var yf=_(hl);$_=l(yf,"\u643A\u5E2F\u96FB\u8A71\u306E\u81EA\u52D5\u88DC\u6B63\u6A5F\u80FD\u306E\u3088\u3046\u306B\u3001\u6587\u6CD5\u7684\u306B\u6B63\u3057\u3044\u6587\u306B\u306F\u9AD8\u3044\u78BA\u7387\u3067\u3001\u7121\u610F\u5473\u306A\u6587\u306B\u306F\u4F4E\u3044\u78BA\u7387\u3067\u5272\u308A\u5F53\u3066\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u3082\u306E\u304C\u826F\u3044\u8A00\u8A9E\u30E2\u30C7\u30EB\u3067\u3059\u3002\u81EA\u52D5\u88DC\u6B63\u306E\u5931\u6557\u4F8B\u3068\u3057\u3066\u3001\u643A\u5E2F\u96FB\u8A71\u306B\u642D\u8F09\u3055\u308C\u305F\u81EA\u52D5\u88DC\u6B63\u30E2\u30C7\u30EB\u304C\u3001\u304A\u304B\u3057\u306A\uFF08\u305D\u3057\u3066\u5F80\u3005\u306B\u3057\u3066\u4E0D\u9069\u5207\u306A\uFF09\u6587\u7AE0\u3092\u751F\u6210\u3057\u3066\u3044\u308B\u4F8B\u304C\u30CD\u30C3\u30C8\u4E0A\u306B\u591A\u6570\u7D39\u4ECB\u3055\u308C\u3066\u3044\u307E\u3059\u3002"),yf.forEach(s),_o=d(e),zs.l(e),gl=d(e),E(xa.$$.fragment,e),co=d(e),bl=p(e,"P",{});var xf=_(bl);w_=l(xf,`\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u30B9\u30B3\u30A2\u304C\u4F4E\u3044\u307B\u3069\u3001\u826F\u3044\u8A00\u8A9E\u30E2\u30C7\u30EB\u3068\u3044\u3046\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002
\u79C1\u9054\u306E\u958B\u59CB\u6642\u306E\u30E2\u30C7\u30EB\u306E\u5024\u306F\u3084\u3084\u5927\u304D\u3044\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002
\u3067\u306F\u3001\u5FAE\u8ABF\u6574\u306B\u3088\u3063\u3066\u3053\u306E\u5024\u3092\u4E0B\u3052\u3089\u308C\u308B\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u305D\u306E\u305F\u3081\u306B\u3001\u307E\u305A\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u5B9F\u884C\u3057\u307E\u3059\u3002`),xf.forEach(s),fo=d(e),Ps.l(e),kl=d(e),$l=p(e,"P",{});var Df=_($l);j_=l(Df,"\u305D\u308C\u304B\u3089\u8A08\u7B97\u3092\u5B9F\u884C\u3057\u3001\u305D\u306E\u7D50\u679C\u5F97\u3089\u308C\u305F\u30C6\u30B9\u30C8\u30BB\u30C3\u30C8\u306B\u5BFE\u3059\u308B\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u5148\u307B\u3069\u3068\u540C\u69D8\u306B\u8A08\u7B97\u3057\u307E\u3059\u3002"),Df.forEach(s),mo=d(e),Ss.l(e),wl=d(e),E(Da.$$.fragment,e),uo=d(e),jl=p(e,"P",{});var qf=_(jl);v_=l(qf,`\u7D20\u6575\uFF01\u304B\u306A\u308A\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u3092\u6E1B\u3089\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u3057\u305F\u3002
\u3053\u308C\u306F\u3001\u30E2\u30C7\u30EB\u304C\u6620\u753B\u30EC\u30D3\u30E5\u30FC\u306E\u9818\u57DF\u306B\u3064\u3044\u3066\u4F55\u304B\u3092\u5B66\u3093\u3060\u3053\u3068\u3092\u793A\u3057\u3066\u3044\u307E\u3059\u3002`),qf.forEach(s),ho=d(e),Ce&&Ce.l(e),vl=d(e),E(xt.$$.fragment,e),go=d(e),Se&&Se.l(e),El=d(e),qa=p(e,"H2",{id:!0});var Mf=_(qa);E_=l(Mf,"\u5FAE\u8ABF\u6574\u3057\u305F\u30E2\u30C7\u30EB\u3092\u4F7F\u3046"),Mf.forEach(s),bo=d(e),Ws=p(e,"P",{});var Ll=_(Ws);y_=l(Ll,"\u5FAE\u8ABF\u6574\u3057\u305F\u30E2\u30C7\u30EB\u306F\u3001Hub\u4E0A\u306E\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u3092\u4F7F\u3046\u304B\u3001\u{1F917} Transformers\u306E "),Ar=p(Ll,"CODE",{});var Tf=_(Ar);x_=l(Tf,"pipeline"),Tf.forEach(s),D_=l(Ll," \u3092\u4F7F\u3063\u3066\u30ED\u30FC\u30AB\u30EB\u74B0\u5883\u3067\u64CD\u4F5C\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u305D\u308C\u3067\u306F\u5F8C\u8005\u306B\u6311\u6226\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Pr=p(Ll,"CODE",{});var zf=_(Pr);q_=l(zf,"fill-mask"),zf.forEach(s),M_=l(Ll,"\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u3092\u4F7F\u7528\u3057\u3066\u30E2\u30C7\u30EB\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002"),Ll.forEach(s),ko=d(e),E(Ma.$$.fragment,e),$o=d(e),yl=p(e,"P",{});var Af=_(yl);T_=l(Af,"\u305D\u3057\u3066\u300C\u3053\u308C\u306F\u7D20\u6674\u3089\u3057\u3044[MASK]\u3067\u3059\u300D\u3068\u3044\u3046\u30B5\u30F3\u30D7\u30EB\u30C6\u30AD\u30B9\u30C8\u3092\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u306B\u9001\u308A\u3001\u4E0A\u4F4D5\u3064\u306E\u4E88\u6E2C\u3092\u78BA\u8A8D\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Af.forEach(s),wo=d(e),E(Ta.$$.fragment,e),jo=d(e),E(za.$$.fragment,e),vo=d(e),xl=p(e,"P",{});var Pf=_(xl);z_=l(Pf,`\u3059\u3063\u304D\u308A\u3057\u307E\u3057\u305F\u3002
\u3053\u306E\u30E2\u30C7\u30EB\u306F\u3001\u6620\u753B\u3068\u95A2\u9023\u3059\u308B\u5358\u8A9E\u3092\u3088\u308A\u5F37\u304F\u4E88\u6E2C\u3059\u308B\u3088\u3046\u306B\u3001\u660E\u3089\u304B\u306B\u91CD\u307F\u3092\u9069\u5FDC\u3055\u305B\u3066\u3044\u307E\u3059\u306D\uFF01`),Pf.forEach(s),Eo=d(e),E(Aa.$$.fragment,e),yo=d(e),Dt=p(e,"P",{});var Ho=_(Dt);A_=l(Ho,"\u3053\u308C\u3067\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u5B66\u7FD2\u3059\u308B\u305F\u3081\u306E\u6700\u521D\u306E\u5B9F\u9A13\u3092\u7D42\u3048\u307E\u3057\u305F\u3002"),Dl=p(Ho,"A",{href:!0});var Cf=_(Dl);P_=l(Cf,"\u30BB\u30AF\u30B7\u30E7\u30F36"),Cf.forEach(s),C_=l(Ho,"\u3067\u306F\u3001GPT-2\u306E\u3088\u3046\u306A\u81EA\u5DF1\u56DE\u5E30\u30E2\u30C7\u30EB\u3092\u30BC\u30ED\u304B\u3089\u5B66\u7FD2\u3059\u308B\u65B9\u6CD5\u3092\u5B66\u3073\u307E\u3059\u3002\u3082\u3057\u3001\u3042\u306A\u305F\u81EA\u8EAB\u306ETransformer\u30E2\u30C7\u30EB\u3092\u3069\u3046\u3084\u3063\u3066\u4E8B\u524D\u5B66\u7FD2\u3059\u308B\u304B\u898B\u305F\u3044\u306A\u3089\u3001\u305D\u3061\u3089\u306B\u5411\u304B\u3063\u3066\u304F\u3060\u3055\u3044"),Ho.forEach(s),xo=d(e),E(qt.$$.fragment,e),this.h()},h(){A(o,"name","hf:doc:metadata"),A(o,"content",JSON.stringify(gm)),A(D,"id",""),A(G,"href","https://arxiv.org/abs/1801.06146"),A(G,"rel","nofollow"),A(ie,"class","block dark:hidden"),No(ie.src,I="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter7/ulmfit.svg")||A(ie,"src",I),A(ie,"alt","ULMFiT."),A(U,"class","hidden dark:block"),No(U.src,Oe="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter7/ulmfit-dark.svg")||A(U,"src",Oe),A(U,"alt","ULMFiT."),A(X,"class","flex justify-center"),A(te,"href","https://huggingface.co/huggingface-course/distilbert-base-uncased-finetuned-imdb?text=This+is+a+great+%5BMASK%5D."),A(te,"rel","nofollow"),No(re.src,be="https://hf.space/gradioiframe/course-demos/distilbert-base-uncased-finetuned-imdb/+")||A(re,"src",be),A(re,"frameborder","0"),A(re,"height","300"),A(re,"title","Gradio app"),A(re,"class","block dark:hidden container p-0 flex-grow space-iframe"),A(re,"allow","accelerometer; ambient-light-sensor; autoplay; battery; camera; document-domain; encrypted-media; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; vr ; wake-lock; xr-spatial-tracking"),A(re,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),A(Ee,"id",""),A(ye,"href","https://huggingface.co/models?pipeline_tag=fill-mask&sort=downloads"),A(ye,"rel","nofollow"),No(we.src,Ve="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter7/mlm-models.png")||A(we,"src",Ve),A(we,"alt","Hub models."),A(we,"width","80%"),A(ae,"class","flex justify-center"),A(Le,"href","https://huggingface.co/distilbert-base-uncased"),A(Le,"rel","nofollow"),A(z,"href","https://en.wikipedia.org/wiki/Knowledge_distillation"),A(z,"rel","nofollow"),A(ns,"href","https://learning.oreilly.com/library/view/natural-language-processing/9781098103231/ch05.html"),A(ns,"rel","nofollow"),A(gs,"href","https://huggingface.co/datasets/wikipedia"),A(gs,"rel","nofollow"),A(is,"href","https://huggingface.co/datasets/bookcorpus"),A(is,"rel","nofollow"),A(Bs,"id",""),A(Fs,"href","https://huggingface.co/datasets/imdb"),A(Fs,"rel","nofollow"),A(Va,"href","/course/ja/chapter3"),A(Gt,"id",""),A(Qa,"href","/course/ja/chapter6/3"),A(bt,"id","distilberttrainerapi"),A(bt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),A(bt,"href","#distilberttrainerapi"),A(st,"class","relative group"),A(rl,"href","/course/ja/chapter3"),A(_l,"href","/course/ja/chapter5"),A(Ea,"id",""),A(qa,"id",""),A(Dl,"href","/course/ja/chapter7/section6")},m(e,r){t(document.head,o),n(e,h,r),y(c,e,r),n(e,w,r),n(e,D,r),t(D,$),n(e,k,r),Pa[q].m(e,r),n(e,T,r),n(e,C,r),t(C,R),n(e,L,r),n(e,N,r),t(N,F),n(e,B,r),n(e,H,r),t(H,W),t(H,j),t(j,P),t(H,se),t(H,G),t(G,Z),t(H,Y),n(e,he,r),n(e,X,r),t(X,ie),t(X,je),t(X,U),n(e,Q,r),n(e,le,r),t(le,ce),t(le,te),t(te,ge),t(le,Be),n(e,Ie,r),n(e,re,r),n(e,Fe,r),n(e,fe,r),t(fe,Ke),n(e,ke,r),y(De,e,r),n(e,pe,r),y(ve,e,r),n(e,$e,r),n(e,Ee,r),t(Ee,_e),n(e,Re,r),n(e,me,r),t(me,Ae),t(me,ye),t(ye,S),t(me,ee),n(e,He,r),n(e,ae,r),t(ae,we),n(e,ne,r),n(e,qe,r),t(qe,J),t(qe,Le),t(Le,Ge),t(qe,Ne),n(e,Je,r),n(e,Me,r),t(Me,Pe),t(Me,z),t(z,V),t(V,_s),t(Me,de),n(e,Qe,r),n(e,Ue,r),t(Ue,cs),t(Ue,ns),t(ns,fs),t(fs,os),t(Ue,xe),n(e,Xe,r),Ca[Te].m(e,r),n(e,ms,r),n(e,Ze,r),t(Ze,Ks),n(e,es,r),y(ss,e,r),n(e,ts,r),n(e,oe,r),t(oe,ds),t(oe,hs),t(hs,at),t(oe,Es),t(oe,gs),t(gs,ys),t(oe,lt),t(oe,is),t(is,St),t(oe,rt),t(oe,f),t(f,O),t(oe,nt),n(e,Ot,r),y(Rs,e,r),n(e,Kt,r),n(e,bs,r),t(bs,Ia),n(e,Rt,r),Sa[ze].m(e,r),n(e,Xs,r),y(Ls,e,r),n(e,Zs,r),n(e,et,r),t(et,ot),n(e,Lt,r),n(e,Bs,r),t(Bs,it),n(e,Bt,r),n(e,as,r),t(as,Ga),t(as,Fs),t(Fs,Ua),t(as,pt),t(as,_t),t(_t,Wa),t(as,Ya),n(e,Br,r),y(Ft,e,r),n(e,Fr,r),y(Ht,e,r),n(e,Hr,r),n(e,ls,r),t(ls,Bl),t(Bl,Go),t(ls,Uo),t(ls,Fl),t(Fl,Wo),t(ls,Yo),t(ls,Hl),t(Hl,Vo),t(ls,Jo),t(ls,Nl),t(Nl,Qo),t(ls,Xo),t(ls,Il),t(Il,Zo),t(ls,ei),n(e,Nr,r),y(Nt,e,r),n(e,Ir,r),y(It,e,r),n(e,Gr,r),n(e,Hs,r),t(Hs,si),t(Hs,Gl),t(Gl,ti),t(Hs,ai),t(Hs,Ul),t(Ul,li),t(Hs,ri),n(e,Ur,r),y(ct,e,r),n(e,Wr,r),n(e,ft,r),t(ft,ni),t(ft,Va),t(Va,oi),t(ft,ii),n(e,Yr,r),n(e,Gt,r),t(Gt,pi),n(e,Vr,r),y(Ut,e,r),n(e,Jr,r),n(e,Ja,r),t(Ja,_i),n(e,Qr,r),n(e,We,r),t(We,ci),t(We,Wl),t(Wl,fi),t(We,mi),t(We,Yl),t(Yl,di),t(We,ui),t(We,Qa),t(Qa,hi),t(We,gi),t(We,Vl),t(Vl,bi),t(We,ki),t(We,Jl),t(Jl,$i),t(We,wi),n(e,Xr,r),y(Wt,e,r),n(e,Zr,r),y(Yt,e,r),n(e,en,r),n(e,ks,r),t(ks,ji),t(ks,Ql),t(Ql,vi),t(ks,Ei),t(ks,Xl),t(Xl,yi),t(ks,xi),t(ks,Zl),t(Zl,Di),t(ks,qi),n(e,sn,r),n(e,mt,r),t(mt,Mi),t(mt,er),t(er,Ti),t(mt,zi),n(e,tn,r),y(Vt,e,r),n(e,an,r),y(Jt,e,r),n(e,ln,r),n(e,dt,r),t(dt,Ai),t(dt,sr),t(sr,Pi),t(dt,Ci),n(e,rn,r),y(ut,e,r),n(e,nn,r),n(e,Xa,r),t(Xa,Si),n(e,on,r),y(Qt,e,r),n(e,pn,r),y(ht,e,r),n(e,_n,r),n(e,Za,r),t(Za,Oi),n(e,cn,r),y(Xt,e,r),n(e,fn,r),y(Zt,e,r),n(e,mn,r),n(e,el,r),t(el,Ki),n(e,dn,r),y(ea,e,r),n(e,un,r),y(sa,e,r),n(e,hn,r),n(e,sl,r),t(sl,Ri),n(e,gn,r),n(e,Ns,r),t(Ns,Li),t(Ns,tr),t(tr,Bi),t(Ns,Fi),t(Ns,ar),t(ar,Hi),t(Ns,Ni),n(e,bn,r),y(ta,e,r),n(e,kn,r),y(aa,e,r),n(e,$n,r),n(e,tl,r),t(tl,Ii),n(e,wn,r),n(e,gt,r),t(gt,la),t(la,Gi),t(la,lr),t(lr,Ui),t(la,Wi),t(gt,Yi),t(gt,ra),t(ra,Vi),t(ra,rr),t(rr,Ji),t(ra,Qi),n(e,jn,r),n(e,al,r),t(al,Xi),n(e,vn,r),y(na,e,r),n(e,En,r),n(e,us,r),t(us,nr),t(nr,Zi),t(us,ep),t(us,or),t(or,sp),t(us,tp),t(us,ir),t(ir,ap),t(us,lp),t(us,pr),t(pr,rp),t(us,np),n(e,yn,r),n(e,Is,r),t(Is,op),t(Is,_r),t(_r,ip),t(Is,pp),t(Is,cr),t(cr,_p),t(Is,cp),n(e,xn,r),y(oa,e,r),n(e,Dn,r),y(ia,e,r),n(e,qn,r),n(e,Ye,r),t(Ye,fp),t(Ye,fr),t(fr,mp),t(Ye,dp),t(Ye,mr),t(mr,up),t(Ye,hp),t(Ye,dr),t(dr,gp),t(Ye,bp),t(Ye,ur),t(ur,kp),t(Ye,$p),t(Ye,hr),t(hr,wp),t(Ye,jp),n(e,Mn,r),y(pa,e,r),n(e,Tn,r),y(_a,e,r),n(e,zn,r),n(e,ll,r),t(ll,vp),n(e,An,r),y(ca,e,r),n(e,Pn,r),y(fa,e,r),n(e,Cn,r),n(e,$s,r),t($s,Ep),t($s,gr),t(gr,yp),t($s,xp),t($s,br),t(br,Dp),t($s,qp),t($s,kr),t(kr,Mp),t($s,Tp),n(e,Sn,r),n(e,st,r),t(st,bt),t(bt,$r),y(ma,$r,null),t(st,zp),t(st,da),t(da,Ap),t(da,wr),t(wr,Pp),t(da,Cp),n(e,On,r),n(e,ws,r),t(ws,Sp),t(ws,rl),t(rl,Op),t(ws,Kp),t(ws,jr),t(jr,Rp),t(ws,Lp),t(ws,vr),t(vr,Bp),t(ws,Fp),n(e,Kn,r),y(ua,e,r),n(e,Rn,r),n(e,kt,r),t(kt,Hp),t(kt,Er),t(Er,Np),t(kt,Ip),n(e,Ln,r),y(ha,e,r),n(e,Bn,r),y(ga,e,r),n(e,Fn,r),n(e,$t,r),t($t,Gp),t($t,yr),t(yr,Up),t($t,Wp),n(e,Hn,r),n(e,wt,r),t(wt,Yp),t(wt,xr),t(xr,Vp),t(wt,Jp),n(e,Nn,r),y(jt,e,r),n(e,In,r),rs&&rs.m(e,r),n(e,nl,r),n(e,vt,r),t(vt,Qp),t(vt,Dr),t(Dr,Xp),t(vt,Zp),n(e,Gn,r),n(e,ol,r),t(ol,e_),n(e,Un,r),n(e,Et,r),t(Et,s_),t(Et,qr),t(qr,t_),t(Et,a_),n(e,Wn,r),Oa[xs].m(e,r),n(e,il,r),n(e,pl,r),t(pl,l_),n(e,Yn,r),y(ba,e,r),n(e,Vn,r),y(ka,e,r),n(e,Jn,r),y(yt,e,r),n(e,Qn,r),n(e,Gs,r),t(Gs,r_),t(Gs,_l),t(_l,n_),t(Gs,o_),t(Gs,Mr),t(Mr,i_),t(Gs,p_),n(e,Xn,r),y($a,e,r),n(e,Zn,r),y(wa,e,r),n(e,eo,r),n(e,Us,r),t(Us,__),t(Us,Tr),t(Tr,c_),t(Us,f_),t(Us,zr),t(zr,m_),t(Us,d_),n(e,so,r),n(e,cl,r),t(cl,u_),n(e,to,r),y(ja,e,r),n(e,ao,r),n(e,fl,r),t(fl,h_),n(e,lo,r),y(va,e,r),n(e,ro,r),n(e,ml,r),t(ml,g_),n(e,no,r),Ka[qs].m(e,r),n(e,dl,r),n(e,Ea,r),t(Ea,b_),n(e,oo,r),y(ya,e,r),n(e,io,r),n(e,ul,r),t(ul,k_),n(e,po,r),n(e,hl,r),t(hl,$_),n(e,_o,r),Ra[Ts].m(e,r),n(e,gl,r),y(xa,e,r),n(e,co,r),n(e,bl,r),t(bl,w_),n(e,fo,r),La[As].m(e,r),n(e,kl,r),n(e,$l,r),t($l,j_),n(e,mo,r),Ba[Cs].m(e,r),n(e,wl,r),y(Da,e,r),n(e,uo,r),n(e,jl,r),t(jl,v_),n(e,ho,r),Ce&&Ce.m(e,r),n(e,vl,r),y(xt,e,r),n(e,go,r),Se&&Se.m(e,r),n(e,El,r),n(e,qa,r),t(qa,E_),n(e,bo,r),n(e,Ws,r),t(Ws,y_),t(Ws,Ar),t(Ar,x_),t(Ws,D_),t(Ws,Pr),t(Pr,q_),t(Ws,M_),n(e,ko,r),y(Ma,e,r),n(e,$o,r),n(e,yl,r),t(yl,T_),n(e,wo,r),y(Ta,e,r),n(e,jo,r),y(za,e,r),n(e,vo,r),n(e,xl,r),t(xl,z_),n(e,Eo,r),y(Aa,e,r),n(e,yo,r),n(e,Dt,r),t(Dt,A_),t(Dt,Dl),t(Dl,P_),t(Dt,C_),n(e,xo,r),y(qt,e,r),Do=!0},p(e,[r]){const Cr={};r&1&&(Cr.fw=e[0]),c.$set(Cr);let ql=q;q=O_(e),q!==ql&&(Qs(),b(Pa[ql],1,1,()=>{Pa[ql]=null}),Js(),u=Pa[q],u||(u=Pa[q]=S_[q](e),u.c()),g(u,1),u.m(T.parentNode,T));const Sr={};r&2&&(Sr.$$scope={dirty:r,ctx:e}),ve.$set(Sr);let Ys=Te;Te=R_(e),Te!==Ys&&(Qs(),b(Ca[Ys],1,1,()=>{Ca[Ys]=null}),Js(),ue=Ca[Te],ue||(ue=Ca[Te]=K_[Te](e),ue.c()),g(ue,1),ue.m(ms.parentNode,ms));let Ml=ze;ze=B_(e),ze!==Ml&&(Qs(),b(Sa[Ml],1,1,()=>{Sa[Ml]=null}),Js(),ps=Sa[ze],ps||(ps=Sa[ze]=L_[ze](e),ps.c()),g(ps,1),ps.m(Xs.parentNode,Xs));const Or={};r&2&&(Or.$$scope={dirty:r,ctx:e}),ct.$set(Or);const Fa={};r&2&&(Fa.$$scope={dirty:r,ctx:e}),ut.$set(Fa);const Ha={};r&2&&(Ha.$$scope={dirty:r,ctx:e}),ht.$set(Ha);const Kr={};r&2&&(Kr.$$scope={dirty:r,ctx:e}),jt.$set(Kr),e[0]==="pt"?rs||(rs=Sf(),rs.c(),rs.m(nl.parentNode,nl)):rs&&(rs.d(1),rs=null);let Tl=xs;xs=H_(e),xs!==Tl&&(Qs(),b(Oa[Tl],1,1,()=>{Oa[Tl]=null}),Js(),Ds=Oa[xs],Ds||(Ds=Oa[xs]=F_[xs](e),Ds.c()),g(Ds,1),Ds.m(il.parentNode,il));const Rr={};r&2&&(Rr.$$scope={dirty:r,ctx:e}),yt.$set(Rr);let Mt=qs;qs=I_(e),qs!==Mt&&(Qs(),b(Ka[Mt],1,1,()=>{Ka[Mt]=null}),Js(),Ms=Ka[qs],Ms||(Ms=Ka[qs]=N_[qs](e),Ms.c()),g(Ms,1),Ms.m(dl.parentNode,dl));let zl=Ts;Ts=U_(e),Ts!==zl&&(Qs(),b(Ra[zl],1,1,()=>{Ra[zl]=null}),Js(),zs=Ra[Ts],zs||(zs=Ra[Ts]=G_[Ts](e),zs.c()),g(zs,1),zs.m(gl.parentNode,gl));let Al=As;As=Y_(e),As!==Al&&(Qs(),b(La[Al],1,1,()=>{La[Al]=null}),Js(),Ps=La[As],Ps||(Ps=La[As]=W_[As](e),Ps.c()),g(Ps,1),Ps.m(kl.parentNode,kl));let Tt=Cs;Cs=J_(e),Cs!==Tt&&(Qs(),b(Ba[Tt],1,1,()=>{Ba[Tt]=null}),Js(),Ss=Ba[Cs],Ss||(Ss=Ba[Cs]=V_[Cs](e),Ss.c()),g(Ss,1),Ss.m(wl.parentNode,wl)),e[0]==="pt"?Ce?r&1&&g(Ce,1):(Ce=Of(),Ce.c(),g(Ce,1),Ce.m(vl.parentNode,vl)):Ce&&(Qs(),b(Ce,1,1,()=>{Ce=null}),Js());const Lr={};r&2&&(Lr.$$scope={dirty:r,ctx:e}),xt.$set(Lr),e[0]==="pt"?Se?r&1&&g(Se,1):(Se=Kf(),Se.c(),g(Se,1),Se.m(El.parentNode,El)):Se&&(Qs(),b(Se,1,1,()=>{Se=null}),Js());const Na={};r&2&&(Na.$$scope={dirty:r,ctx:e}),qt.$set(Na)},i(e){Do||(g(c.$$.fragment,e),g(u),g(De.$$.fragment,e),g(ve.$$.fragment,e),g(ue),g(ss.$$.fragment,e),g(Rs.$$.fragment,e),g(ps),g(Ls.$$.fragment,e),g(Ft.$$.fragment,e),g(Ht.$$.fragment,e),g(Nt.$$.fragment,e),g(It.$$.fragment,e),g(ct.$$.fragment,e),g(Ut.$$.fragment,e),g(Wt.$$.fragment,e),g(Yt.$$.fragment,e),g(Vt.$$.fragment,e),g(Jt.$$.fragment,e),g(ut.$$.fragment,e),g(Qt.$$.fragment,e),g(ht.$$.fragment,e),g(Xt.$$.fragment,e),g(Zt.$$.fragment,e),g(ea.$$.fragment,e),g(sa.$$.fragment,e),g(ta.$$.fragment,e),g(aa.$$.fragment,e),g(na.$$.fragment,e),g(oa.$$.fragment,e),g(ia.$$.fragment,e),g(pa.$$.fragment,e),g(_a.$$.fragment,e),g(ca.$$.fragment,e),g(fa.$$.fragment,e),g(ma.$$.fragment,e),g(ua.$$.fragment,e),g(ha.$$.fragment,e),g(ga.$$.fragment,e),g(jt.$$.fragment,e),g(Ds),g(ba.$$.fragment,e),g(ka.$$.fragment,e),g(yt.$$.fragment,e),g($a.$$.fragment,e),g(wa.$$.fragment,e),g(ja.$$.fragment,e),g(va.$$.fragment,e),g(Ms),g(ya.$$.fragment,e),g(zs),g(xa.$$.fragment,e),g(Ps),g(Ss),g(Da.$$.fragment,e),g(Ce),g(xt.$$.fragment,e),g(Se),g(Ma.$$.fragment,e),g(Ta.$$.fragment,e),g(za.$$.fragment,e),g(Aa.$$.fragment,e),g(qt.$$.fragment,e),Do=!0)},o(e){b(c.$$.fragment,e),b(u),b(De.$$.fragment,e),b(ve.$$.fragment,e),b(ue),b(ss.$$.fragment,e),b(Rs.$$.fragment,e),b(ps),b(Ls.$$.fragment,e),b(Ft.$$.fragment,e),b(Ht.$$.fragment,e),b(Nt.$$.fragment,e),b(It.$$.fragment,e),b(ct.$$.fragment,e),b(Ut.$$.fragment,e),b(Wt.$$.fragment,e),b(Yt.$$.fragment,e),b(Vt.$$.fragment,e),b(Jt.$$.fragment,e),b(ut.$$.fragment,e),b(Qt.$$.fragment,e),b(ht.$$.fragment,e),b(Xt.$$.fragment,e),b(Zt.$$.fragment,e),b(ea.$$.fragment,e),b(sa.$$.fragment,e),b(ta.$$.fragment,e),b(aa.$$.fragment,e),b(na.$$.fragment,e),b(oa.$$.fragment,e),b(ia.$$.fragment,e),b(pa.$$.fragment,e),b(_a.$$.fragment,e),b(ca.$$.fragment,e),b(fa.$$.fragment,e),b(ma.$$.fragment,e),b(ua.$$.fragment,e),b(ha.$$.fragment,e),b(ga.$$.fragment,e),b(jt.$$.fragment,e),b(Ds),b(ba.$$.fragment,e),b(ka.$$.fragment,e),b(yt.$$.fragment,e),b($a.$$.fragment,e),b(wa.$$.fragment,e),b(ja.$$.fragment,e),b(va.$$.fragment,e),b(Ms),b(ya.$$.fragment,e),b(zs),b(xa.$$.fragment,e),b(Ps),b(Ss),b(Da.$$.fragment,e),b(Ce),b(xt.$$.fragment,e),b(Se),b(Ma.$$.fragment,e),b(Ta.$$.fragment,e),b(za.$$.fragment,e),b(Aa.$$.fragment,e),b(qt.$$.fragment,e),Do=!1},d(e){s(o),e&&s(h),x(c,e),e&&s(w),e&&s(D),e&&s(k),Pa[q].d(e),e&&s(T),e&&s(C),e&&s(L),e&&s(N),e&&s(B),e&&s(H),e&&s(he),e&&s(X),e&&s(Q),e&&s(le),e&&s(Ie),e&&s(re),e&&s(Fe),e&&s(fe),e&&s(ke),x(De,e),e&&s(pe),x(ve,e),e&&s($e),e&&s(Ee),e&&s(Re),e&&s(me),e&&s(He),e&&s(ae),e&&s(ne),e&&s(qe),e&&s(Je),e&&s(Me),e&&s(Qe),e&&s(Ue),e&&s(Xe),Ca[Te].d(e),e&&s(ms),e&&s(Ze),e&&s(es),x(ss,e),e&&s(ts),e&&s(oe),e&&s(Ot),x(Rs,e),e&&s(Kt),e&&s(bs),e&&s(Rt),Sa[ze].d(e),e&&s(Xs),x(Ls,e),e&&s(Zs),e&&s(et),e&&s(Lt),e&&s(Bs),e&&s(Bt),e&&s(as),e&&s(Br),x(Ft,e),e&&s(Fr),x(Ht,e),e&&s(Hr),e&&s(ls),e&&s(Nr),x(Nt,e),e&&s(Ir),x(It,e),e&&s(Gr),e&&s(Hs),e&&s(Ur),x(ct,e),e&&s(Wr),e&&s(ft),e&&s(Yr),e&&s(Gt),e&&s(Vr),x(Ut,e),e&&s(Jr),e&&s(Ja),e&&s(Qr),e&&s(We),e&&s(Xr),x(Wt,e),e&&s(Zr),x(Yt,e),e&&s(en),e&&s(ks),e&&s(sn),e&&s(mt),e&&s(tn),x(Vt,e),e&&s(an),x(Jt,e),e&&s(ln),e&&s(dt),e&&s(rn),x(ut,e),e&&s(nn),e&&s(Xa),e&&s(on),x(Qt,e),e&&s(pn),x(ht,e),e&&s(_n),e&&s(Za),e&&s(cn),x(Xt,e),e&&s(fn),x(Zt,e),e&&s(mn),e&&s(el),e&&s(dn),x(ea,e),e&&s(un),x(sa,e),e&&s(hn),e&&s(sl),e&&s(gn),e&&s(Ns),e&&s(bn),x(ta,e),e&&s(kn),x(aa,e),e&&s($n),e&&s(tl),e&&s(wn),e&&s(gt),e&&s(jn),e&&s(al),e&&s(vn),x(na,e),e&&s(En),e&&s(us),e&&s(yn),e&&s(Is),e&&s(xn),x(oa,e),e&&s(Dn),x(ia,e),e&&s(qn),e&&s(Ye),e&&s(Mn),x(pa,e),e&&s(Tn),x(_a,e),e&&s(zn),e&&s(ll),e&&s(An),x(ca,e),e&&s(Pn),x(fa,e),e&&s(Cn),e&&s($s),e&&s(Sn),e&&s(st),x(ma),e&&s(On),e&&s(ws),e&&s(Kn),x(ua,e),e&&s(Rn),e&&s(kt),e&&s(Ln),x(ha,e),e&&s(Bn),x(ga,e),e&&s(Fn),e&&s($t),e&&s(Hn),e&&s(wt),e&&s(Nn),x(jt,e),e&&s(In),rs&&rs.d(e),e&&s(nl),e&&s(vt),e&&s(Gn),e&&s(ol),e&&s(Un),e&&s(Et),e&&s(Wn),Oa[xs].d(e),e&&s(il),e&&s(pl),e&&s(Yn),x(ba,e),e&&s(Vn),x(ka,e),e&&s(Jn),x(yt,e),e&&s(Qn),e&&s(Gs),e&&s(Xn),x($a,e),e&&s(Zn),x(wa,e),e&&s(eo),e&&s(Us),e&&s(so),e&&s(cl),e&&s(to),x(ja,e),e&&s(ao),e&&s(fl),e&&s(lo),x(va,e),e&&s(ro),e&&s(ml),e&&s(no),Ka[qs].d(e),e&&s(dl),e&&s(Ea),e&&s(oo),x(ya,e),e&&s(io),e&&s(ul),e&&s(po),e&&s(hl),e&&s(_o),Ra[Ts].d(e),e&&s(gl),x(xa,e),e&&s(co),e&&s(bl),e&&s(fo),La[As].d(e),e&&s(kl),e&&s($l),e&&s(mo),Ba[Cs].d(e),e&&s(wl),x(Da,e),e&&s(uo),e&&s(jl),e&&s(ho),Ce&&Ce.d(e),e&&s(vl),x(xt,e),e&&s(go),Se&&Se.d(e),e&&s(El),e&&s(qa),e&&s(bo),e&&s(Ws),e&&s(ko),x(Ma,e),e&&s($o),e&&s(yl),e&&s(wo),x(Ta,e),e&&s(jo),x(za,e),e&&s(vo),e&&s(xl),e&&s(Eo),x(Aa,e),e&&s(yo),e&&s(Dt),e&&s(xo),x(qt,e)}}}const gm={local:"",sections:[{local:"",title:"\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u7528\u306E\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u30E2\u30C7\u30EB\u306E\u9078\u629E"},{local:"",title:"\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8"},{local:"",title:"\u30C7\u30FC\u30BF\u306E\u524D\u51E6\u7406"},{local:"distilberttrainerapi",sections:[{local:"",title:"\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"}],title:"DistilBERT\u3092`Trainer`API\u3067\u5FAE\u8ABF\u6574\u3059\u308B"},{local:"distilbert-accelerate",title:"DistilBERT\u3092\u{1F917} Accelerate\u3092\u4F7F\u3063\u3066\u5FAE\u8ABF\u6574\u3059\u308B"},{local:"",title:"\u5FAE\u8ABF\u6574\u3057\u305F\u30E2\u30C7\u30EB\u3092\u4F7F\u3046"}],title:"\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u5FAE\u8ABF\u6574"};function bm(K,o,h){let c="pt";return If(()=>{const w=new URLSearchParams(window.location.search);h(0,c=w.get("fw")||"pt")}),[c]}class xm extends Bf{constructor(o){super();Ff(this,o,bm,hm,Hf,{})}}export{xm as default,gm as metadata};
