Files
INTUIA/Programa final/spacy/cli/__pycache__/pretrain.cpython-312.pyc
T

46 lines
5.9 KiB
Plaintext
Raw Normal View History

2026-03-15 13:27:50 +00:00
Ë
=û gãó–ddlZddlmZddlmZddlZddlmZddlm Z ddl
m Z dd l m
Z
mZmZmZmZmZmZej(d
d d d œ¬
«e
ddd dd ¬«e
dd¬«edddd¬«edddd¬«edddd¬«edddd ¬«edd!d"d#¬«fd$ej*d%ed&ed'eed(eed)eed*ed+efd,„«Zd-„Zy).éN)ÚPath)ÚOptional)Úmsgé)Úpretrain)Ú load_configé)ÚArgÚOptÚappÚ import_codeÚparse_config_overridesÚ setup_gpuÚshow_validation_errorrT)Úallow_extra_argsÚignore_unknown_options)Úcontext_settings.zPath to config fileF)ÚhelpÚexistsÚdir_okayÚ
allow_dashz+Directory to write weights to on each epoch)rz--codez-czNPath to Python file with additional code (registered functions) to be importedz
--resume-pathz-rz;Path to pretrained weights from which to resume pretrainingz--epoch-resumez-erzuThe epoch to resume counting from when using --resume-path. Prevents unintended overwriting of existing weight files.éÿÿÿÿz--gpu-idz-gzGPU ID or -1 for CPUz --skip-lastz-LzSkip saving model-last.binÚctxÚ config_pathÚ
output_dirÚ code_pathÚ resume_pathÚ epoch_resumeÚuse_gpuÚ skip_lastc ó†t|j«}t|«t||||«t |«t j d|«t|«5t||d¬«} ddd« j«}
|
jd«st jdd¬«|j«s*|jd ¬
«t jd |«| j|d z «t jd
«t!|
||||d|¬«t jd«y#1swYŒÌxYw)a
Pre-train the 'token-to-vector' (tok2vec) layer of pipeline components,
using an approximate language-modelling objective. Two objective types
are available, vector-based and character-based.
In the vector-based objective, we load word vectors that have been trained
using a word2vec-style distributional similarity algorithm, and train a
component like a CNN, BiLSTM, etc to predict vectors which match the
pretrained ones. The weights are saved to a directory after each epoch. You
can then pass a path to one of these pretrained weights files to the
'spacy train' command.
This technique may be especially helpful if you have little labelled data.
However, it's still quite experimental, so your mileage may vary.
To load the weights back in during 'spacy train', you need to ensure
all settings are the same between pretraining and training. Ideally,
this is done by using the same config file for both commands.
DOCS: https://spacy.io/api/cli#pretrain
zLoading config from: F)Ú overridesÚ interpolateNÚ pretrainingz/The [pretraining] block in your config is emptyr ©ÚexitsT)ÚparentszCreated output directory: z
config.cfgz)Saved config file in the output directory)rrrÚsilentr zSuccessfully finished pretrain)rÚargsr
Úverify_cli_argsrrÚinforrr#ÚgetÚfailrÚmkdirÚgoodÚto_diskr) rrrrrrrr Úconfig_overridesÚ
raw_configÚconfigs úSC:\Users\garci\AppData\Roaming\Python\Python312\site-packages\spacy/cli/pretrain.pyÚ pretrain_clir5sôJ.¨c¯h©hÓÜ Ôܨ[¸,Ô
ˆgÔ܇H$ [ 
˜{Õ +Ü Ø Ð#3Àô
ˆ
÷
×