Files
INTUIA/Programa final/spacy/pipeline/__pycache__/textcat_multilabel.cpython-312.pyc
T

119 lines
8.4 KiB
Plaintext
Raw Normal View History

2026-03-15 13:27:50 +00:00
Ë
>û gãóæddlmZddlmZmZmZmZmZmZddl m
Z
m Z ddl m
Z
ddlmZddlmZddlmZdd lmZdd
lmZmZdd lmZdd lmZd
dlmZdZe
«jAe«dZ!dZ"dZ#ejHddgde!ddidœdddddddddddœ
¬«dede%de eeee
fde&d eed!d"f d#„«Z'd$eed!ee%effd%„Z(ejRd«d&„«Z*Gd'„d"e«Z+y)(é)Úislice)ÚAnyÚCallableÚDictÚIterableÚListÚOptional)ÚConfigÚModel)ÚFloats2dé)ÚErrors)ÚLanguage)ÚScorer)ÚDoc)ÚExampleÚvalidate_get_examples)Úregistry)ÚVocabé)ÚTextCategorizeraX
[model]
@architectures = "spacy.TextCatEnsemble.v2"
[model.tok2vec]
@architectures = "spacy.Tok2Vec.v2"
[model.tok2vec.embed]
@architectures = "spacy.MultiHashEmbed.v2"
width = 64
rows = [2000, 2000, 500, 1000, 500]
attrs = ["NORM", "LOWER", "PREFIX", "SUFFIX", "SHAPE"]
include_static_vectors = false
[model.tok2vec.encode]
@architectures = "spacy.MaxoutWindowEncoder.v2"
width = ${model.tok2vec.embed.width}
window_size = 1
maxout_pieces = 3
depth = 2
[model.linear_model]
@architectures = "spacy.TextCatBOW.v3"
exclusive_classes = false
length = 262144
ngram_size = 1
no_output_layer = false
Úmodelzq
[model]
@architectures = "spacy.TextCatBOW.v3"
exclusive_classes = false
ngram_size = 1
no_output_layer = false
aa
[model]
@architectures = "spacy.TextCatReduce.v1"
exclusive_classes = false
use_reduce_first = false
use_reduce_last = false
use_reduce_max = false
use_reduce_mean = true
[model.tok2vec]
@architectures = "spacy.HashEmbedCNN.v2"
pretrained_vectors = null
width = 96
depth = 4
embed_size = 2000
window_size = 1
maxout_pieces = 3
subword_features = true
Útextcat_multilabelzdoc.catsgà?z@scorersz"spacy.textcat_multilabel_scorer.v2)Ú thresholdrÚscorerçð?N)
Ú
cats_scoreÚcats_score_descÚ cats_micro_pÚ cats_micro_rÚ cats_micro_fÚ cats_macro_pÚ cats_macro_rÚ cats_macro_fÚcats_macro_aucÚcats_f_per_type)ÚassignsÚdefault_configÚdefault_score_weightsÚnlpÚnamerrÚreturnÚMultiLabel_TextCategorizercó6t|j||||¬«S)aCreate a MultiLabel_TextCategorizer component. The text categorizer predicts categories
over a whole document. It can learn one or more labels, and the labels are considered
to be non-mutually exclusive, which means that there can be zero or more labels
per doc).
model (Model[List[Doc], List[Floats2d]]): A model instance that predicts
scores for each category.
threshold (float): Cutoff to consider a prediction "positive".
scorer (Optional[Callable]): The scoring method.
)rr)r-Úvocab)r*r+rrrs úbC:\Users\garci\AppData\Roaming\Python\Python312\site-packages\spacy/pipeline/textcat_multilabel.pyÚmake_multilabel_textcatr1Ks!ôL  5˜$¨)¸ ðóÚexamplesc ó4tj|dfddi|¤ŽS)catsÚ multi_labelT)rÚ
score_cats)r3Úkwargss r0Útextcat_multilabel_scorer9vs/Ü × Ñ ØØñ ðð ð ñ  ðr2cótS)N)r9©r2r0Úmake_textcat_multilabel_scorerr<sä #r2có eZdZdZ dedœdedededede e
dd f d
Z e d «Z
d d d œd
e
geefde ede eefdZdeefdZy )r-zlPipeline component for multi-label text classification.
DOCS: https://spacy.io/api/textcategorizer
)rr/rr+rrr,Ncót||_||_||_d|_g|dœ}t |«|_||_y)Initialize a text categorizer for multi-label classification.
vocab (Vocab): The shared vocabulary.
model (thinc.api.Model): The Thinc Model powering the pipeline component.
name (str): The component instance name, used to add entries to the
losses during training.
threshold (float): Cutoff to consider a prediction "positive".
scorer (Optional[Callable]): The scoring method.
DOCS: https://spacy.io/api/textcategorizer#init
N)Úlabelsr)r/rr+Ú_rehearsal_modelÚdictÚcfgr)Úselfr/rr+rrrBs r0Ú__init__z#MultiLabel_TextCategorizer.__init__Šs=ð(ˆŒ
؈Œ
؈Œ Ø $ˆÔب)Ñܘ“9ˆŒØˆ r2cóy)NTr;)rCs r0Úsupport_missing_valuesz1MultiLabel_TextCategorizer.support_missing_values¦sàr2)r*r?Ú get_examplesr*r?cóÊt|d«|€9|«D].}|jjD]}|j|«ŒŒ0n|D]}|j|«Œt t |«d««}|j
|«|Dcgc]}|jŒ} }|j|«\}
} |j«t| «dkDs/Jtjj|j¬««t|
«dkDs/Jtjj|j¬««|jj!| |
¬«ycc}w)a\Initialize the pipe for training, using a representative set
of data examples.
get_examples (Callable[[], Iterable[Example]]): Function that
returns a representative sample of gold-standard Example objects.
nlp (Language): The current nlp object the component is part of.
labels: The labels to add to the component, typically generated by the
`init labels` command. If no labels are provided, the get_examples
callback is used to extract the labels from the data.
DOCS: https://spacy.io/api/textcategorizer#initialize
z%MultiLabel_TextCategorizer.initializeNé
r)r+)ÚY)rÚyr5Ú add_labelÚlistrÚ_validate_categoriesÚ referenceÚ_examples_to_truthÚ_require_labelsÚlenrÚE923Úformatr+rÚ
initialize) rCrGr*r?ÚexampleÚcatÚlabelÚsubbatchÚegÚ
doc_sampleÚ label_sampleÚ_s r0rVz%MultiLabel_TextCategorizer.initializeªs&ô& ˜lÐ,SÔ ˆ'ž>Ø"Ÿ9™9Ÿ>œ>—NN  ؘuÕ äœ™|›~¨rÓØ ×! +á-5Ó6©X rb—l“l¨Xˆ
Ð×1°(Ó;‰ˆ  ×ÑÔÜ:‹ ÒF¤F§K¡K×$6Ñ$6¸D¿I¹IÐ$6Ó$FÓ  H¤f§k¡k×&8Ñ&8¸d¿i¹iÐ&8Ó&HÓ
×Ñ 
¨lÐÕ;ùò 7sÂE r3cóÌ|D]_}|jjj«D]6}|dk(rŒ |dk(rŒttj
j
|¬««Œay)zˆThis component allows any type of single- or multi-label annotations.
This method overwrites the more strict one from 'textcat'.rg)ÚvalN)rPr5ÚvaluesÚ