Files
INTUIA/Programa final/spacy/training/__pycache__/loop.cpython-312.pyc
T

115 lines
18 KiB
Plaintext
Raw Normal View History

2026-03-15 13:27:50 +00:00
Ë
?û g7<ãó¤ddlZddlZddlZddlmZddlmZddlm Z m
Z
m Z m Z m
Z
mZmZmZmZmZddlmZmZmZmZmZddlmZddlmZdd lmZdd
lm Z m!Z!m"Z"d d l#m$Z$e
rdd
l%m&Z&dZ'dZ( d3dejRejTdœdddeede+de de dedeeff dZ,dddede-de+de+de+de+d ee.d!ee.d"ee de
e.e fgdffd#„Z/d$„Z0ddd%e d&e
e.e-fde gee-e
e.e-ffffd'„Z1ddd(e dgee$fd)e ee$gee$fd*e+fd+„Z2d,ee
e.e fefddd-e
e.e fddfd.„Z3d/ee dgdfde dgdffd0„Z4d1eeddfd2„Z5y)4éN)ÚPath)Ú
default_timer)
ÚIOÚ
TYPE_CHECKINGÚAnyÚCallableÚDictÚIterableÚListÚOptionalÚTupleÚUnion)ÚConfigÚ OptimizerÚconstantÚfix_random_seedÚset_gpu_allocator)ÚPrinteré)ÚErrors)ÚConfigSchemaTraining)ÚloggerÚregistryÚresolve_dot_namesé)ÚExample©ÚLanguagez
model-bestz
model-lastéÿÿÿÿ)Úuse_gpuÚstdoutÚstderrÚnlprÚ output_pathr r!r"Úreturncóvtd¬«}jj«}|ddt|dd«|dd}|dk\r
|r t |«t j |dt¬«}|d |d
g} t|| «\}
} |d Š|d } |d
}
|d}t|d«Š|d}ˆˆˆˆfd}|d}|d}tt|
|
|d«t| | «|d|d|d|d|d|||¬« }t«|j|jdj «dz«|r&|j|jd|«dz«|r&|j|jd|«dz«|j|jdj"«dz«j%|¬ «5|||«\}}ddd« |D][\}}}|G‰j%|¬ «5t'||«ddd«||«t)t*z «|d!<||nd«Œ] « |d#« j2rj5j2«6|j|j7d$‰t*z «dz«t*z fSdfS#1swYŒàxYw#1swYŒ¸xYw#t,$r8}/|j|j/d"t1|««dz«|d}~wwxYw#« |d#«wwxYw)%aUTrain a pipeline.
nlp (Language): The initialized nlp object with the full config.
output_path (Optional[Path]): Optional output path to save trained model to.
use_gpu (int): Whether to train on GPU. Make sure to call require_gpu
before calling this function.
stdout (file): A file-like object to write output messages. To disable
printing, set to io.StringIO.
stderr (file): A second file-like object to write output messages. To disable
printing, set to io.StringIO.
RETURNS (tuple): The final nlp object and the path to the exported model.
T)Úno_printÚtrainingÚseedNÚ
gpu_allocatorr)ÚschemaÚ train_corpusÚ
dev_corpusÚ optimizerÚ
score_weightsÚbatcherrÚbefore_to_diskÚ
before_updatecóVjj«5«jtz «ddd«|rX‰tz j «rt
jtz «t
jtz tz «yy#1swYŒdxYw©N) Ú
use_paramsÚaveragesÚto_diskÚDIR_MODEL_LASTÚDIR_MODEL_BESTÚexistsÚshutilÚrmtreeÚcopytree)Úis_bestr1r#r.r$s €€€€úTC:\Users\garci\AppData\Roaming\Python\Python312\site-packages\spacy/training/loop.pyÚsave_checkpointztrain.<locals>.save_checkpointMsø€Ø
^‰^˜I×
˜ × ´nÑ(DÔ  ðœnÑ
˜k¬NÑ O‰O˜K¬.Ñ8¸+ÌÑ:VÕ ÷
/ús BÂB(Úfrozen_componentsÚannotating_componentsÚ
max_epochsÚdropoutÚaccumulate_gradientÚpatienceÚ max_stepsÚeval_frequency)rDrErFrGrHÚexcluderBr2z
Pipeline: ú
zFrozen components: zSet annotations on update for: zInitial learn rate: )Údisabler$zAAborting and saving the final best model. Encountered exception: Fz"Saved pipeline to output directory)rÚconfigÚ interpolaterrrÚresolverrÚcreate_before_to_disk_callbackÚtrain_while_improvingÚcreate_train_batchesÚcreate_evaluation_callbackÚclean_output_dirÚwriteÚinfoÚ
pipe_namesÚ
learn_rateÚ select_pipesÚ update_metaÚstrr8Ú ExceptionÚwarnÚreprr6r5Úgood)r#r$r r!r"ÚmsgrLÚ allocatorÚTÚ dot_namesr,r-r/r0Ú train_loggerr2r@rArBÚtraining_step_iteratorÚlog_stepÚfinalize_loggerÚbatchrUÚis_best_checkpointÚer1r.s`` @@r?Útrainrj#û€ô, ˜4Ô
€Cà
Z‰Z×
%€FØ
ˆ˜&ј˜zÑ*¨6Ñ" 3€IØ!|™ ܘ)Ô×ј 
Ñ+Ô4HÔI€AØ" A l¡OÐ4€IܸӀL+€IØ&€MØ ‰l€GØX;€LÜ3°AÐ6FÑ4GÓH€NØ&€M÷XðÐàÐä ØÜ˜S ,°¸¸Ó" 
°MÓ)‘ ØÐ:‘ØK‘.ØÐ
Ðô
‡LL˜J s§~¡~Ð&6Ð8¸Ø S—X‘XÐ 3Ð4EÐ3FÐHÈ4ÑØ Ø H‰HÐ6Ð7LÐ6MÐ OÐRVÑ 
ð ‡LLÐ×1EÑ1EÐ0FÐHÈ4Ñ × Ñ Ð"3Ð Õ 4Ù$0°°f¸fÓ$EÑ!ˆ
#Û/EÑ +ˆE×%Ð.?Р 3¨ÔAàÐ#Ð$6Ô7Ü*-¨k¼NÑ.JÓ*KD˜Ñ Ð;Õ 0Fñ& ÔØ Ð ˜ ×ÒØ ÐØ Ø H‰HÐ9¸;ÌÑ;WÓ ñ
ô
ð[¤>ÑTˆ÷G
5Ð 4ú÷
AÐ@ûô ò Ø Ð L‰LØð.Ü.2°1«g¨Yððñ ô
ðˆûð ûñ ÔØ Ð ˜  #úsHÇKÇ2K ÈKÈ5K ËKËK ËK Ë L!Ë)3LÌL!Ì!L$Ì$L8r.rDrHrErFrGrIrBr2c #óÄKt|t«r t|«} n|} g}
i}d}t«}t |«D]“\}\}}| r||dœ}| ||«t | «}t
||«D]}|j|||d| |
¬«Œ|jD]D\}}|| vsŒ t|d«sŒ|jsŒ%|jdvsŒ4|j|«ŒF|j«||zsj|jr/|j|j«5|«\}}ddd«n
|«\}}|
j!|f«|t#|
«dk(}nd\}}d}|t%d „|D««z
}|||||
t't«|z
«|d
œ}|||f|i}t#d |
D««}|d  }|r
||z
|k\ry|sŒ||k\sŒ”yy#1swYŒ§xYw­w)
aTrain until an evaluation stops improving. Works as a generator,
with each iteration yielding a tuple `(batch, info, is_best_checkpoint)`,
where info is a dict, and is_best_checkpoint is in [True, False, None] --
None indicating that the iteration was not evaluated as a checkpoint.
The evaluation is conducted by calling the evaluate callback.
Positional arguments:
nlp: The spaCy pipeline to evaluate.
optimizer: The optimizer callable.
train_data (Iterable[Batch]): A generator of batches, with the training
data. Each batch should be a Sized[Tuple[Input, Annot]]. The training
data iterable needs to take care of iterating over the epochs and
shuffling.
evaluate (Callable[[], Tuple[float, Any]]): A callback to perform evaluation.
The callback should take no arguments and return a tuple
`(main_score, other_scores)`. The main_score should be a float where
higher is better. other_scores can be any object.
Every iteration, the function yields out a tuple with:
* batch: A list of Example objects.
* info: A dict with various information about the last update (see below).
* is_best_checkpoint: A value in None, False, True, indicating whether this
was the best evaluation so far. You should use this to save the model
checkpoints during training. If None, evaluation was not conducted on
that iteration. False means evaluation was conducted, but a previous
evaluation was better.
The info dict provides the following information: