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 d,d as j,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 k}from"../chunks/CodeBlock.3ec784ea.js";import{F as Hs,M as Rs}from"../chunks/Markdown.7b58822e.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 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:is,i(a){r||(j(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 Rs({props:{$$slots:{default:[se]},$$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 ae(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:is,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 Rs({props:{$$slots:{default:[ae]},$$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 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,E="En este punto, solo quedan tres pasos:",B,I,R="<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>",G,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 Zs({props:{$$slots:{default:[te]},$$scope:{ctx:T}}}),x=new k({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=E,B=M(),I=U("ol"),I.innerHTML=R,G=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=R),G=c(i),u(x.$$.fragment,i)},m(i,g){p(i,e,g),p(i,a,g),d(o,i,g),p(i,h,g),d(C,i,g),p(i,A,g),p(i,b,g),p(i,B,g),p(i,I,g),p(i,G,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&&(l(e),l(a),l(h),l(A),l(b),l(B),l(I),l(G)),f(o,i),f(C,i),f(x,i)}}}function pe(T){let e,r;return e=new Rs({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 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,E="Prepara una función de optimización, un programa para la tasa de aprendizaje y algunos hiperparámetros de entrenamiento:",B,I,R,G,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 Zs({props:{$$slots:{default:[re]},$$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),R=M(),G=U("p"),G.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(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=E),B=c(t),u(I.$$.fragment,t),R=c(t),G=J(t,"P",{"data-svelte-h":!0}),$(G)!=="svelte-owfaiz"&&(G.innerHTML=x),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),z=c(t),u(Q.$$.fragment,t)},m(t,w){p(t,e,w),p(t,a,w),d(o,t,w),p(t,h,w),d(C,t,w),p(t,A,w),p(t,b,w),p(t,B,w),d(I,t,w),p(t,R,w),p(t,G,w),p(t,Z,w),d(i,t,w),p(t,g,w),p(t,_,w),p(t,X,w),d(v,t,w),p(t,V,w),p(t,F,w),p(t,z,w),d(Q,t,w),W=!0},p(t,w){const N={};w&2&&(N.$$scope={dirty:w,ctx:t}),C.$set(N)},i(t){W||(j(o.$$.fragment,t),j(C.$$.fragment,t),j(I.$$.fragment,t),j(i.$$.fragment,t),j(v.$$.fragment,t),j(Q.$$.fragment,t),W=!0)},o(t){y(o.$$.fragment,t),y(C.$$.fragment,t),y(I.$$.fragment,t),y(i.$$.fragment,t),y(v.$$.fragment,t),y(Q.$$.fragment,t),W=!1},d(t){t&&(l(e),l(a),l(h),l(A),l(b),l(B),l(R),l(G),l(Z),l(g),l(_),l(X),l(V),l(F),l(z)),f(o,t),f(C,t),f(I,t),f(i,t),f(v,t),f(Q,t)}}}function ie(T){let e,r;return e=new Rs({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 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,E,B="La respuesta a preguntas devuelve una respuesta a partir de una pregunta dada. Existen dos formas comunes de responder preguntas:",I,R,G="<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,t="Ahora, échale un vistazo a una muestra:",w,N,cs,L,Gs="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,ds,O,xs="Carga el tokenizer de DistilBERT para procesar los campos <code>question</code> (pregunta) y <code>context</code> (contexto):",js,ss,ys,es,ks="Hay algunos pasos de preprocesamiento específicos para la tarea de respuesta a preguntas que debes tener en cuenta:",fs,as,Es=`<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"}}),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 As({props:{title:"Preprocesamiento",local:"preprocesamiento",headingTag:"h2"}}),K=new Ys({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}}),ts=new k({props:{code:"ZGVmJTIwcHJlcHJvY2Vzc19mdW5jdGlvbihleGFtcGxlcyklM0ElMEElMjAlMjAlMjAlMjBxdWVzdGlvbnMlMjAlM0QlMjAlNUJxLnN0cmlwKCklMjBmb3IlMjBxJTIwaW4lMjBleGFtcGxlcyU1QiUyMnF1ZXN0aW9uJTIyJTVEJTVEJTBB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MCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHN0YXJ0X3Bvc2l0aW9ucy5hcHBlbmQoaWR4JTIwLSUyMDEpJTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaWR4JTIwJTNEJTIwY29udGV4dF9lbmQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB3aGlsZSUyMGlkeCUyMCUzRSUzRCUyMGNvbnRleHRfc3RhcnQlMjBhbmQlMjBvZmZzZXQlNUJpZHglNUQlNUIxJTVEJTIwJTNFJTNEJTIwZW5kX2NoYXIlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBpZHglMjAtJTNEJTIwMSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGVuZF9wb3NpdGlvbnMuYXBwZW5kKGlkeCUyMCUyQiUyMDEpJTBBJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTVCJTIyc3RhcnRfcG9zaXRpb25zJTIyJTVEJTIwJTNEJTIwc3RhcnRfcG9zaXRpb25zJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTVCJTIyZW5kX3Bvc2l0aW9ucyUyMiU1RCUyMCUzRCUyMGVuZF9wb3NpdGlvbnMlMEElMjAlMjAlMjAlMjByZXR1cm4lMjBpbnB1dHM=",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 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(),E=U("p"),E.textContent=B,I=M(),R=U("ul"),R.innerHTML=G,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=t,w=M(),m(N.$$.fragment),cs=M(),L=U("p"),L.innerHTML=Gs,ms=M(),m(P.$$.fragment),us=M(),m(K.$$.fragment),ds=M(),O=U("p"),O.innerHTML=xs,js=M(),m(ss.$$.fragment),ys=M(),es=U("p"),es.textContent=ks,fs=M(),as=U("ol"),as.innerHTML=Es,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),E=J(s,"P",{"data-svelte-h":!0}),$(E)!=="svelte-dwstrz"&&(E.textContent=B),I=c(s),R=J(s,"UL",{"data-svelte-h":!0}),$(R)!=="svelte-3bop09"&&(R.innerHTML=G),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=t),w=c(s),u(N.$$.fragment,s),cs=c(s),L=J(s,"P",{"data-svelte-h":!0}),$(L)!=="svelte-14mr2wr"&&(L.innerHTML=Gs),ms=c(s),u(P.$$.fragment,s),us=c(s),u(K.$$.fragment,s),ds=c(s),O=J(s,"P",{"data-svelte-h":!0}),$(O)!=="svelte-10ihzcv"&&(O.innerHTML=xs),js=c(s),u(ss.$$.fragment,s),ys=c(s),es=J(s,"P",{"data-svelte-h":!0}),$(es)!=="svelte-1p9uuun"&&(es.textContent=ks),fs=c(s),as=J(s,"OL",{"data-svelte-h":!0}),$(as)!=="svelte-1av8agk"&&(as.innerHTML=Es),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),d(h,s,n),p(s,C,n),d(A,s,n),p(s,b,n),p(s,E,n),p(s,I,n),p(s,R,n),p(s,x,n),p(s,Z,n),p(s,g,n),d(_,s,n),p(s,S,n),d(X,s,n),p(s,v,n),p(s,V,n),p(s,D,n),d(z,s,n),p(s,Q,n),p(s,W,n),p(s,w,n),d(N,s,n),p(s,cs,n),p(s,L,n),p(s,ms,n),d(P,s,n),p(s,us,n),d(K,s,n),p(s,ds,n),p(s,O,n),p(s,js,n),d(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),d(ts,s,n),p(s,Us,n),p(s,ns,n),p(s,Js,n),d(ps,s,n),p(s,Ts,n),p(s,rs,n),p(s,gs,n),d(Y,s,n),p(s,$s,n),d(os,s,n),p(s,Cs,n),d(H,s,n),p(s,bs,n),d(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 zs={};n&2&&(zs.$$scope={dirty:n,ctx:s}),Y.$set(zs);const Qs={};n&2&&(Qs.$$scope={dirty:n,ctx:s}),H.$set(Qs);const Ws={};n&2&&(Ws.$$scope={dirty:n,ctx:s}),q.$set(Ws)},i(s){_s||(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(ts.$$.fragment,s),j(ps.$$.fragment,s),j(Y.$$.fragment,s),j(os.$$.fragment,s),j(H.$$.fragment,s),j(q.$$.fragment,s),_s=!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(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(E),l(I),l(R),l(x),l(Z),l(g),l(S),l(v),l(V),l(D),l(Q),l(W),l(w),l(cs),l(L),l(ms),l(us),l(ds),l(O),l(js),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(z,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};
