import{s as qs,o as Ss,n as is}from"../chunks/scheduler.36a0863c.js";import{S as Ds,i as Ls,g as U,s as M,r as m,A as Ps,h as J,f as l,c,j as Fs,u,x as $,k as Ns,y as Ks,a as p,v as j,d,t as y,w as f}from"../chunks/index.f891bdb2.js";import{T as Zs}from"../chunks/Tip.a8272f7f.js";import{Y as Ys}from"../chunks/Youtube.0cbacd3d.js";import{C as E}from"../chunks/CodeBlock.3ec784ea.js";import{F as Hs,M as xs}from"../chunks/Markdown.4127c891.js";import{H as As}from"../chunks/Heading.3fb90772.js";function Os(T){let e,r='Revisa la <a href="https://huggingface.co/tasks/question-answering" rel="nofollow">página de la tarea</a> de responder preguntas para tener más información sobre otras formas de responder preguntas y los modelos, datasets y métricas asociadas.';return{c(){e=U("p"),e.innerHTML=r},l(a){e=J(a,"P",{"data-svelte-h":!0}),$(e)!=="svelte-1yfogxf"&&(e.innerHTML=r)},m(a,o){p(a,e,o)},p:is,d(a){a&&l(e)}}}function se(T){let e,r;return e=new E({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERlZmF1bHREYXRhQ29sbGF0b3IlMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGVmYXVsdERhdGFDb2xsYXRvcigp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DefaultDataCollator

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DefaultDataCollator()`,wrap:!1}}),{c(){m(e.$$.fragment)},l(a){u(e.$$.fragment,a)},m(a,o){j(e,a,o),r=!0},p:is,i(a){r||(d(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}function ee(T){let e,r;return e=new xs({props:{$$slots:{default:[se]},$$scope:{ctx:T}}}),{c(){m(e.$$.fragment)},l(a){u(e.$$.fragment,a)},m(a,o){j(e,a,o),r=!0},p(a,o){const h={};o&2&&(h.$$scope={dirty:o,ctx:a}),e.$set(h)},i(a){r||(d(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}function ae(T){let e,r;return e=new E({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERlZmF1bHREYXRhQ29sbGF0b3IlMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGVmYXVsdERhdGFDb2xsYXRvcihyZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DefaultDataCollator

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DefaultDataCollator(return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`,wrap:!1}}),{c(){m(e.$$.fragment)},l(a){u(e.$$.fragment,a)},m(a,o){j(e,a,o),r=!0},p:is,i(a){r||(d(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}function le(T){let e,r;return e=new xs({props:{$$slots:{default:[ae]},$$scope:{ctx:T}}}),{c(){m(e.$$.fragment)},l(a){u(e.$$.fragment,a)},m(a,o){j(e,a,o),r=!0},p(a,o){const h={};o&2&&(h.$$scope={dirty:o,ctx:a}),e.$set(h)},i(a){r||(d(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}function te(T){let e,r='Para familiarizarte con el fine-tuning con <code>Trainer</code>, ¡mira el tutorial básico <a href="../training#finetune-with-trainer">aquí</a>!';return{c(){e=U("p"),e.innerHTML=r},l(a){e=J(a,"P",{"data-svelte-h":!0}),$(e)!=="svelte-1sco78m"&&(e.innerHTML=r)},m(a,o){p(a,e,o)},p:is,d(a){a&&l(e)}}}function ne(T){let e,r="Carga el modelo DistilBERT con <code>AutoModelForQuestionAnswering</code>:",a,o,h,C,A,b,k="En este punto, solo quedan tres pasos:",B,I,x="<li>Definir tus hiperparámetros de entrenamiento en <code>TrainingArguments</code>.</li> <li>Pasarle los argumentos del entrenamiento al <code>Trainer</code> junto con el modelo, el dataset, el tokenizer y el collator de datos.</li> <li>Invocar el método <code>train()</code> para realizar el fine-tuning del modelo.</li>",R,G,Z;return o=new E({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclF1ZXN0aW9uQW5zd2VyaW5nJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForQuestionAnswering, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),C=new Zs({props:{$$slots:{default:[te]},$$scope:{ctx:T}}}),G=new E({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGcmVzdWx0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMGV2YWx1YXRpb25fc3RyYXRlZ3klM0QlMjJlcG9jaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0QyZS01JTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3RyYWluX2Vwb2NocyUzRDMlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0b2tlbml6ZWRfc3F1YWQlNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHRva2VuaXplZF9zcXVhZCU1QiUyMnZhbGlkYXRpb24lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBkYXRhX2NvbGxhdG9yJTNEZGF0YV9jb2xsYXRvciUyQyUwQSklMEElMEF0cmFpbmVyLnRyYWluKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;./results&quot;</span>,
<span class="hljs-meta">... </span>    evaluation_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">2e-5</span>,
<span class="hljs-meta">... </span>    per_device_train_batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    per_device_eval_batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">3</span>,
<span class="hljs-meta">... </span>    weight_decay=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=tokenized_squad[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=tokenized_squad[<span class="hljs-string">&quot;validation&quot;</span>],
<span class="hljs-meta">... </span>    tokenizer=tokenizer,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`,wrap:!1}}),{c(){e=U("p"),e.innerHTML=r,a=M(),m(o.$$.fragment),h=M(),m(C.$$.fragment),A=M(),b=U("p"),b.textContent=k,B=M(),I=U("ol"),I.innerHTML=x,R=M(),m(G.$$.fragment)},l(i){e=J(i,"P",{"data-svelte-h":!0}),$(e)!=="svelte-1jpacxl"&&(e.innerHTML=r),a=c(i),u(o.$$.fragment,i),h=c(i),u(C.$$.fragment,i),A=c(i),b=J(i,"P",{"data-svelte-h":!0}),$(b)!=="svelte-bd5x35"&&(b.textContent=k),B=c(i),I=J(i,"OL",{"data-svelte-h":!0}),$(I)!=="svelte-omqmsj"&&(I.innerHTML=x),R=c(i),u(G.$$.fragment,i)},m(i,g){p(i,e,g),p(i,a,g),j(o,i,g),p(i,h,g),j(C,i,g),p(i,A,g),p(i,b,g),p(i,B,g),p(i,I,g),p(i,R,g),j(G,i,g),Z=!0},p(i,g){const _={};g&2&&(_.$$scope={dirty:g,ctx:i}),C.$set(_)},i(i){Z||(d(o.$$.fragment,i),d(C.$$.fragment,i),d(G.$$.fragment,i),Z=!0)},o(i){y(o.$$.fragment,i),y(C.$$.fragment,i),y(G.$$.fragment,i),Z=!1},d(i){i&&(l(e),l(a),l(h),l(A),l(b),l(B),l(I),l(R)),f(o,i),f(C,i),f(G,i)}}}function pe(T){let e,r;return e=new xs({props:{$$slots:{default:[ne]},$$scope:{ctx:T}}}),{c(){m(e.$$.fragment)},l(a){u(e.$$.fragment,a)},m(a,o){j(e,a,o),r=!0},p(a,o){const h={};o&2&&(h.$$scope={dirty:o,ctx:a}),e.$set(h)},i(a){r||(d(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}function re(T){let e,r='Para familiarizarte con el fine-tuning con Keras, ¡mira el tutorial básico <a href="training#finetune-with-keras">aquí</a>!';return{c(){e=U("p"),e.innerHTML=r},l(a){e=J(a,"P",{"data-svelte-h":!0}),$(e)!=="svelte-66s4ry"&&(e.innerHTML=r)},m(a,o){p(a,e,o)},p:is,d(a){a&&l(e)}}}function oe(T){let e,r="Para realizar el fine-tuning de un modelo en TensorFlow, primero convierte tus datasets al formato <code>tf.data.Dataset</code> con el método <code>prepare_tf_dataset()</code>.",a,o,h,C,A,b,k="Prepara una función de optimización, un programa para la tasa de aprendizaje y algunos hiperparámetros de entrenamiento:",B,I,x,R,G="Carga el modelo DistilBERT con <code>TFAutoModelForQuestionAnswering</code>:",Z,i,g,_,S='Configura el modelo para entrenarlo con <a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>:',X,v,V,F,D='Invoca el método <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a> para realizar el fine-tuning del modelo:',W,z,Q;return o=new E({props:{code:"dGZfdHJhaW5fc2V0JTIwJTNEJTIwbW9kZWwucHJlcGFyZV90Zl9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMHRva2VuaXplZF9zcXVhZCU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwc2h1ZmZsZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBiYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBjb2xsYXRlX2ZuJTNEZGF0YV9jb2xsYXRvciUyQyUwQSklMEElMEF0Zl92YWxpZGF0aW9uX3NldCUyMCUzRCUyMG1vZGVsLnByZXBhcmVfdGZfZGF0YXNldCglMEElMjAlMjAlMjAlMjB0b2tlbml6ZWRfc3F1YWQlNUIlMjJ2YWxpZGF0aW9uJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwc2h1ZmZsZSUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwY29sbGF0ZV9mbiUzRGRhdGFfY29sbGF0b3IlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    tokenized_squad[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_validation_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    tokenized_squad[<span class="hljs-string">&quot;validation&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)`,wrap:!1}}),C=new Zs({props:{$$slots:{default:[re]},$$scope:{ctx:T}}}),I=new E({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGNyZWF0ZV9vcHRpbWl6ZXIlMEElMEFiYXRjaF9zaXplJTIwJTNEJTIwMTYlMEFudW1fZXBvY2hzJTIwJTNEJTIwMiUwQXRvdGFsX3RyYWluX3N0ZXBzJTIwJTNEJTIwKGxlbih0b2tlbml6ZWRfc3F1YWQlNUIlMjJ0cmFpbiUyMiU1RCklMjAlMkYlMkYlMjBiYXRjaF9zaXplKSUyMColMjBudW1fZXBvY2hzJTBBb3B0aW1pemVyJTJDJTIwc2NoZWR1bGUlMjAlM0QlMjBjcmVhdGVfb3B0aW1pemVyKCUwQSUyMCUyMCUyMCUyMGluaXRfbHIlM0QyZS01JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3dhcm11cF9zdGVwcyUzRDAlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fc3RlcHMlM0R0b3RhbF90cmFpbl9zdGVwcyUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer

<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size = <span class="hljs-number">16</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_epochs = <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>total_train_steps = (<span class="hljs-built_in">len</span>(tokenized_squad[<span class="hljs-string">&quot;train&quot;</span>]) // batch_size) * num_epochs
<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer, schedule = create_optimizer(
<span class="hljs-meta">... </span>    init_lr=<span class="hljs-number">2e-5</span>,
<span class="hljs-meta">... </span>    num_warmup_steps=<span class="hljs-number">0</span>,
<span class="hljs-meta">... </span>    num_train_steps=total_train_steps,
<span class="hljs-meta">... </span>)`,wrap:!1}}),i=new E({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yUXVlc3Rpb25BbnN3ZXJpbmclMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yUXVlc3Rpb25BbnN3ZXJpbmcoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForQuestionAnswering(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),v=new E({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEFtb2RlbC5jb21waWxlKG9wdGltaXplciUzRG9wdGltaXplcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)`,wrap:!1}}),z=new E({props:{code:"bW9kZWwuZml0KHglM0R0Zl90cmFpbl9zZXQlMkMlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl92YWxpZGF0aW9uX3NldCUyQyUyMGVwb2NocyUzRDMp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_validation_set, epochs=<span class="hljs-number">3</span>)',wrap:!1}}),{c(){e=U("p"),e.innerHTML=r,a=M(),m(o.$$.fragment),h=M(),m(C.$$.fragment),A=M(),b=U("p"),b.textContent=k,B=M(),m(I.$$.fragment),x=M(),R=U("p"),R.innerHTML=G,Z=M(),m(i.$$.fragment),g=M(),_=U("p"),_.innerHTML=S,X=M(),m(v.$$.fragment),V=M(),F=U("p"),F.innerHTML=D,W=M(),m(z.$$.fragment)},l(t){e=J(t,"P",{"data-svelte-h":!0}),$(e)!=="svelte-1dn6k4v"&&(e.innerHTML=r),a=c(t),u(o.$$.fragment,t),h=c(t),u(C.$$.fragment,t),A=c(t),b=J(t,"P",{"data-svelte-h":!0}),$(b)!=="svelte-81yq28"&&(b.textContent=k),B=c(t),u(I.$$.fragment,t),x=c(t),R=J(t,"P",{"data-svelte-h":!0}),$(R)!=="svelte-owfaiz"&&(R.innerHTML=G),Z=c(t),u(i.$$.fragment,t),g=c(t),_=J(t,"P",{"data-svelte-h":!0}),$(_)!=="svelte-jy7mgr"&&(_.innerHTML=S),X=c(t),u(v.$$.fragment,t),V=c(t),F=J(t,"P",{"data-svelte-h":!0}),$(F)!=="svelte-1dz4xz1"&&(F.innerHTML=D),W=c(t),u(z.$$.fragment,t)},m(t,w){p(t,e,w),p(t,a,w),j(o,t,w),p(t,h,w),j(C,t,w),p(t,A,w),p(t,b,w),p(t,B,w),j(I,t,w),p(t,x,w),p(t,R,w),p(t,Z,w),j(i,t,w),p(t,g,w),p(t,_,w),p(t,X,w),j(v,t,w),p(t,V,w),p(t,F,w),p(t,W,w),j(z,t,w),Q=!0},p(t,w){const N={};w&2&&(N.$$scope={dirty:w,ctx:t}),C.$set(N)},i(t){Q||(d(o.$$.fragment,t),d(C.$$.fragment,t),d(I.$$.fragment,t),d(i.$$.fragment,t),d(v.$$.fragment,t),d(z.$$.fragment,t),Q=!0)},o(t){y(o.$$.fragment,t),y(C.$$.fragment,t),y(I.$$.fragment,t),y(i.$$.fragment,t),y(v.$$.fragment,t),y(z.$$.fragment,t),Q=!1},d(t){t&&(l(e),l(a),l(h),l(A),l(b),l(B),l(x),l(R),l(Z),l(g),l(_),l(X),l(V),l(F),l(W)),f(o,t),f(C,t),f(I,t),f(i,t),f(v,t),f(z,t)}}}function ie(T){let e,r;return e=new xs({props:{$$slots:{default:[oe]},$$scope:{ctx:T}}}),{c(){m(e.$$.fragment)},l(a){u(e.$$.fragment,a)},m(a,o){j(e,a,o),r=!0},p(a,o){const h={};o&2&&(h.$$scope={dirty:o,ctx:a}),e.$set(h)},i(a){r||(d(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}function Me(T){let e,r=`Para un ejemplo con mayor profundidad de cómo hacer fine-tuning a un modelo para responder preguntas, échale un vistazo al
<a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb" rel="nofollow">cuaderno de PyTorch</a> o al
<a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering-tf.ipynb" rel="nofollow">cuaderno de TensorFlow</a> correspondiente.`;return{c(){e=U("p"),e.innerHTML=r},l(a){e=J(a,"P",{"data-svelte-h":!0}),$(e)!=="svelte-1vvpf09"&&(e.innerHTML=r)},m(a,o){p(a,e,o)},p:is,d(a){a&&l(e)}}}function ce(T){let e,r,a,o,h,C,A,b,k,B="La respuesta a preguntas devuelve una respuesta a partir de una pregunta dada. Existen dos formas comunes de responder preguntas:",I,x,R="<li>Extractiva: extraer la respuesta a partir del contexto dado.</li> <li>Abstractiva: generar una respuesta que responda correctamente la pregunta a partir del contexto dado.</li>",G,Z,i='Esta guía te mostrará como hacer fine-tuning de <a href="https://huggingface.co/distilbert-base-uncased" rel="nofollow">DistilBERT</a> en el dataset <a href="https://huggingface.co/datasets/squad" rel="nofollow">SQuAD</a> para responder preguntas de forma extractiva.',g,_,S,X,v,V,F="Carga el dataset SQuAD con la biblioteca 🤗 Datasets:",D,W,z,Q,t="Ahora, échale un vistazo a una muestra:",w,N,cs,L,Rs="El campo <code>answers</code> es un diccionario que contiene la posición inicial de la respuesta y el <code>texto</code> de la respuesta.",ms,P,us,K,js,O,Gs="Carga el tokenizer de DistilBERT para procesar los campos <code>question</code> (pregunta) y <code>context</code> (contexto):",ds,ss,ys,es,Es="Hay algunos pasos de preprocesamiento específicos para la tarea de respuesta a preguntas que debes tener en cuenta:",fs,as,ks=`<li>Algunos ejemplos en un dataset pueden tener un contexto que supera la longitud máxima de entrada de un modelo. Trunca solamente el contexto asignándole el valor <code>&quot;only_second&quot;</code> al parámetro <code>truncation</code>.</li> <li>A continuación, mapea las posiciones de inicio y fin de la respuesta al contexto original asignándole el valor <code>True</code> al parámetro <code>return_offsets_mapping</code>.</li> <li>Una vez tengas el mapeo, puedes encontrar los tokens de inicio y fin de la respuesta. Usa el método <a href="https://huggingface.co/docs/tokenizers/python/latest/api/reference.html#tokenizers.Encoding.sequence_ids" rel="nofollow"><code>sequence_ids</code></a>
para encontrar qué parte de la lista de tokens desplazados corresponde a la pregunta y cuál corresponde al contexto.</li>`,hs,ls,Bs="A continuación puedes ver como se crea una función para truncar y mapear los tokens de inicio y fin de la respuesta al <code>context</code>:",ws,ts,Us,ns,Xs=`Usa la función <code>map</code> de 🤗 Datasets para aplicarle la función de preprocesamiento al dataset entero. Puedes acelerar la función <code>map</code> haciendo <code>batched=True</code> para procesar varios elementos del dataset a la vez.
Quita las columnas que no necesites:`,Js,ps,Ts,rs,vs="Usa el <code>DefaultDataCollator</code> para crear un lote de ejemplos. A diferencia de los otros collators de datos en 🤗 Transformers, el <code>DefaultDataCollator</code> no aplica ningún procesamiento adicional (como el rellenado).",gs,Y,$s,os,Cs,H,bs,q,Is,Ms,_s;return h=new As({props:{title:"Respuesta a preguntas",local:"respuesta-a-preguntas",headingTag:"h1"}}),A=new Ys({props:{id:"ajPx5LwJD-I"}}),_=new Zs({props:{$$slots:{default:[Os]},$$scope:{ctx:T}}}),X=new As({props:{title:"Carga el dataset SQuAD",local:"carga-el-dataset-squad",headingTag:"h2"}}),W=new E({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBc3F1YWQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyc3F1YWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>squad = load_dataset(<span class="hljs-string">&quot;squad&quot;</span>)`,wrap:!1}}),N=new E({props:{code:"c3F1YWQlNUIlMjJ0cmFpbiUyMiU1RCU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>squad[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;answers&#x27;</span>: {<span class="hljs-string">&#x27;answer_start&#x27;</span>: [<span class="hljs-number">515</span>], <span class="hljs-string">&#x27;text&#x27;</span>: [<span class="hljs-string">&#x27;Saint Bernadette Soubirous&#x27;</span>]},
 <span class="hljs-string">&#x27;context&#x27;</span>: <span class="hljs-string">&#x27;Architecturally, the school has a Catholic character. Atop the Main Building\\&#x27;s gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend &quot;Venite Ad Me Omnes&quot;. Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.&#x27;</span>,
 <span class="hljs-string">&#x27;id&#x27;</span>: <span class="hljs-string">&#x27;5733be284776f41900661182&#x27;</span>,
 <span class="hljs-string">&#x27;question&#x27;</span>: <span class="hljs-string">&#x27;To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?&#x27;</span>,
 <span class="hljs-string">&#x27;title&#x27;</span>: <span class="hljs-string">&#x27;University_of_Notre_Dame&#x27;</span>
}`,wrap:!1}}),P=new As({props:{title:"Preprocesamiento",local:"preprocesamiento",headingTag:"h2"}}),K=new Ys({props:{id:"qgaM0weJHpA"}}),ss=new E({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),ts=new E({props:{code:"ZGVmJTIwcHJlcHJvY2Vzc19mdW5jdGlvbihleGFtcGxlcyklM0ElMEElMjAlMjAlMjAlMjBxdWVzdGlvbnMlMjAlM0QlMjAlNUJxLnN0cmlwKCklMjBmb3IlMjBxJTIwaW4lMjBleGFtcGxlcyU1QiUyMnF1ZXN0aW9uJTIyJTVEJTVEJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyM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IwLSUyMDEpJTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaWR4JTIwJTNEJTIwY29udGV4dF9lbmQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB3aGlsZSUyMGlkeCUyMCUzRSUzRCUyMGNvbnRleHRfc3RhcnQlMjBhbmQlMjBvZmZzZXQlNUJpZHglNUQlNUIxJTVEJTIwJTNFJTNEJTIwZW5kX2NoYXIlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBpZHglMjAtJTNEJTIwMSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGVuZF9wb3NpdGlvbnMuYXBwZW5kKGlkeCUyMCUyQiUyMDEpJTBBJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTVCJTIyc3RhcnRfcG9zaXRpb25zJTIyJTVEJTIwJTNEJTIwc3RhcnRfcG9zaXRpb25zJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTVCJTIyZW5kX3Bvc2l0aW9ucyUyMiU1RCUyMCUzRCUyMGVuZF9wb3NpdGlvbnMlMEElMjAlMjAlMjAlMjByZXR1cm4lMjBpbnB1dHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">preprocess_function</span>(<span class="hljs-params">examples</span>):
<span class="hljs-meta">... </span>    questions = [q.strip() <span class="hljs-keyword">for</span> q <span class="hljs-keyword">in</span> examples[<span class="hljs-string">&quot;question&quot;</span>]]
<span class="hljs-meta">... </span>    inputs = tokenizer(
<span class="hljs-meta">... </span>        questions,
<span class="hljs-meta">... </span>        examples[<span class="hljs-string">&quot;context&quot;</span>],
<span class="hljs-meta">... </span>        max_length=<span class="hljs-number">384</span>,
<span class="hljs-meta">... </span>        truncation=<span class="hljs-string">&quot;only_second&quot;</span>,
<span class="hljs-meta">... </span>        return_offsets_mapping=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>        padding=<span class="hljs-string">&quot;max_length&quot;</span>,
<span class="hljs-meta">... </span>    )

<span class="hljs-meta">... </span>    offset_mapping = inputs.pop(<span class="hljs-string">&quot;offset_mapping&quot;</span>)
<span class="hljs-meta">... </span>    answers = examples[<span class="hljs-string">&quot;answers&quot;</span>]
<span class="hljs-meta">... </span>    start_positions = []
<span class="hljs-meta">... </span>    end_positions = []

<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> i, offset <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(offset_mapping):
<span class="hljs-meta">... </span>        answer = answers[i]
<span class="hljs-meta">... </span>        start_char = answer[<span class="hljs-string">&quot;answer_start&quot;</span>][<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>        end_char = answer[<span class="hljs-string">&quot;answer_start&quot;</span>][<span class="hljs-number">0</span>] + <span class="hljs-built_in">len</span>(answer[<span class="hljs-string">&quot;text&quot;</span>][<span class="hljs-number">0</span>])
<span class="hljs-meta">... </span>        sequence_ids = inputs.sequence_ids(i)

<span class="hljs-meta">... </span>        <span class="hljs-comment"># Encuentra el inicio y el fin del contexto</span>
<span class="hljs-meta">... </span>        idx = <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>        <span class="hljs-keyword">while</span> sequence_ids[idx] != <span class="hljs-number">1</span>:
<span class="hljs-meta">... </span>            idx += <span class="hljs-number">1</span>
<span class="hljs-meta">... </span>        context_start = idx
<span class="hljs-meta">... </span>        <span class="hljs-keyword">while</span> sequence_ids[idx] == <span class="hljs-number">1</span>:
<span class="hljs-meta">... </span>            idx += <span class="hljs-number">1</span>
<span class="hljs-meta">... </span>        context_end = idx - <span class="hljs-number">1</span>

<span class="hljs-meta">... </span>        <span class="hljs-comment"># Si la respuesta entera no está dentro del contexto, etiquétala como (0, 0)</span>
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> offset[context_start][<span class="hljs-number">0</span>] &gt; end_char <span class="hljs-keyword">or</span> offset[context_end][<span class="hljs-number">1</span>] &lt; start_char:
<span class="hljs-meta">... </span>            start_positions.append(<span class="hljs-number">0</span>)
<span class="hljs-meta">... </span>            end_positions.append(<span class="hljs-number">0</span>)
<span class="hljs-meta">... </span>        <span class="hljs-keyword">else</span>:
<span class="hljs-meta">... </span>            <span class="hljs-comment"># De lo contrario, esta es la posición de los tokens de inicio y fin</span>
<span class="hljs-meta">... </span>            idx = context_start
<span class="hljs-meta">... </span>            <span class="hljs-keyword">while</span> idx &lt;= context_end <span class="hljs-keyword">and</span> offset[idx][<span class="hljs-number">0</span>] &lt;= start_char:
<span class="hljs-meta">... </span>                idx += <span class="hljs-number">1</span>
<span class="hljs-meta">... </span>            start_positions.append(idx - <span class="hljs-number">1</span>)

<span class="hljs-meta">... </span>            idx = context_end
<span class="hljs-meta">... </span>            <span class="hljs-keyword">while</span> idx &gt;= context_start <span class="hljs-keyword">and</span> offset[idx][<span class="hljs-number">1</span>] &gt;= end_char:
<span class="hljs-meta">... </span>                idx -= <span class="hljs-number">1</span>
<span class="hljs-meta">... </span>            end_positions.append(idx + <span class="hljs-number">1</span>)

<span class="hljs-meta">... </span>    inputs[<span class="hljs-string">&quot;start_positions&quot;</span>] = start_positions
<span class="hljs-meta">... </span>    inputs[<span class="hljs-string">&quot;end_positions&quot;</span>] = end_positions
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> inputs`,wrap:!1}}),ps=new E({props:{code:"dG9rZW5pemVkX3NxdWFkJTIwJTNEJTIwc3F1YWQubWFwKHByZXByb2Nlc3NfZnVuY3Rpb24lMkMlMjBiYXRjaGVkJTNEVHJ1ZSUyQyUyMHJlbW92ZV9jb2x1bW5zJTNEc3F1YWQlNUIlMjJ0cmFpbiUyMiU1RC5jb2x1bW5fbmFtZXMp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_squad = squad.<span class="hljs-built_in">map</span>(preprocess_function, batched=<span class="hljs-literal">True</span>, remove_columns=squad[<span class="hljs-string">&quot;train&quot;</span>].column_names)',wrap:!1}}),Y=new Hs({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[le],pytorch:[ee]},$$scope:{ctx:T}}}),os=new As({props:{title:"Entrenamiento",local:"entrenamiento",headingTag:"h2"}}),H=new Hs({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ie],pytorch:[pe]},$$scope:{ctx:T}}}),q=new Zs({props:{$$slots:{default:[Me]},$$scope:{ctx:T}}}),{c(){e=U("meta"),r=M(),a=U("p"),o=M(),m(h.$$.fragment),C=M(),m(A.$$.fragment),b=M(),k=U("p"),k.textContent=B,I=M(),x=U("ul"),x.innerHTML=R,G=M(),Z=U("p"),Z.innerHTML=i,g=M(),m(_.$$.fragment),S=M(),m(X.$$.fragment),v=M(),V=U("p"),V.textContent=F,D=M(),m(W.$$.fragment),z=M(),Q=U("p"),Q.textContent=t,w=M(),m(N.$$.fragment),cs=M(),L=U("p"),L.innerHTML=Rs,ms=M(),m(P.$$.fragment),us=M(),m(K.$$.fragment),js=M(),O=U("p"),O.innerHTML=Gs,ds=M(),m(ss.$$.fragment),ys=M(),es=U("p"),es.textContent=Es,fs=M(),as=U("ol"),as.innerHTML=ks,hs=M(),ls=U("p"),ls.innerHTML=Bs,ws=M(),m(ts.$$.fragment),Us=M(),ns=U("p"),ns.innerHTML=Xs,Js=M(),m(ps.$$.fragment),Ts=M(),rs=U("p"),rs.innerHTML=vs,gs=M(),m(Y.$$.fragment),$s=M(),m(os.$$.fragment),Cs=M(),m(H.$$.fragment),bs=M(),m(q.$$.fragment),Is=M(),Ms=U("p"),this.h()},l(s){const n=Ps("svelte-u9bgzb",document.head);e=J(n,"META",{name:!0,content:!0}),n.forEach(l),r=c(s),a=J(s,"P",{}),Fs(a).forEach(l),o=c(s),u(h.$$.fragment,s),C=c(s),u(A.$$.fragment,s),b=c(s),k=J(s,"P",{"data-svelte-h":!0}),$(k)!=="svelte-dwstrz"&&(k.textContent=B),I=c(s),x=J(s,"UL",{"data-svelte-h":!0}),$(x)!=="svelte-3bop09"&&(x.innerHTML=R),G=c(s),Z=J(s,"P",{"data-svelte-h":!0}),$(Z)!=="svelte-1crydxd"&&(Z.innerHTML=i),g=c(s),u(_.$$.fragment,s),S=c(s),u(X.$$.fragment,s),v=c(s),V=J(s,"P",{"data-svelte-h":!0}),$(V)!=="svelte-pf8yi"&&(V.textContent=F),D=c(s),u(W.$$.fragment,s),z=c(s),Q=J(s,"P",{"data-svelte-h":!0}),$(Q)!=="svelte-161h43k"&&(Q.textContent=t),w=c(s),u(N.$$.fragment,s),cs=c(s),L=J(s,"P",{"data-svelte-h":!0}),$(L)!=="svelte-14mr2wr"&&(L.innerHTML=Rs),ms=c(s),u(P.$$.fragment,s),us=c(s),u(K.$$.fragment,s),js=c(s),O=J(s,"P",{"data-svelte-h":!0}),$(O)!=="svelte-10ihzcv"&&(O.innerHTML=Gs),ds=c(s),u(ss.$$.fragment,s),ys=c(s),es=J(s,"P",{"data-svelte-h":!0}),$(es)!=="svelte-1p9uuun"&&(es.textContent=Es),fs=c(s),as=J(s,"OL",{"data-svelte-h":!0}),$(as)!=="svelte-1av8agk"&&(as.innerHTML=ks),hs=c(s),ls=J(s,"P",{"data-svelte-h":!0}),$(ls)!=="svelte-x2vphs"&&(ls.innerHTML=Bs),ws=c(s),u(ts.$$.fragment,s),Us=c(s),ns=J(s,"P",{"data-svelte-h":!0}),$(ns)!=="svelte-1eq69ea"&&(ns.innerHTML=Xs),Js=c(s),u(ps.$$.fragment,s),Ts=c(s),rs=J(s,"P",{"data-svelte-h":!0}),$(rs)!=="svelte-1w3gd6z"&&(rs.innerHTML=vs),gs=c(s),u(Y.$$.fragment,s),$s=c(s),u(os.$$.fragment,s),Cs=c(s),u(H.$$.fragment,s),bs=c(s),u(q.$$.fragment,s),Is=c(s),Ms=J(s,"P",{}),Fs(Ms).forEach(l),this.h()},h(){Ns(e,"name","hf:doc:metadata"),Ns(e,"content",me)},m(s,n){Ks(document.head,e),p(s,r,n),p(s,a,n),p(s,o,n),j(h,s,n),p(s,C,n),j(A,s,n),p(s,b,n),p(s,k,n),p(s,I,n),p(s,x,n),p(s,G,n),p(s,Z,n),p(s,g,n),j(_,s,n),p(s,S,n),j(X,s,n),p(s,v,n),p(s,V,n),p(s,D,n),j(W,s,n),p(s,z,n),p(s,Q,n),p(s,w,n),j(N,s,n),p(s,cs,n),p(s,L,n),p(s,ms,n),j(P,s,n),p(s,us,n),j(K,s,n),p(s,js,n),p(s,O,n),p(s,ds,n),j(ss,s,n),p(s,ys,n),p(s,es,n),p(s,fs,n),p(s,as,n),p(s,hs,n),p(s,ls,n),p(s,ws,n),j(ts,s,n),p(s,Us,n),p(s,ns,n),p(s,Js,n),j(ps,s,n),p(s,Ts,n),p(s,rs,n),p(s,gs,n),j(Y,s,n),p(s,$s,n),j(os,s,n),p(s,Cs,n),j(H,s,n),p(s,bs,n),j(q,s,n),p(s,Is,n),p(s,Ms,n),_s=!0},p(s,[n]){const Vs={};n&2&&(Vs.$$scope={dirty:n,ctx:s}),_.$set(Vs);const Ws={};n&2&&(Ws.$$scope={dirty:n,ctx:s}),Y.$set(Ws);const zs={};n&2&&(zs.$$scope={dirty:n,ctx:s}),H.$set(zs);const Qs={};n&2&&(Qs.$$scope={dirty:n,ctx:s}),q.$set(Qs)},i(s){_s||(d(h.$$.fragment,s),d(A.$$.fragment,s),d(_.$$.fragment,s),d(X.$$.fragment,s),d(W.$$.fragment,s),d(N.$$.fragment,s),d(P.$$.fragment,s),d(K.$$.fragment,s),d(ss.$$.fragment,s),d(ts.$$.fragment,s),d(ps.$$.fragment,s),d(Y.$$.fragment,s),d(os.$$.fragment,s),d(H.$$.fragment,s),d(q.$$.fragment,s),_s=!0)},o(s){y(h.$$.fragment,s),y(A.$$.fragment,s),y(_.$$.fragment,s),y(X.$$.fragment,s),y(W.$$.fragment,s),y(N.$$.fragment,s),y(P.$$.fragment,s),y(K.$$.fragment,s),y(ss.$$.fragment,s),y(ts.$$.fragment,s),y(ps.$$.fragment,s),y(Y.$$.fragment,s),y(os.$$.fragment,s),y(H.$$.fragment,s),y(q.$$.fragment,s),_s=!1},d(s){s&&(l(r),l(a),l(o),l(C),l(b),l(k),l(I),l(x),l(G),l(Z),l(g),l(S),l(v),l(V),l(D),l(z),l(Q),l(w),l(cs),l(L),l(ms),l(us),l(js),l(O),l(ds),l(ys),l(es),l(fs),l(as),l(hs),l(ls),l(ws),l(Us),l(ns),l(Js),l(Ts),l(rs),l(gs),l($s),l(Cs),l(bs),l(Is),l(Ms)),l(e),f(h,s),f(A,s),f(_,s),f(X,s),f(W,s),f(N,s),f(P,s),f(K,s),f(ss,s),f(ts,s),f(ps,s),f(Y,s),f(os,s),f(H,s),f(q,s)}}}const me='{"title":"Respuesta a preguntas","local":"respuesta-a-preguntas","sections":[{"title":"Carga el dataset SQuAD","local":"carga-el-dataset-squad","sections":[],"depth":2},{"title":"Preprocesamiento","local":"preprocesamiento","sections":[],"depth":2},{"title":"Entrenamiento","local":"entrenamiento","sections":[],"depth":2}],"depth":1}';function ue(T){return Ss(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Je extends Ds{constructor(e){super(),Ls(this,e,ue,ce,qs,{})}}export{Je as component};
