import{S as os,i as ls,s as is,e as i,k as g,w as k,t as r,M as cs,c,d as a,m as $,a as p,x as S,h as o,b as w,G as t,g as m,y as z,q as C,o as x,B as T,v as ps,L as rs}from"../../chunks/vendor-hf-doc-builder.js";import{T as Bt}from"../../chunks/Tip-hf-doc-builder.js";import{Y as ms}from"../../chunks/Youtube-hf-doc-builder.js";import{I as Nt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as se}from"../../chunks/CodeBlock-hf-doc-builder.js";import{F as ns,M as Ut}from"../../chunks/Markdown-hf-doc-builder.js";import"../../chunks/IconTensorflow-hf-doc-builder.js";function fs(P){let s,u,n,h,b;return{c(){s=i("p"),u=r("Consulta la "),n=i("a"),h=r("p\xE1gina de la tarea"),b=r(" de generaci\xF3n de res\xFAmenes para obtener m\xE1s informaci\xF3n sobre sus modelos, datasets y m\xE9tricas asociadas."),this.h()},l(_){s=c(_,"P",{});var q=p(s);u=o(q,"Consulta la "),n=c(q,"A",{href:!0,rel:!0});var A=p(n);h=o(A,"p\xE1gina de la tarea"),A.forEach(a),b=o(q," de generaci\xF3n de res\xFAmenes para obtener m\xE1s informaci\xF3n sobre sus modelos, datasets y m\xE9tricas asociadas."),q.forEach(a),this.h()},h(){w(n,"href","https://huggingface.co/tasks/summarization"),w(n,"rel","nofollow")},m(_,q){m(_,s,q),t(s,u),t(s,n),t(n,h),t(s,b)},d(_){_&&a(s)}}}function us(P){let s,u;return s=new se({props:{code:`from transformers import DataCollatorForSeq2Seq

data_collator = DataCollatorForSeq2Seq(tokenizer=tokenizer, model=model)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForSeq2Seq

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForSeq2Seq(tokenizer=tokenizer, model=model)`}}),{c(){k(s.$$.fragment)},l(n){S(s.$$.fragment,n)},m(n,h){z(s,n,h),u=!0},p:rs,i(n){u||(C(s.$$.fragment,n),u=!0)},o(n){x(s.$$.fragment,n),u=!1},d(n){T(s,n)}}}function ds(P){let s,u;return s=new Ut({props:{$$slots:{default:[us]},$$scope:{ctx:P}}}),{c(){k(s.$$.fragment)},l(n){S(s.$$.fragment,n)},m(n,h){z(s,n,h),u=!0},p(n,h){const b={};h&2&&(b.$$scope={dirty:h,ctx:n}),s.$set(b)},i(n){u||(C(s.$$.fragment,n),u=!0)},o(n){x(s.$$.fragment,n),u=!1},d(n){T(s,n)}}}function hs(P){let s,u;return s=new se({props:{code:`from transformers import DataCollatorForSeq2Seq

data_collator = DataCollatorForSeq2Seq(tokenizer=tokenizer, model=model, return_tensors="tf")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForSeq2Seq

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForSeq2Seq(tokenizer=tokenizer, model=model, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`}}),{c(){k(s.$$.fragment)},l(n){S(s.$$.fragment,n)},m(n,h){z(s,n,h),u=!0},p:rs,i(n){u||(C(s.$$.fragment,n),u=!0)},o(n){x(s.$$.fragment,n),u=!1},d(n){T(s,n)}}}function gs(P){let s,u;return s=new Ut({props:{$$slots:{default:[hs]},$$scope:{ctx:P}}}),{c(){k(s.$$.fragment)},l(n){S(s.$$.fragment,n)},m(n,h){z(s,n,h),u=!0},p(n,h){const b={};h&2&&(b.$$scope={dirty:h,ctx:n}),s.$set(b)},i(n){u||(C(s.$$.fragment,n),u=!0)},o(n){x(s.$$.fragment,n),u=!1},d(n){T(s,n)}}}function $s(P){let s,u,n,h,b,_,q,A;return{c(){s=i("p"),u=r("Para familiarizarte con el proceso para realizar fine-tuning sobre un modelo con "),n=i("code"),h=r("Trainer"),b=r(", \xA1mira el tutorial b\xE1sico "),_=i("a"),q=r("aqu\xED"),A=r("!"),this.h()},l(j){s=c(j,"P",{});var y=p(s);u=o(y,"Para familiarizarte con el proceso para realizar fine-tuning sobre un modelo con "),n=c(y,"CODE",{});var D=p(n);h=o(D,"Trainer"),D.forEach(a),b=o(y,", \xA1mira el tutorial b\xE1sico "),_=c(y,"A",{href:!0});var N=p(_);q=o(N,"aqu\xED"),N.forEach(a),A=o(y,"!"),y.forEach(a),this.h()},h(){w(_,"href","../training#finetune-with-trainer")},m(j,y){m(j,s,y),t(s,u),t(s,n),t(n,h),t(s,b),t(s,_),t(_,q),t(s,A)},d(j){j&&a(s)}}}function _s(P){let s,u,n,h,b,_,q,A,j,y,D,N,B,U,F,K,H,he,pe,X,Q,Y,I,oe,ee,ge,V,G,ne,Z,me,L,W,J;return q=new se({props:{code:`from transformers import AutoModelForSeq2SeqLM, Seq2SeqTrainingArguments, Seq2SeqTrainer

model = AutoModelForSeq2SeqLM.from_pretrained("t5-small")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM, Seq2SeqTrainingArguments, Seq2SeqTrainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)`}}),j=new Bt({props:{$$slots:{default:[$s]},$$scope:{ctx:P}}}),W=new se({props:{code:`training_args = Seq2SeqTrainingArguments(
    output_dir="./results",
    evaluation_strategy="epoch",
    learning_rate=2e-5,
    per_device_train_batch_size=16,
    per_device_eval_batch_size=16,
    weight_decay=0.01,
    save_total_limit=3,
    num_train_epochs=1,
    fp16=True,
)

trainer = Seq2SeqTrainer(
    model=model,
    args=training_args,
    train_dataset=tokenized_billsum["train"],
    eval_dataset=tokenized_billsum["test"],
    tokenizer=tokenizer,
    data_collator=data_collator,
)

trainer.train()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = Seq2SeqTrainingArguments(
<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>    weight_decay=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>    save_total_limit=<span class="hljs-number">3</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    fp16=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Seq2SeqTrainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=tokenized_billsum[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=tokenized_billsum[<span class="hljs-string">&quot;test&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()`}}),{c(){s=i("p"),u=r("Carga T5 con "),n=i("code"),h=r("AutoModelForSeq2SeqLM"),b=r(":"),_=g(),k(q.$$.fragment),A=g(),k(j.$$.fragment),y=g(),D=i("p"),N=r("En este punto, solo faltan tres pasos:"),B=g(),U=i("ol"),F=i("li"),K=r("Definir tus hiperpar\xE1metros de entrenamiento en "),H=i("code"),he=r("Seq2SeqTrainingArguments"),pe=r("."),X=g(),Q=i("li"),Y=r("Pasarle los argumentos de entrenamiento a "),I=i("code"),oe=r("Seq2SeqTrainer"),ee=r(" junto con el modelo, dataset y data collator."),ge=g(),V=i("li"),G=r("Llamar "),ne=i("code"),Z=r("train()"),me=r(" para realizar el fine-tuning sobre tu modelo."),L=g(),k(W.$$.fragment)},l(d){s=c(d,"P",{});var E=p(s);u=o(E,"Carga T5 con "),n=c(E,"CODE",{});var M=p(n);h=o(M,"AutoModelForSeq2SeqLM"),M.forEach(a),b=o(E,":"),E.forEach(a),_=$(d),S(q.$$.fragment,d),A=$(d),S(j.$$.fragment,d),y=$(d),D=c(d,"P",{});var $e=p(D);N=o($e,"En este punto, solo faltan tres pasos:"),$e.forEach(a),B=$(d),U=c(d,"OL",{});var O=p(U);F=c(O,"LI",{});var fe=p(F);K=o(fe,"Definir tus hiperpar\xE1metros de entrenamiento en "),H=c(fe,"CODE",{});var te=p(H);he=o(te,"Seq2SeqTrainingArguments"),te.forEach(a),pe=o(fe,"."),fe.forEach(a),X=$(O),Q=c(O,"LI",{});var R=p(Q);Y=o(R,"Pasarle los argumentos de entrenamiento a "),I=c(R,"CODE",{});var be=p(I);oe=o(be,"Seq2SeqTrainer"),be.forEach(a),ee=o(R," junto con el modelo, dataset y data collator."),R.forEach(a),ge=$(O),V=c(O,"LI",{});var le=p(V);G=o(le,"Llamar "),ne=c(le,"CODE",{});var ae=p(ne);Z=o(ae,"train()"),ae.forEach(a),me=o(le," para realizar el fine-tuning sobre tu modelo."),le.forEach(a),O.forEach(a),L=$(d),S(W.$$.fragment,d)},m(d,E){m(d,s,E),t(s,u),t(s,n),t(n,h),t(s,b),m(d,_,E),z(q,d,E),m(d,A,E),z(j,d,E),m(d,y,E),m(d,D,E),t(D,N),m(d,B,E),m(d,U,E),t(U,F),t(F,K),t(F,H),t(H,he),t(F,pe),t(U,X),t(U,Q),t(Q,Y),t(Q,I),t(I,oe),t(Q,ee),t(U,ge),t(U,V),t(V,G),t(V,ne),t(ne,Z),t(V,me),m(d,L,E),z(W,d,E),J=!0},p(d,E){const M={};E&2&&(M.$$scope={dirty:E,ctx:d}),j.$set(M)},i(d){J||(C(q.$$.fragment,d),C(j.$$.fragment,d),C(W.$$.fragment,d),J=!0)},o(d){x(q.$$.fragment,d),x(j.$$.fragment,d),x(W.$$.fragment,d),J=!1},d(d){d&&a(s),d&&a(_),T(q,d),d&&a(A),T(j,d),d&&a(y),d&&a(D),d&&a(B),d&&a(U),d&&a(L),T(W,d)}}}function bs(P){let s,u;return s=new Ut({props:{$$slots:{default:[_s]},$$scope:{ctx:P}}}),{c(){k(s.$$.fragment)},l(n){S(s.$$.fragment,n)},m(n,h){z(s,n,h),u=!0},p(n,h){const b={};h&2&&(b.$$scope={dirty:h,ctx:n}),s.$set(b)},i(n){u||(C(s.$$.fragment,n),u=!0)},o(n){x(s.$$.fragment,n),u=!1},d(n){T(s,n)}}}function vs(P){let s,u,n,h,b;return{c(){s=i("p"),u=r("Para familiarizarte con el fine-tuning con Keras, \xA1mira el tutorial b\xE1sico "),n=i("a"),h=r("aqu\xED"),b=r("!"),this.h()},l(_){s=c(_,"P",{});var q=p(s);u=o(q,"Para familiarizarte con el fine-tuning con Keras, \xA1mira el tutorial b\xE1sico "),n=c(q,"A",{href:!0});var A=p(n);h=o(A,"aqu\xED"),A.forEach(a),b=o(q,"!"),q.forEach(a),this.h()},h(){w(n,"href","training#finetune-with-keras")},m(_,q){m(_,s,q),t(s,u),t(s,n),t(n,h),t(s,b)},d(_){_&&a(s)}}}function qs(P){let s,u,n,h,b,_,q,A,j,y,D,N,B,U,F,K,H,he,pe,X,Q,Y,I,oe,ee,ge,V,G,ne,Z,me,L,W,J,d,E,M,$e,O,fe,te,R,be,le,ae,ue,_e;return B=new se({props:{code:`tf_train_set = tokenized_billsum["train"].to_tf_dataset(
    columns=["attention_mask", "input_ids", "labels"],
    shuffle=True,
    batch_size=16,
    collate_fn=data_collator,
)

tf_test_set = tokenized_billsum["test"].to_tf_dataset(
    columns=["attention_mask", "input_ids", "labels"],
    shuffle=False,
    batch_size=16,
    collate_fn=data_collator,
)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = tokenized_billsum[<span class="hljs-string">&quot;train&quot;</span>].to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&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_test_set = tokenized_billsum[<span class="hljs-string">&quot;test&quot;</span>].to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&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>)`}}),F=new Bt({props:{$$slots:{default:[vs]},$$scope:{ctx:P}}}),X=new se({props:{code:`from transformers import create_optimizer, AdamWeightDecay

optimizer = AdamWeightDecay(learning_rate=2e-5, weight_decay_rate=0.01)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer, AdamWeightDecay

<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer = AdamWeightDecay(learning_rate=<span class="hljs-number">2e-5</span>, weight_decay_rate=<span class="hljs-number">0.01</span>)`}}),G=new se({props:{code:`from transformers import TFAutoModelForSeq2SeqLM

model = TFAutoModelForSeq2SeqLM.from_pretrained("t5-small")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSeq2SeqLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)`}}),M=new se({props:{code:"model.compile(optimizer=optimizer)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)'}}),ue=new se({props:{code:"model.fit(x=tf_train_set, validation_data=tf_test_set, epochs=3)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_test_set, epochs=<span class="hljs-number">3</span>)'}}),{c(){s=i("p"),u=r("Para hacer fine-tuning de un modelo en TensorFlow, comienza por convertir tus datasets al formato "),n=i("code"),h=r("tf.data.Dataset"),b=r(" con "),_=i("code"),q=r("to_tf_dataset"),A=r(". Especifica los inputs y etiquetas en "),j=i("code"),y=r("columns"),D=r(", el tama\xF1o de lote, el data collator, y si es necesario mezclar el dataset:"),N=g(),k(B.$$.fragment),U=g(),k(F.$$.fragment),K=g(),H=i("p"),he=r("Crea la funci\xF3n optimizadora, establece la tasa de aprendizaje y algunos hiperpar\xE1metros de entrenamiento:"),pe=g(),k(X.$$.fragment),Q=g(),Y=i("p"),I=r("Carga T5 con "),oe=i("code"),ee=r("TFAutoModelForSeq2SeqLM"),ge=r(":"),V=g(),k(G.$$.fragment),ne=g(),Z=i("p"),me=r("Configura el modelo para entrenamiento con "),L=i("a"),W=i("code"),J=r("compile"),d=r(":"),E=g(),k(M.$$.fragment),$e=g(),O=i("p"),fe=r("Llama a "),te=i("a"),R=i("code"),be=r("fit"),le=r(" para realizar el fine-tuning del modelo:"),ae=g(),k(ue.$$.fragment),this.h()},l(l){s=c(l,"P",{});var v=p(s);u=o(v,"Para hacer fine-tuning de un modelo en TensorFlow, comienza por convertir tus datasets al formato "),n=c(v,"CODE",{});var ie=p(n);h=o(ie,"tf.data.Dataset"),ie.forEach(a),b=o(v," con "),_=c(v,"CODE",{});var Le=p(_);q=o(Le,"to_tf_dataset"),Le.forEach(a),A=o(v,". Especifica los inputs y etiquetas en "),j=c(v,"CODE",{});var Ee=p(j);y=o(Ee,"columns"),Ee.forEach(a),D=o(v,", el tama\xF1o de lote, el data collator, y si es necesario mezclar el dataset:"),v.forEach(a),N=$(l),S(B.$$.fragment,l),U=$(l),S(F.$$.fragment,l),K=$(l),H=c(l,"P",{});var We=p(H);he=o(We,"Crea la funci\xF3n optimizadora, establece la tasa de aprendizaje y algunos hiperpar\xE1metros de entrenamiento:"),We.forEach(a),pe=$(l),S(X.$$.fragment,l),Q=$(l),Y=c(l,"P",{});var ke=p(Y);I=o(ke,"Carga T5 con "),oe=c(ke,"CODE",{});var ve=p(oe);ee=o(ve,"TFAutoModelForSeq2SeqLM"),ve.forEach(a),ge=o(ke,":"),ke.forEach(a),V=$(l),S(G.$$.fragment,l),ne=$(l),Z=c(l,"P",{});var Se=p(Z);me=o(Se,"Configura el modelo para entrenamiento con "),L=c(Se,"A",{href:!0,rel:!0});var ce=p(L);W=c(ce,"CODE",{});var Je=p(W);J=o(Je,"compile"),Je.forEach(a),ce.forEach(a),d=o(Se,":"),Se.forEach(a),E=$(l),S(M.$$.fragment,l),$e=$(l),O=c(l,"P",{});var qe=p(O);fe=o(qe,"Llama a "),te=c(qe,"A",{href:!0,rel:!0});var Ke=p(te);R=c(Ke,"CODE",{});var Xe=p(R);be=o(Xe,"fit"),Xe.forEach(a),Ke.forEach(a),le=o(qe," para realizar el fine-tuning del modelo:"),qe.forEach(a),ae=$(l),S(ue.$$.fragment,l),this.h()},h(){w(L,"href","https://keras.io/api/models/model_training_apis/#compile-method"),w(L,"rel","nofollow"),w(te,"href","https://keras.io/api/models/model_training_apis/#fit-method"),w(te,"rel","nofollow")},m(l,v){m(l,s,v),t(s,u),t(s,n),t(n,h),t(s,b),t(s,_),t(_,q),t(s,A),t(s,j),t(j,y),t(s,D),m(l,N,v),z(B,l,v),m(l,U,v),z(F,l,v),m(l,K,v),m(l,H,v),t(H,he),m(l,pe,v),z(X,l,v),m(l,Q,v),m(l,Y,v),t(Y,I),t(Y,oe),t(oe,ee),t(Y,ge),m(l,V,v),z(G,l,v),m(l,ne,v),m(l,Z,v),t(Z,me),t(Z,L),t(L,W),t(W,J),t(Z,d),m(l,E,v),z(M,l,v),m(l,$e,v),m(l,O,v),t(O,fe),t(O,te),t(te,R),t(R,be),t(O,le),m(l,ae,v),z(ue,l,v),_e=!0},p(l,v){const ie={};v&2&&(ie.$$scope={dirty:v,ctx:l}),F.$set(ie)},i(l){_e||(C(B.$$.fragment,l),C(F.$$.fragment,l),C(X.$$.fragment,l),C(G.$$.fragment,l),C(M.$$.fragment,l),C(ue.$$.fragment,l),_e=!0)},o(l){x(B.$$.fragment,l),x(F.$$.fragment,l),x(X.$$.fragment,l),x(G.$$.fragment,l),x(M.$$.fragment,l),x(ue.$$.fragment,l),_e=!1},d(l){l&&a(s),l&&a(N),T(B,l),l&&a(U),T(F,l),l&&a(K),l&&a(H),l&&a(pe),T(X,l),l&&a(Q),l&&a(Y),l&&a(V),T(G,l),l&&a(ne),l&&a(Z),l&&a(E),T(M,l),l&&a($e),l&&a(O),l&&a(ae),T(ue,l)}}}function ws(P){let s,u;return s=new Ut({props:{$$slots:{default:[qs]},$$scope:{ctx:P}}}),{c(){k(s.$$.fragment)},l(n){S(s.$$.fragment,n)},m(n,h){z(s,n,h),u=!0},p(n,h){const b={};h&2&&(b.$$scope={dirty:h,ctx:n}),s.$set(b)},i(n){u||(C(s.$$.fragment,n),u=!0)},o(n){x(s.$$.fragment,n),u=!1},d(n){T(s,n)}}}function ys(P){let s,u,n,h,b,_,q,A;return{c(){s=i("p"),u=r(`Para un ejemplo con mayor profundidad de c\xF3mo hacer fine-tuning a un modelo para generaci\xF3n de res\xFAmenes, revisa la
`),n=i("a"),h=r("notebook en PyTorch"),b=r(`
o a la `),_=i("a"),q=r("notebook en TensorFlow"),A=r("."),this.h()},l(j){s=c(j,"P",{});var y=p(s);u=o(y,`Para un ejemplo con mayor profundidad de c\xF3mo hacer fine-tuning a un modelo para generaci\xF3n de res\xFAmenes, revisa la
`),n=c(y,"A",{href:!0,rel:!0});var D=p(n);h=o(D,"notebook en PyTorch"),D.forEach(a),b=o(y,`
o a la `),_=c(y,"A",{href:!0,rel:!0});var N=p(_);q=o(N,"notebook en TensorFlow"),N.forEach(a),A=o(y,"."),y.forEach(a),this.h()},h(){w(n,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization.ipynb"),w(n,"rel","nofollow"),w(_,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization-tf.ipynb"),w(_,"rel","nofollow")},m(j,y){m(j,s,y),t(s,u),t(s,n),t(n,h),t(s,b),t(s,_),t(_,q),t(s,A)},d(j){j&&a(s)}}}function js(P){let s,u,n,h,b,_,q,A,j,y,D,N,B,U,F,K,H,he,pe,X,Q,Y,I,oe,ee,ge,V,G,ne,Z,me,L,W,J,d,E,M,$e,O,fe,te,R,be,le,ae,ue,_e,l,v,ie,Le,Ee,We,ke,ve,Se,ce,Je,qe,Ke,Xe,et,Gt,Ht,vt,ze,xe,tt,Me,Wt,at,Jt,qt,we,Kt,st,Xt,Yt,nt,Rt,Qt,wt,Oe,yt,Ye,Vt,jt,ye,rt,Zt,ea,Ie,ta,ot,aa,sa,na,Ne,ra,lt,oa,la,Et,Be,kt,de,ia,it,ca,pa,ct,ma,fa,pt,ua,da,St,Ue,zt,re,ha,mt,ga,$a,ft,_a,ba,ut,va,qa,dt,wa,ya,Ct,Te,xt,Ce,Ae,ht,Ge,ja,gt,Ea,Tt,Pe,At,De,Pt;return _=new Nt({}),D=new ms({props:{id:"yHnr5Dk2zCI"}}),L=new Bt({props:{$$slots:{default:[fs]},$$scope:{ctx:P}}}),M=new Nt({}),ae=new se({props:{code:`from datasets import load_dataset

billsum = load_dataset("billsum", split="ca_test")`,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>billsum = load_dataset(<span class="hljs-string">&quot;billsum&quot;</span>, split=<span class="hljs-string">&quot;ca_test&quot;</span>)`}}),ie=new se({props:{code:"billsum = billsum.train_test_split(test_size=0.2)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>billsum = billsum.train_test_split(test_size=<span class="hljs-number">0.2</span>)'}}),ve=new se({props:{code:'billsum["train"][0]',highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>billsum[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;summary&#x27;</span>: <span class="hljs-string">&#x27;Existing law authorizes state agencies to enter into contracts for the acquisition of goods or services upon approval by the Department of General Services. Existing law sets forth various requirements and prohibitions for those contracts, including, but not limited to, a prohibition on entering into contracts for the acquisition of goods or services of $100,000 or more with a contractor that discriminates between spouses and domestic partners or same-sex and different-sex couples in the provision of benefits. Existing law provides that a contract entered into in violation of those requirements and prohibitions is void and authorizes the state or any person acting on behalf of the state to bring a civil action seeking a determination that a contract is in violation and therefore void. Under existing law, a willful violation of those requirements and prohibitions is a misdemeanor.\\nThis bill would also prohibit a state agency from entering into contracts for the acquisition of goods or services of $100,000 or more with a contractor that discriminates between employees on the basis of gender identity in the provision of benefits, as specified. By expanding the scope of a crime, this bill would impose a state-mandated local program.\\nThe California Constitution requires the state to reimburse local agencies and school districts for certain costs mandated by the state. Statutory provisions establish procedures for making that reimbursement.\\nThis bill would provide that no reimbursement is required by this act for a specified reason.&#x27;</span>,
 <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;The people of the State of California do enact as follows:\\n\\n\\nSECTION 1.\\nSection 10295.35 is added to the Public Contract Code, to read:\\n10295.35.\\n(a) (1) Notwithstanding any other law, a state agency shall not enter into any contract for the acquisition of goods or services in the amount of one hundred thousand dollars ($100,000) or more with a contractor that, in the provision of benefits, discriminates between employees on the basis of an employee\u2019s or dependent\u2019s actual or perceived gender identity, including, but not limited to, the employee\u2019s or dependent\u2019s identification as transgender.\\n(2) For purposes of this section, \u201Ccontract\u201D includes contracts with a cumulative amount of one hundred thousand dollars ($100,000) or more per contractor in each fiscal year.\\n(3) For purposes of this section, an employee health plan is discriminatory if the plan is not consistent with Section 1365.5 of the Health and Safety Code and Section 10140 of the Insurance Code.\\n(4) The requirements of this section shall apply only to those portions of a contractor\u2019s operations that occur under any of the following conditions:\\n(A) Within the state.\\n(B) On real property outside the state if the property is owned by the state or if the state has a right to occupy the property, and if the contractor\u2019s presence at that location is connected to a contract with the state.\\n(C) Elsewhere in the United States where work related to a state contract is being performed.\\n(b) Contractors shall treat as confidential, to the maximum extent allowed by law or by the requirement of the contractor\u2019s insurance provider, any request by an employee or applicant for employment benefits or any documentation of eligibility for benefits submitted by an employee or applicant for employment.\\n(c) After taking all reasonable measures to find a contractor that complies with this section, as determined by the state agency, the requirements of this section may be waived under any of the following circumstances:\\n(1) There is only one prospective contractor willing to enter into a specific contract with the state agency.\\n(2) The contract is necessary to respond to an emergency, as determined by the state agency, that endangers the public health, welfare, or safety, or the contract is necessary for the provision of essential services, and no entity that complies with the requirements of this section capable of responding to the emergency is immediately available.\\n(3) The requirements of this section violate, or are inconsistent with, the terms or conditions of a grant, subvention, or agreement, if the agency has made a good faith attempt to change the terms or conditions of any grant, subvention, or agreement to authorize application of this section.\\n(4) The contractor is providing wholesale or bulk water, power, or natural gas, the conveyance or transmission of the same, or ancillary services, as required for ensuring reliable services in accordance with good utility practice, if the purchase of the same cannot practically be accomplished through the standard competitive bidding procedures and the contractor is not providing direct retail services to end users.\\n(d) (1) A contractor shall not be deemed to discriminate in the provision of benefits if the contractor, in providing the benefits, pays the actual costs incurred in obtaining the benefit.\\n(2) If a contractor is unable to provide a certain benefit, despite taking reasonable measures to do so, the contractor shall not be deemed to discriminate in the provision of benefits.\\n(e) (1) Every contract subject to this chapter shall contain a statement by which the contractor certifies that the contractor is in compliance with this section.\\n(2) The department or other contracting agency shall enforce this section pursuant to its existing enforcement powers.\\n(3) (A) If a contractor falsely certifies that it is in compliance with this section, the contract with that contractor shall be subject to Article 9 (commencing with Section 10420), unless, within a time period specified by the department or other contracting agency, the contractor provides to the department or agency proof that it has complied, or is in the process of complying, with this section.\\n(B) The application of the remedies or penalties contained in Article 9 (commencing with Section 10420) to a contract subject to this chapter shall not preclude the application of any existing remedies otherwise available to the department or other contracting agency under its existing enforcement powers.\\n(f) Nothing in this section is intended to regulate the contracting practices of any local jurisdiction.\\n(g) This section shall be construed so as not to conflict with applicable federal laws, rules, or regulations. In the event that a court or agency of competent jurisdiction holds that federal law, rule, or regulation invalidates any clause, sentence, paragraph, or section of this code or the application thereof to any person or circumstances, it is the intent of the state that the court or agency sever that clause, sentence, paragraph, or section so that the remainder of this section shall remain in effect.\\nSEC. 2.\\nSection 10295.35 of the Public Contract Code shall not be construed to create any new enforcement authority or responsibility in the Department of General Services or any other contracting agency.\\nSEC. 3.\\nNo reimbursement is required by this act pursuant to Section 6 of Article XIII\\u2009B of the California Constitution because the only costs that may be incurred by a local agency or school district will be incurred because this act creates a new crime or infraction, eliminates a crime or infraction, or changes the penalty for a crime or infraction, within the meaning of Section 17556 of the Government Code, or changes the definition of a crime within the meaning of Section 6 of Article XIII\\u2009B of the California Constitution.&#x27;</span>,
 <span class="hljs-string">&#x27;title&#x27;</span>: <span class="hljs-string">&#x27;An act to add Section 10295.35 to the Public Contract Code, relating to public contracts.&#x27;</span>}`}}),Me=new Nt({}),Oe=new se({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("t5-small")`,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;t5-small&quot;</span>)`}}),Be=new se({props:{code:`prefix = "summarize: "


def preprocess_function(examples):
    inputs = [prefix + doc for doc in examples["text"]]
    model_inputs = tokenizer(inputs, max_length=1024, truncation=True)

    labels = tokenizer(text_target=examples["summary"], max_length=128, truncation=True)

    model_inputs["labels"] = labels["input_ids"]
    return model_inputs`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>prefix = <span class="hljs-string">&quot;summarize: &quot;</span>


<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>    inputs = [prefix + doc <span class="hljs-keyword">for</span> doc <span class="hljs-keyword">in</span> examples[<span class="hljs-string">&quot;text&quot;</span>]]
<span class="hljs-meta">... </span>    model_inputs = tokenizer(inputs, max_length=<span class="hljs-number">1024</span>, truncation=<span class="hljs-literal">True</span>)

<span class="hljs-meta">... </span>    labels = tokenizer(text_target=examples[<span class="hljs-string">&quot;summary&quot;</span>], max_length=<span class="hljs-number">128</span>, truncation=<span class="hljs-literal">True</span>)

<span class="hljs-meta">... </span>    model_inputs[<span class="hljs-string">&quot;labels&quot;</span>] = labels[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> model_inputs`}}),Ue=new se({props:{code:"tokenized_billsum = billsum.map(preprocess_function, batched=True)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_billsum = billsum.<span class="hljs-built_in">map</span>(preprocess_function, batched=<span class="hljs-literal">True</span>)'}}),Te=new ns({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[gs],pytorch:[ds]},$$scope:{ctx:P}}}),Ge=new Nt({}),Pe=new ns({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ws],pytorch:[bs]},$$scope:{ctx:P}}}),De=new Bt({props:{$$slots:{default:[ys]},$$scope:{ctx:P}}}),{c(){s=i("meta"),u=g(),n=i("h1"),h=i("a"),b=i("span"),k(_.$$.fragment),q=g(),A=i("span"),j=r("Generaci\xF3n de res\xFAmenes"),y=g(),k(D.$$.fragment),N=g(),B=i("p"),U=r("La generaci\xF3n de res\xFAmenes (summarization, en ingl\xE9s) crea una versi\xF3n m\xE1s corta de un documento o un art\xEDculo que resume toda su informaci\xF3n importante. Junto con la traducci\xF3n, es un ejemplo de una tarea que puede ser formulada como una tarea secuencia a secuencia. La generaci\xF3n de res\xFAmenes puede ser:"),F=g(),K=i("ul"),H=i("li"),he=r("Extractiva: Extrae la informaci\xF3n m\xE1s relevante de un documento."),pe=g(),X=i("li"),Q=r("Abstractiva: Genera un texto nuevo que captura la informaci\xF3n m\xE1s importante."),Y=g(),I=i("p"),oe=r("Esta gu\xEDa te mostrar\xE1 c\xF3mo puedes hacer fine-tuning del modelo "),ee=i("a"),ge=r("T5"),V=r(" sobre el subset de proyectos de ley del estado de California, dentro del dataset "),G=i("a"),ne=r("BillSum"),Z=r(" para hacer generaci\xF3n de res\xFAmenes abstractiva."),me=g(),k(L.$$.fragment),W=g(),J=i("h2"),d=i("a"),E=i("span"),k(M.$$.fragment),$e=g(),O=i("span"),fe=r("Carga el dataset BillSum"),te=g(),R=i("p"),be=r("Carga el dataset BillSum de la biblioteca \u{1F917} Datasets:"),le=g(),k(ae.$$.fragment),ue=g(),_e=i("p"),l=r("Divide el dataset en un set de train y un set de test:"),v=g(),k(ie.$$.fragment),Le=g(),Ee=i("p"),We=r("A continuaci\xF3n, observa un ejemplo:"),ke=g(),k(ve.$$.fragment),Se=g(),ce=i("p"),Je=r("El campo "),qe=i("code"),Ke=r("text"),Xe=r(" es el input y el campo "),et=i("code"),Gt=r("summary"),Ht=r(" es el objetivo."),vt=g(),ze=i("h2"),xe=i("a"),tt=i("span"),k(Me.$$.fragment),Wt=g(),at=i("span"),Jt=r("Preprocesa"),qt=g(),we=i("p"),Kt=r("Carga el tokenizador T5 para procesar "),st=i("code"),Xt=r("text"),Yt=r(" y "),nt=i("code"),Rt=r("summary"),Qt=r(":"),wt=g(),k(Oe.$$.fragment),yt=g(),Ye=i("p"),Vt=r("La funci\xF3n de preprocesamiento necesita:"),jt=g(),ye=i("ol"),rt=i("li"),Zt=r("Agregar un prefijo al input; una clave para que T5 sepa que se trata de una tarea de generaci\xF3n de res\xFAmenes. Algunos modelos capaces de realizar m\xFAltiples tareas de NLP requieren una clave que indique la tarea espec\xEDfica."),ea=g(),Ie=i("li"),ta=r("Usar el argumento "),ot=i("code"),aa=r("text_target"),sa=r(" para tokenizar etiquetas."),na=g(),Ne=i("li"),ra=r("Truncar secuencias para que no sean m\xE1s largas que la longitud m\xE1xima fijada por el par\xE1metro "),lt=i("code"),oa=r("max_length"),la=r("."),Et=g(),k(Be.$$.fragment),kt=g(),de=i("p"),ia=r("Usa la funci\xF3n "),it=i("code"),ca=r("map"),pa=r(" de \u{1F917} Datasets para aplicar la funci\xF3n de preprocesamiento sobre el dataset en su totalidad. Puedes acelerar la funci\xF3n "),ct=i("code"),ma=r("map"),fa=r(" configurando el argumento "),pt=i("code"),ua=r("batched=True"),da=r(" para procesar m\xFAltiples elementos del dataset a la vez:"),St=g(),k(Ue.$$.fragment),zt=g(),re=i("p"),ha=r("Usa "),mt=i("code"),ga=r("DataCollatorForSeq2Seq"),$a=r(" para crear un lote de ejemplos. Esto tambi\xE9n "),ft=i("em"),_a=r("rellenar\xE1 din\xE1micamente"),ba=r(" tu texto y etiquetas a la dimensi\xF3n del elemento m\xE1s largo del lote para que tengan un largo uniforme. Si bien es posible rellenar tu texto en la funci\xF3n "),ut=i("code"),va=r("tokenizer"),qa=r(" mediante el argumento "),dt=i("code"),wa=r("padding=True"),ya=r(", el rellenado din\xE1mico es m\xE1s eficiente."),Ct=g(),k(Te.$$.fragment),xt=g(),Ce=i("h2"),Ae=i("a"),ht=i("span"),k(Ge.$$.fragment),ja=g(),gt=i("span"),Ea=r("Entrenamiento"),Tt=g(),k(Pe.$$.fragment),At=g(),k(De.$$.fragment),this.h()},l(e){const f=cs('[data-svelte="svelte-1phssyn"]',document.head);s=c(f,"META",{name:!0,content:!0}),f.forEach(a),u=$(e),n=c(e,"H1",{class:!0});var He=p(n);h=c(He,"A",{id:!0,class:!0,href:!0});var $t=p(h);b=c($t,"SPAN",{});var _t=p(b);S(_.$$.fragment,_t),_t.forEach(a),$t.forEach(a),q=$(He),A=c(He,"SPAN",{});var bt=p(A);j=o(bt,"Generaci\xF3n de res\xFAmenes"),bt.forEach(a),He.forEach(a),y=$(e),S(D.$$.fragment,e),N=$(e),B=c(e,"P",{});var ka=p(B);U=o(ka,"La generaci\xF3n de res\xFAmenes (summarization, en ingl\xE9s) crea una versi\xF3n m\xE1s corta de un documento o un art\xEDculo que resume toda su informaci\xF3n importante. Junto con la traducci\xF3n, es un ejemplo de una tarea que puede ser formulada como una tarea secuencia a secuencia. La generaci\xF3n de res\xFAmenes puede ser:"),ka.forEach(a),F=$(e),K=c(e,"UL",{});var Dt=p(K);H=c(Dt,"LI",{});var Sa=p(H);he=o(Sa,"Extractiva: Extrae la informaci\xF3n m\xE1s relevante de un documento."),Sa.forEach(a),pe=$(Dt),X=c(Dt,"LI",{});var za=p(X);Q=o(za,"Abstractiva: Genera un texto nuevo que captura la informaci\xF3n m\xE1s importante."),za.forEach(a),Dt.forEach(a),Y=$(e),I=c(e,"P",{});var Re=p(I);oe=o(Re,"Esta gu\xEDa te mostrar\xE1 c\xF3mo puedes hacer fine-tuning del modelo "),ee=c(Re,"A",{href:!0,rel:!0});var Ca=p(ee);ge=o(Ca,"T5"),Ca.forEach(a),V=o(Re," sobre el subset de proyectos de ley del estado de California, dentro del dataset "),G=c(Re,"A",{href:!0,rel:!0});var xa=p(G);ne=o(xa,"BillSum"),xa.forEach(a),Z=o(Re," para hacer generaci\xF3n de res\xFAmenes abstractiva."),Re.forEach(a),me=$(e),S(L.$$.fragment,e),W=$(e),J=c(e,"H2",{class:!0});var Ft=p(J);d=c(Ft,"A",{id:!0,class:!0,href:!0});var Ta=p(d);E=c(Ta,"SPAN",{});var Aa=p(E);S(M.$$.fragment,Aa),Aa.forEach(a),Ta.forEach(a),$e=$(Ft),O=c(Ft,"SPAN",{});var Pa=p(O);fe=o(Pa,"Carga el dataset BillSum"),Pa.forEach(a),Ft.forEach(a),te=$(e),R=c(e,"P",{});var Da=p(R);be=o(Da,"Carga el dataset BillSum de la biblioteca \u{1F917} Datasets:"),Da.forEach(a),le=$(e),S(ae.$$.fragment,e),ue=$(e),_e=c(e,"P",{});var Fa=p(_e);l=o(Fa,"Divide el dataset en un set de train y un set de test:"),Fa.forEach(a),v=$(e),S(ie.$$.fragment,e),Le=$(e),Ee=c(e,"P",{});var La=p(Ee);We=o(La,"A continuaci\xF3n, observa un ejemplo:"),La.forEach(a),ke=$(e),S(ve.$$.fragment,e),Se=$(e),ce=c(e,"P",{});var Qe=p(ce);Je=o(Qe,"El campo "),qe=c(Qe,"CODE",{});var Ma=p(qe);Ke=o(Ma,"text"),Ma.forEach(a),Xe=o(Qe," es el input y el campo "),et=c(Qe,"CODE",{});var Oa=p(et);Gt=o(Oa,"summary"),Oa.forEach(a),Ht=o(Qe," es el objetivo."),Qe.forEach(a),vt=$(e),ze=c(e,"H2",{class:!0});var Lt=p(ze);xe=c(Lt,"A",{id:!0,class:!0,href:!0});var Ia=p(xe);tt=c(Ia,"SPAN",{});var Na=p(tt);S(Me.$$.fragment,Na),Na.forEach(a),Ia.forEach(a),Wt=$(Lt),at=c(Lt,"SPAN",{});var Ba=p(at);Jt=o(Ba,"Preprocesa"),Ba.forEach(a),Lt.forEach(a),qt=$(e),we=c(e,"P",{});var Ve=p(we);Kt=o(Ve,"Carga el tokenizador T5 para procesar "),st=c(Ve,"CODE",{});var Ua=p(st);Xt=o(Ua,"text"),Ua.forEach(a),Yt=o(Ve," y "),nt=c(Ve,"CODE",{});var Ga=p(nt);Rt=o(Ga,"summary"),Ga.forEach(a),Qt=o(Ve,":"),Ve.forEach(a),wt=$(e),S(Oe.$$.fragment,e),yt=$(e),Ye=c(e,"P",{});var Ha=p(Ye);Vt=o(Ha,"La funci\xF3n de preprocesamiento necesita:"),Ha.forEach(a),jt=$(e),ye=c(e,"OL",{});var Ze=p(ye);rt=c(Ze,"LI",{});var Wa=p(rt);Zt=o(Wa,"Agregar un prefijo al input; una clave para que T5 sepa que se trata de una tarea de generaci\xF3n de res\xFAmenes. Algunos modelos capaces de realizar m\xFAltiples tareas de NLP requieren una clave que indique la tarea espec\xEDfica."),Wa.forEach(a),ea=$(Ze),Ie=c(Ze,"LI",{});var Mt=p(Ie);ta=o(Mt,"Usar el argumento "),ot=c(Mt,"CODE",{});var Ja=p(ot);aa=o(Ja,"text_target"),Ja.forEach(a),sa=o(Mt," para tokenizar etiquetas."),Mt.forEach(a),na=$(Ze),Ne=c(Ze,"LI",{});var Ot=p(Ne);ra=o(Ot,"Truncar secuencias para que no sean m\xE1s largas que la longitud m\xE1xima fijada por el par\xE1metro "),lt=c(Ot,"CODE",{});var Ka=p(lt);oa=o(Ka,"max_length"),Ka.forEach(a),la=o(Ot,"."),Ot.forEach(a),Ze.forEach(a),Et=$(e),S(Be.$$.fragment,e),kt=$(e),de=c(e,"P",{});var Fe=p(de);ia=o(Fe,"Usa la funci\xF3n "),it=c(Fe,"CODE",{});var Xa=p(it);ca=o(Xa,"map"),Xa.forEach(a),pa=o(Fe," de \u{1F917} Datasets para aplicar la funci\xF3n de preprocesamiento sobre el dataset en su totalidad. Puedes acelerar la funci\xF3n "),ct=c(Fe,"CODE",{});var Ya=p(ct);ma=o(Ya,"map"),Ya.forEach(a),fa=o(Fe," configurando el argumento "),pt=c(Fe,"CODE",{});var Ra=p(pt);ua=o(Ra,"batched=True"),Ra.forEach(a),da=o(Fe," para procesar m\xFAltiples elementos del dataset a la vez:"),Fe.forEach(a),St=$(e),S(Ue.$$.fragment,e),zt=$(e),re=c(e,"P",{});var je=p(re);ha=o(je,"Usa "),mt=c(je,"CODE",{});var Qa=p(mt);ga=o(Qa,"DataCollatorForSeq2Seq"),Qa.forEach(a),$a=o(je," para crear un lote de ejemplos. Esto tambi\xE9n "),ft=c(je,"EM",{});var Va=p(ft);_a=o(Va,"rellenar\xE1 din\xE1micamente"),Va.forEach(a),ba=o(je," tu texto y etiquetas a la dimensi\xF3n del elemento m\xE1s largo del lote para que tengan un largo uniforme. Si bien es posible rellenar tu texto en la funci\xF3n "),ut=c(je,"CODE",{});var Za=p(ut);va=o(Za,"tokenizer"),Za.forEach(a),qa=o(je," mediante el argumento "),dt=c(je,"CODE",{});var es=p(dt);wa=o(es,"padding=True"),es.forEach(a),ya=o(je,", el rellenado din\xE1mico es m\xE1s eficiente."),je.forEach(a),Ct=$(e),S(Te.$$.fragment,e),xt=$(e),Ce=c(e,"H2",{class:!0});var It=p(Ce);Ae=c(It,"A",{id:!0,class:!0,href:!0});var ts=p(Ae);ht=c(ts,"SPAN",{});var as=p(ht);S(Ge.$$.fragment,as),as.forEach(a),ts.forEach(a),ja=$(It),gt=c(It,"SPAN",{});var ss=p(gt);Ea=o(ss,"Entrenamiento"),ss.forEach(a),It.forEach(a),Tt=$(e),S(Pe.$$.fragment,e),At=$(e),S(De.$$.fragment,e),this.h()},h(){w(s,"name","hf:doc:metadata"),w(s,"content",JSON.stringify(Es)),w(h,"id","generacin-de-resmenes"),w(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),w(h,"href","#generacin-de-resmenes"),w(n,"class","relative group"),w(ee,"href","https://huggingface.co/t5-small"),w(ee,"rel","nofollow"),w(G,"href","https://huggingface.co/datasets/billsum"),w(G,"rel","nofollow"),w(d,"id","carga-el-dataset-billsum"),w(d,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),w(d,"href","#carga-el-dataset-billsum"),w(J,"class","relative group"),w(xe,"id","preprocesa"),w(xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),w(xe,"href","#preprocesa"),w(ze,"class","relative group"),w(Ae,"id","entrenamiento"),w(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),w(Ae,"href","#entrenamiento"),w(Ce,"class","relative group")},m(e,f){t(document.head,s),m(e,u,f),m(e,n,f),t(n,h),t(h,b),z(_,b,null),t(n,q),t(n,A),t(A,j),m(e,y,f),z(D,e,f),m(e,N,f),m(e,B,f),t(B,U),m(e,F,f),m(e,K,f),t(K,H),t(H,he),t(K,pe),t(K,X),t(X,Q),m(e,Y,f),m(e,I,f),t(I,oe),t(I,ee),t(ee,ge),t(I,V),t(I,G),t(G,ne),t(I,Z),m(e,me,f),z(L,e,f),m(e,W,f),m(e,J,f),t(J,d),t(d,E),z(M,E,null),t(J,$e),t(J,O),t(O,fe),m(e,te,f),m(e,R,f),t(R,be),m(e,le,f),z(ae,e,f),m(e,ue,f),m(e,_e,f),t(_e,l),m(e,v,f),z(ie,e,f),m(e,Le,f),m(e,Ee,f),t(Ee,We),m(e,ke,f),z(ve,e,f),m(e,Se,f),m(e,ce,f),t(ce,Je),t(ce,qe),t(qe,Ke),t(ce,Xe),t(ce,et),t(et,Gt),t(ce,Ht),m(e,vt,f),m(e,ze,f),t(ze,xe),t(xe,tt),z(Me,tt,null),t(ze,Wt),t(ze,at),t(at,Jt),m(e,qt,f),m(e,we,f),t(we,Kt),t(we,st),t(st,Xt),t(we,Yt),t(we,nt),t(nt,Rt),t(we,Qt),m(e,wt,f),z(Oe,e,f),m(e,yt,f),m(e,Ye,f),t(Ye,Vt),m(e,jt,f),m(e,ye,f),t(ye,rt),t(rt,Zt),t(ye,ea),t(ye,Ie),t(Ie,ta),t(Ie,ot),t(ot,aa),t(Ie,sa),t(ye,na),t(ye,Ne),t(Ne,ra),t(Ne,lt),t(lt,oa),t(Ne,la),m(e,Et,f),z(Be,e,f),m(e,kt,f),m(e,de,f),t(de,ia),t(de,it),t(it,ca),t(de,pa),t(de,ct),t(ct,ma),t(de,fa),t(de,pt),t(pt,ua),t(de,da),m(e,St,f),z(Ue,e,f),m(e,zt,f),m(e,re,f),t(re,ha),t(re,mt),t(mt,ga),t(re,$a),t(re,ft),t(ft,_a),t(re,ba),t(re,ut),t(ut,va),t(re,qa),t(re,dt),t(dt,wa),t(re,ya),m(e,Ct,f),z(Te,e,f),m(e,xt,f),m(e,Ce,f),t(Ce,Ae),t(Ae,ht),z(Ge,ht,null),t(Ce,ja),t(Ce,gt),t(gt,Ea),m(e,Tt,f),z(Pe,e,f),m(e,At,f),z(De,e,f),Pt=!0},p(e,[f]){const He={};f&2&&(He.$$scope={dirty:f,ctx:e}),L.$set(He);const $t={};f&2&&($t.$$scope={dirty:f,ctx:e}),Te.$set($t);const _t={};f&2&&(_t.$$scope={dirty:f,ctx:e}),Pe.$set(_t);const bt={};f&2&&(bt.$$scope={dirty:f,ctx:e}),De.$set(bt)},i(e){Pt||(C(_.$$.fragment,e),C(D.$$.fragment,e),C(L.$$.fragment,e),C(M.$$.fragment,e),C(ae.$$.fragment,e),C(ie.$$.fragment,e),C(ve.$$.fragment,e),C(Me.$$.fragment,e),C(Oe.$$.fragment,e),C(Be.$$.fragment,e),C(Ue.$$.fragment,e),C(Te.$$.fragment,e),C(Ge.$$.fragment,e),C(Pe.$$.fragment,e),C(De.$$.fragment,e),Pt=!0)},o(e){x(_.$$.fragment,e),x(D.$$.fragment,e),x(L.$$.fragment,e),x(M.$$.fragment,e),x(ae.$$.fragment,e),x(ie.$$.fragment,e),x(ve.$$.fragment,e),x(Me.$$.fragment,e),x(Oe.$$.fragment,e),x(Be.$$.fragment,e),x(Ue.$$.fragment,e),x(Te.$$.fragment,e),x(Ge.$$.fragment,e),x(Pe.$$.fragment,e),x(De.$$.fragment,e),Pt=!1},d(e){a(s),e&&a(u),e&&a(n),T(_),e&&a(y),T(D,e),e&&a(N),e&&a(B),e&&a(F),e&&a(K),e&&a(Y),e&&a(I),e&&a(me),T(L,e),e&&a(W),e&&a(J),T(M),e&&a(te),e&&a(R),e&&a(le),T(ae,e),e&&a(ue),e&&a(_e),e&&a(v),T(ie,e),e&&a(Le),e&&a(Ee),e&&a(ke),T(ve,e),e&&a(Se),e&&a(ce),e&&a(vt),e&&a(ze),T(Me),e&&a(qt),e&&a(we),e&&a(wt),T(Oe,e),e&&a(yt),e&&a(Ye),e&&a(jt),e&&a(ye),e&&a(Et),T(Be,e),e&&a(kt),e&&a(de),e&&a(St),T(Ue,e),e&&a(zt),e&&a(re),e&&a(Ct),T(Te,e),e&&a(xt),e&&a(Ce),T(Ge),e&&a(Tt),T(Pe,e),e&&a(At),T(De,e)}}}const Es={local:"generacin-de-resmenes",sections:[{local:"carga-el-dataset-billsum",title:"Carga el dataset BillSum"},{local:"preprocesa",title:"Preprocesa"},{local:"entrenamiento",title:"Entrenamiento"}],title:"Generaci\xF3n de res\xFAmenes"};function ks(P){return ps(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ds extends os{constructor(s){super();ls(this,s,ks,js,is,{})}}export{Ds as default,Es as metadata};
