import{s as Ds,o as Ls,n as Ms}from"../chunks/scheduler.36a0863c.js";import{S as Ps,i as Ks,g as U,s as M,r as m,A as Os,h as J,f as t,c,j as Ys,u,x as $,k as qs,y as se,a as n,v as d,d as j,t as y,w as f}from"../chunks/index.f891bdb2.js";import{T as Rs}from"../chunks/Tip.a8272f7f.js";import{Y as Hs}from"../chunks/Youtube.0cbacd3d.js";import{C as k}from"../chunks/CodeBlock.3ec784ea.js";import{F as Ss,M as xs}from"../chunks/Markdown.7b58822e.js";import{H as Gs,E as ee}from"../chunks/EditOnGithub.a58e27a9.js";function ae(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){n(a,e,o)},p:Ms,d(a){a&&t(e)}}}function te(T){let e,r;return e=new k({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){d(e,a,o),r=!0},p:Ms,i(a){r||(j(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:[te]},$$scope:{ctx:T}}}),{c(){m(e.$$.fragment)},l(a){u(e.$$.fragment,a)},m(a,o){d(e,a,o),r=!0},p(a,o){const h={};o&2&&(h.$$scope={dirty:o,ctx:a}),e.$set(h)},i(a){r||(j(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}function ne(T){let e,r;return e=new k({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){d(e,a,o),r=!0},p:Ms,i(a){r||(j(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}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){d(e,a,o),r=!0},p(a,o){const h={};o&2&&(h.$$scope={dirty:o,ctx:a}),e.$set(h)},i(a){r||(j(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 <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){n(a,e,o)},p:Ms,d(a){a&&t(e)}}}function oe(T){let e,r="Carga el modelo DistilBERT con <code>AutoModelForQuestionAnswering</code>:",a,o,h,C,A,b,E="En este punto, solo quedan tres pasos:",B,I,G="<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,x,Z;return o=new k({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclF1ZXN0aW9uQW5zd2VyaW5nJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",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/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),C=new Rs({props:{$$slots:{default:[re]},$$scope:{ctx:T}}}),x=new k({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGcmVzdWx0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfc3RyYXRlZ3klM0QlMjJlcG9jaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0QyZS01JTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3RyYWluX2Vwb2NocyUzRDMlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0b2tlbml6ZWRfc3F1YWQlNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHRva2VuaXplZF9zcXVhZCU1QiUyMnZhbGlkYXRpb24lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBkYXRhX2NvbGxhdG9yJTNEZGF0YV9jb2xsYXRvciUyQyUwQSklMEElMEF0cmFpbmVyLnRyYWluKCk=",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>    eval_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=E,B=M(),I=U("ol"),I.innerHTML=G,R=M(),m(x.$$.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=E),B=c(i),I=J(i,"OL",{"data-svelte-h":!0}),$(I)!=="svelte-omqmsj"&&(I.innerHTML=G),R=c(i),u(x.$$.fragment,i)},m(i,g){n(i,e,g),n(i,a,g),d(o,i,g),n(i,h,g),d(C,i,g),n(i,A,g),n(i,b,g),n(i,B,g),n(i,I,g),n(i,R,g),d(x,i,g),Z=!0},p(i,g){const _={};g&2&&(_.$$scope={dirty:g,ctx:i}),C.$set(_)},i(i){Z||(j(o.$$.fragment,i),j(C.$$.fragment,i),j(x.$$.fragment,i),Z=!0)},o(i){y(o.$$.fragment,i),y(C.$$.fragment,i),y(x.$$.fragment,i),Z=!1},d(i){i&&(t(e),t(a),t(h),t(A),t(b),t(B),t(I),t(R)),f(o,i),f(C,i),f(x,i)}}}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){d(e,a,o),r=!0},p(a,o){const h={};o&2&&(h.$$scope={dirty:o,ctx:a}),e.$set(h)},i(a){r||(j(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 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){n(a,e,o)},p:Ms,d(a){a&&t(e)}}}function ce(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,E="Prepara una función de optimización, un programa para la tasa de aprendizaje y algunos hiperparámetros de entrenamiento:",B,I,G,R,x="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:',z,Q,W;return o=new k({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 Rs({props:{$$slots:{default:[Me]},$$scope:{ctx:T}}}),I=new k({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 k({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yUXVlc3Rpb25BbnN3ZXJpbmclMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yUXVlc3Rpb25BbnN3ZXJpbmcoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",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/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),v=new k({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}}),Q=new k({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=E,B=M(),m(I.$$.fragment),G=M(),R=U("p"),R.innerHTML=x,Z=M(),m(i.$$.fragment),g=M(),_=U("p"),_.innerHTML=S,X=M(),m(v.$$.fragment),V=M(),F=U("p"),F.innerHTML=D,z=M(),m(Q.$$.fragment)},l(p){e=J(p,"P",{"data-svelte-h":!0}),$(e)!=="svelte-1dn6k4v"&&(e.innerHTML=r),a=c(p),u(o.$$.fragment,p),h=c(p),u(C.$$.fragment,p),A=c(p),b=J(p,"P",{"data-svelte-h":!0}),$(b)!=="svelte-81yq28"&&(b.textContent=E),B=c(p),u(I.$$.fragment,p),G=c(p),R=J(p,"P",{"data-svelte-h":!0}),$(R)!=="svelte-owfaiz"&&(R.innerHTML=x),Z=c(p),u(i.$$.fragment,p),g=c(p),_=J(p,"P",{"data-svelte-h":!0}),$(_)!=="svelte-jy7mgr"&&(_.innerHTML=S),X=c(p),u(v.$$.fragment,p),V=c(p),F=J(p,"P",{"data-svelte-h":!0}),$(F)!=="svelte-1dz4xz1"&&(F.innerHTML=D),z=c(p),u(Q.$$.fragment,p)},m(p,w){n(p,e,w),n(p,a,w),d(o,p,w),n(p,h,w),d(C,p,w),n(p,A,w),n(p,b,w),n(p,B,w),d(I,p,w),n(p,G,w),n(p,R,w),n(p,Z,w),d(i,p,w),n(p,g,w),n(p,_,w),n(p,X,w),d(v,p,w),n(p,V,w),n(p,F,w),n(p,z,w),d(Q,p,w),W=!0},p(p,w){const N={};w&2&&(N.$$scope={dirty:w,ctx:p}),C.$set(N)},i(p){W||(j(o.$$.fragment,p),j(C.$$.fragment,p),j(I.$$.fragment,p),j(i.$$.fragment,p),j(v.$$.fragment,p),j(Q.$$.fragment,p),W=!0)},o(p){y(o.$$.fragment,p),y(C.$$.fragment,p),y(I.$$.fragment,p),y(i.$$.fragment,p),y(v.$$.fragment,p),y(Q.$$.fragment,p),W=!1},d(p){p&&(t(e),t(a),t(h),t(A),t(b),t(B),t(G),t(R),t(Z),t(g),t(_),t(X),t(V),t(F),t(z)),f(o,p),f(C,p),f(I,p),f(i,p),f(v,p),f(Q,p)}}}function me(T){let e,r;return e=new xs({props:{$$slots:{default:[ce]},$$scope:{ctx:T}}}),{c(){m(e.$$.fragment)},l(a){u(e.$$.fragment,a)},m(a,o){d(e,a,o),r=!0},p(a,o){const h={};o&2&&(h.$$scope={dirty:o,ctx:a}),e.$set(h)},i(a){r||(j(e.$$.fragment,a),r=!0)},o(a){y(e.$$.fragment,a),r=!1},d(a){f(e,a)}}}function ue(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){n(a,e,o)},p:Ms,d(a){a&&t(e)}}}function de(T){let e,r,a,o,h,C,A,b,E,B="La respuesta a preguntas devuelve una respuesta a partir de una pregunta dada. Existen dos formas comunes de responder preguntas:",I,G,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>",x,Z,i='Esta guía te mostrará como hacer fine-tuning de <a href="https://huggingface.co/distilbert/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,z,Q,W,p="Ahora, échale un vistazo a una muestra:",w,N,ms,L,ks="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.",us,P,ds,K,js,O,Es="Carga el tokenizer de DistilBERT para procesar los campos <code>question</code> (pregunta) y <code>context</code> (contexto):",ys,ss,fs,es,Bs="Hay algunos pasos de preprocesamiento específicos para la tarea de respuesta a preguntas que debes tener en cuenta:",hs,as,Xs=`<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>`,ws,ts,vs="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>:",Us,ls,Js,ns,Vs=`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:`,Ts,ps,gs,rs,zs="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).",$s,Y,Cs,os,bs,q,Is,H,_s,is,As,cs,Zs;return h=new Gs({props:{title:"Respuesta a preguntas",local:"respuesta-a-preguntas",headingTag:"h1"}}),A=new Hs({props:{id:"ajPx5LwJD-I"}}),_=new Rs({props:{$$slots:{default:[ae]},$$scope:{ctx:T}}}),X=new Gs({props:{title:"Carga el dataset SQuAD",local:"carga-el-dataset-squad",headingTag:"h2"}}),z=new k({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 k({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 Gs({props:{title:"Preprocesamiento",local:"preprocesamiento",headingTag:"h2"}}),K=new Hs({props:{id:"qgaM0weJHpA"}}),ss=new k({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0JTJGZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",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/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),ls=new k({props:{code:"ZGVmJTIwcHJlcHJvY2Vzc19mdW5jdGlvbihleGFtcGxlcyklM0ElMEElMjAlMjAlMjAlMjBxdWVzdGlvbnMlMjAlM0QlMjAlNUJxLnN0cmlwKCklMjBmb3IlMjBxJTIwaW4lMjBleGFtcGxlcyU1QiUyMnF1ZXN0a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TJCJTNEJTIwMSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHN0YXJ0X3Bvc2l0aW9ucy5hcHBlbmQoaWR4JTIwLSUyMDEpJTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaWR4JTIwJTNEJTIwY29udGV4dF9lbmQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB3aGlsZSUyMGlkeCUyMCUzRSUzRCUyMGNvbnRleHRfc3RhcnQlMjBhbmQlMjBvZmZzZXQlNUJpZHglNUQlNUIxJTVEJTIwJTNFJTNEJTIwZW5kX2NoYXIlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBpZHglMjAtJTNEJTIwMSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGVuZF9wb3NpdGlvbnMuYXBwZW5kKGlkeCUyMCUyQiUyMDEpJTBBJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTVCJTIyc3RhcnRfcG9zaXRpb25zJTIyJTVEJTIwJTNEJTIwc3RhcnRfcG9zaXRpb25zJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTVCJTIyZW5kX3Bvc2l0aW9ucyUyMiU1RCUyMCUzRCUyMGVuZF9wb3NpdGlvbnMlMEElMjAlMjAlMjAlMjByZXR1cm4lMjBpbnB1dHM=",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 k({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 Ss({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[pe],pytorch:[le]},$$scope:{ctx:T}}}),os=new Gs({props:{title:"Entrenamiento",local:"entrenamiento",headingTag:"h2"}}),q=new Ss({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[me],pytorch:[ie]},$$scope:{ctx:T}}}),H=new Rs({props:{$$slots:{default:[ue]},$$scope:{ctx:T}}}),is=new ee({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/es/tasks/question_answering.md"}}),{c(){e=U("meta"),r=M(),a=U("p"),o=M(),m(h.$$.fragment),C=M(),m(A.$$.fragment),b=M(),E=U("p"),E.textContent=B,I=M(),G=U("ul"),G.innerHTML=R,x=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(z.$$.fragment),Q=M(),W=U("p"),W.textContent=p,w=M(),m(N.$$.fragment),ms=M(),L=U("p"),L.innerHTML=ks,us=M(),m(P.$$.fragment),ds=M(),m(K.$$.fragment),js=M(),O=U("p"),O.innerHTML=Es,ys=M(),m(ss.$$.fragment),fs=M(),es=U("p"),es.textContent=Bs,hs=M(),as=U("ol"),as.innerHTML=Xs,ws=M(),ts=U("p"),ts.innerHTML=vs,Us=M(),m(ls.$$.fragment),Js=M(),ns=U("p"),ns.innerHTML=Vs,Ts=M(),m(ps.$$.fragment),gs=M(),rs=U("p"),rs.innerHTML=zs,$s=M(),m(Y.$$.fragment),Cs=M(),m(os.$$.fragment),bs=M(),m(q.$$.fragment),Is=M(),m(H.$$.fragment),_s=M(),m(is.$$.fragment),As=M(),cs=U("p"),this.h()},l(s){const l=Os("svelte-u9bgzb",document.head);e=J(l,"META",{name:!0,content:!0}),l.forEach(t),r=c(s),a=J(s,"P",{}),Ys(a).forEach(t),o=c(s),u(h.$$.fragment,s),C=c(s),u(A.$$.fragment,s),b=c(s),E=J(s,"P",{"data-svelte-h":!0}),$(E)!=="svelte-dwstrz"&&(E.textContent=B),I=c(s),G=J(s,"UL",{"data-svelte-h":!0}),$(G)!=="svelte-3bop09"&&(G.innerHTML=R),x=c(s),Z=J(s,"P",{"data-svelte-h":!0}),$(Z)!=="svelte-1kfpo64"&&(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(z.$$.fragment,s),Q=c(s),W=J(s,"P",{"data-svelte-h":!0}),$(W)!=="svelte-161h43k"&&(W.textContent=p),w=c(s),u(N.$$.fragment,s),ms=c(s),L=J(s,"P",{"data-svelte-h":!0}),$(L)!=="svelte-14mr2wr"&&(L.innerHTML=ks),us=c(s),u(P.$$.fragment,s),ds=c(s),u(K.$$.fragment,s),js=c(s),O=J(s,"P",{"data-svelte-h":!0}),$(O)!=="svelte-10ihzcv"&&(O.innerHTML=Es),ys=c(s),u(ss.$$.fragment,s),fs=c(s),es=J(s,"P",{"data-svelte-h":!0}),$(es)!=="svelte-1p9uuun"&&(es.textContent=Bs),hs=c(s),as=J(s,"OL",{"data-svelte-h":!0}),$(as)!=="svelte-1av8agk"&&(as.innerHTML=Xs),ws=c(s),ts=J(s,"P",{"data-svelte-h":!0}),$(ts)!=="svelte-x2vphs"&&(ts.innerHTML=vs),Us=c(s),u(ls.$$.fragment,s),Js=c(s),ns=J(s,"P",{"data-svelte-h":!0}),$(ns)!=="svelte-1eq69ea"&&(ns.innerHTML=Vs),Ts=c(s),u(ps.$$.fragment,s),gs=c(s),rs=J(s,"P",{"data-svelte-h":!0}),$(rs)!=="svelte-1w3gd6z"&&(rs.innerHTML=zs),$s=c(s),u(Y.$$.fragment,s),Cs=c(s),u(os.$$.fragment,s),bs=c(s),u(q.$$.fragment,s),Is=c(s),u(H.$$.fragment,s),_s=c(s),u(is.$$.fragment,s),As=c(s),cs=J(s,"P",{}),Ys(cs).forEach(t),this.h()},h(){qs(e,"name","hf:doc:metadata"),qs(e,"content",je)},m(s,l){se(document.head,e),n(s,r,l),n(s,a,l),n(s,o,l),d(h,s,l),n(s,C,l),d(A,s,l),n(s,b,l),n(s,E,l),n(s,I,l),n(s,G,l),n(s,x,l),n(s,Z,l),n(s,g,l),d(_,s,l),n(s,S,l),d(X,s,l),n(s,v,l),n(s,V,l),n(s,D,l),d(z,s,l),n(s,Q,l),n(s,W,l),n(s,w,l),d(N,s,l),n(s,ms,l),n(s,L,l),n(s,us,l),d(P,s,l),n(s,ds,l),d(K,s,l),n(s,js,l),n(s,O,l),n(s,ys,l),d(ss,s,l),n(s,fs,l),n(s,es,l),n(s,hs,l),n(s,as,l),n(s,ws,l),n(s,ts,l),n(s,Us,l),d(ls,s,l),n(s,Js,l),n(s,ns,l),n(s,Ts,l),d(ps,s,l),n(s,gs,l),n(s,rs,l),n(s,$s,l),d(Y,s,l),n(s,Cs,l),d(os,s,l),n(s,bs,l),d(q,s,l),n(s,Is,l),d(H,s,l),n(s,_s,l),d(is,s,l),n(s,As,l),n(s,cs,l),Zs=!0},p(s,[l]){const Qs={};l&2&&(Qs.$$scope={dirty:l,ctx:s}),_.$set(Qs);const Ws={};l&2&&(Ws.$$scope={dirty:l,ctx:s}),Y.$set(Ws);const Fs={};l&2&&(Fs.$$scope={dirty:l,ctx:s}),q.$set(Fs);const Ns={};l&2&&(Ns.$$scope={dirty:l,ctx:s}),H.$set(Ns)},i(s){Zs||(j(h.$$.fragment,s),j(A.$$.fragment,s),j(_.$$.fragment,s),j(X.$$.fragment,s),j(z.$$.fragment,s),j(N.$$.fragment,s),j(P.$$.fragment,s),j(K.$$.fragment,s),j(ss.$$.fragment,s),j(ls.$$.fragment,s),j(ps.$$.fragment,s),j(Y.$$.fragment,s),j(os.$$.fragment,s),j(q.$$.fragment,s),j(H.$$.fragment,s),j(is.$$.fragment,s),Zs=!0)},o(s){y(h.$$.fragment,s),y(A.$$.fragment,s),y(_.$$.fragment,s),y(X.$$.fragment,s),y(z.$$.fragment,s),y(N.$$.fragment,s),y(P.$$.fragment,s),y(K.$$.fragment,s),y(ss.$$.fragment,s),y(ls.$$.fragment,s),y(ps.$$.fragment,s),y(Y.$$.fragment,s),y(os.$$.fragment,s),y(q.$$.fragment,s),y(H.$$.fragment,s),y(is.$$.fragment,s),Zs=!1},d(s){s&&(t(r),t(a),t(o),t(C),t(b),t(E),t(I),t(G),t(x),t(Z),t(g),t(S),t(v),t(V),t(D),t(Q),t(W),t(w),t(ms),t(L),t(us),t(ds),t(js),t(O),t(ys),t(fs),t(es),t(hs),t(as),t(ws),t(ts),t(Us),t(Js),t(ns),t(Ts),t(gs),t(rs),t($s),t(Cs),t(bs),t(Is),t(_s),t(As),t(cs)),t(e),f(h,s),f(A,s),f(_,s),f(X,s),f(z,s),f(N,s),f(P,s),f(K,s),f(ss,s),f(ls,s),f(ps,s),f(Y,s),f(os,s),f(q,s),f(H,s),f(is,s)}}}const je='{"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 ye(T){return Ls(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $e extends Ps{constructor(e){super(),Ks(this,e,ye,de,Ds,{})}}export{$e as component};
