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

92 lines
11 KiB
Plaintext
Raw Normal View History

2026-03-15 13:27:50 +00:00
Ë
=û g»%ãóLddlZddlmZddlmZmZmZmZmZddl Z ddl
m Z ddl m
Z
ddlmZmZddlmZdd lmZdd
lmZd d lmZmZmZmZmZmZej<d
«ej<d«edd¬«eddd¬«eddddd¬«edddd¬«edddd ¬«edd!d"d#¬«edd$d%d&dd¬'«ed(d)d*d+¬«edd,d-d.¬«ed/d0d1d2¬«f
d3ed4ed5eed6eed7e d8e!d9eed:e d;e!d<efd=„««Z" dRd3ed4ed5eed7e d8e!d9eed:e d>e!d<ed;e!d?eeeffd@„Z#ifd/ddAœdBeeefdCeeefd<ed>e!d?eeeff
dD„Z$ dSdEeedFedGedHe dIe!dJe!dKe!fdL„Z%dMe
dBeeeee&ffdNedOed?df
dP„Z'dMe
dBeeeee&ffd?dfdQ„Z(y)TéN)ÚPath)ÚAnyÚDictÚListÚOptionalÚUnion)Úfix_random_seed)ÚPrinteré)ÚdisplacyÚutil)ÚScorer)ÚDoc)ÚCorpusé)ÚArgÚOptÚappÚ
benchmark_cliÚ import_codeÚ setup_gpuÚaccuracyÚevaluate.zModel name or path)Úhelpz3Location of binary evaluation data in .spacy formatT)rÚexistsz--outputz-ozOutput JSON file for metricsF)rÚdir_okayz--codez-czNPath to Python file with additional code (registered functions) to be importedéÿÿÿÿz--gpu-idz-gzGPU ID or -1 for CPUz--gold-preprocz-GzUse gold preprocessingz--displacy-pathz-dpz+Directory to output rendered parses as HTML)rrÚ file_okayéz--displacy-limitz-dlz!Limit of parses to render as HTMLz--per-componentz-PzSReturn scores per component, only applicable when an output JSON file is specified.Úscz --spans-keyz-skz*Spans key to use when evaluating Doc.spansÚmodelÚ data_pathÚoutputÚ code_pathÚuse_gpuÚ gold_preprocÚ
displacy_pathÚdisplacy_limitÚ
per_componentÚ spans_keyc
óDt|«t||||||||d| ¬«
y)am
Evaluate a trained pipeline. Expects a loadable spaCy pipeline and evaluation
data in the binary .spacy format. The --gold-preproc option sets up the
evaluation examples with gold-standard sentences and tokens for the
predictions. Gold preprocessing helps the annotations align to the
tokenization, and may result in sequences of more consistent length. However,
it may reduce runtime accuracy due to train/test skew. To render a sample of
dependency parses in a HTML file, set as output directory as the
displacy_path argument.
DOCS: https://spacy.io/api/cli#benchmark-accuracy
F)r#r%r&r'r(r)Úsilentr*N)rr)
r!r"r#r$r%r&r'r(r)r*s
úSC:\Users\garci\AppData\Roaming\Python\Python312\site-packages\spacy/cli/evaluate.pyÚ evaluate_clir.s2ô< ÔÜ Ø
ØØØØØö ór,Úreturnc
óÞt|| ¬«}
t«t||¬«tj|«}tj|«} tj|«}|j «s|
j
d|d¬«|r$|j «s|
j
d|d¬«t||¬«} tj|«}
t| |
««}|
j|| ¬«}| r*|}||
jd «n"|
jd
«nid d d
ddddddddddddddddddd “d!d"“d#d$“d%d&“d'd(|d)d*d(|d+d,d(|d-d.d/i¥}i}i}|j«D]\}}||vsŒ |d k(r|d0z|jd1d2«zd3z}t||t t"f«r|d/k(r ||d4||<n||d5zd6||<nd7||<|||t%j&d8d9|j)««<Œ“|
j+|d:¬;«t-||||¬<«}|rŠ|
j.Dcgc]}|
j1|«j2Œ}}t|
j5d=„|d|D«««}d>|v}d?|v}d@|v}t7|||||||¬A«|
j9dB|dC|«| *t;j<| |«|
j9dD| «|Scc}w)EN©Úno_printÚpretty)r,zEvaluation data not foundr)Úexitsz(Visualization output directory not found)r&)r)zdThe per-component option is enabled but there is no output JSON file provided to save the scores to.z7Per-component scores will be saved to output JSON file.ÚTOKÚ token_accÚTAGÚtag_accÚPOSÚpos_accÚMORPHÚ morph_accÚLEMMAÚ lemma_accÚUASÚdep_uasÚLASÚdep_laszNER PÚents_pzNER RÚents_rzNER FÚents_fÚTEXTCATÚ
cats_scorezSENT PÚsents_pzSENT RÚsents_rzSENT FÚsents_fzSPAN PÚspans_Ú_pzSPAN RÚ_rzSPAN FÚ_fÚSPEEDÚspeedzcats_score_descÚunkú)z.0fédú.2fú-z[\s/]ÚResults)Útitle©r*r,c3óHK|]}|jjŒy­w)N)Ú referenceÚtext)Ú.0Úexs r-ú <genexpr>zevaluate.<locals>.<genexpr>ˆsèø€ÐVÑ9U°2˜RŸ\™\×.Ñ9Uùs "ÚparserÚnerÚspancat)Ú
model_nameÚlimitÚdepsÚentsÚspansz
Generated z parses as HTMLzSaved results to )r
r rr
Ú ensure_pathrÚfailrÚ
load_modelÚlistrÚwarnÚinfoÚitemsÚgetÚ
isinstanceÚintÚfloatÚreÚsubÚlowerÚtableÚhandle_scores_per_typeÚ
pipe_namesÚ
get_pipe_metaÚfactoryÚpipeÚ
render_parsesÚgoodÚsrslyÚ
write_json)r!r"r#r%r&r'r(r,r*r)ÚmsgÚ output_pathÚcorpusÚnlpÚ dev_datasetÚscoresÚdataÚmetricsÚresultsÚmetricÚkeyr}Ú
factory_namesÚdocsÚ render_depsÚ render_entsÚ render_spanss r-rr=ô ˜6¨f¨*Ô
5€CÜÔÜ
ˆg˜fÕ× Ñ  Ó+€IÜ×" *€KÜ×$ ]Ó3€MØ × Ñ Ô Ø Ð,¨i¸qˆÔ˜]× Ð;¸]ÐRSˆÔ
I¨LÔ
9€FÜ
/‰/˜
€CÜv˜c“{Ó#€KØ
\‰\˜+°]ˆ
C€FÙØˆØ ˆ>Ø H‰HØ
ð
H‰HÐ 
Ø 
à 
ð

ð

ð
 
ð


ð

ð

ð

ð