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

917 lines
117 KiB
Plaintext
Raw Normal View History

2026-03-15 13:27:50 +00:00
Ë
=û gœªã ódddlZddlZddlZddlZddlZddlZddlZddlm Z m
Z
ddl m Z ddl
mZddlmZmZddlmZddlmZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'Z'ddl(Z(dd l)m*Z*dd
l+m,Z,m-Z-m.Z.m/Z/dd l0m1Z1d d
l2m3Z3m4Z4m5Z5d dl6m7Z7d dl8m9Z9m:Z:d dl;m<Z<d dl=m>Z>m?Z?m@Z@d dlAmBZBmCZCd dlDmEZEd dlFmGZGmHZHmIZId dlJmKZKmLZLmMZMmNZNmOZOd dlPmQZQd dlRmSZSd dlTmUZUd dlVmWZWd dlXmYZYmZZZd dl[m\Z\m]Z]d dl5m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfd dlgmhZhd dlimjZjmkZkeeUgeUfZleem«dz Zoe5jàeo«Zqeem«d z Zre#d!«ZsGd"„d#«Zteejêd$«d%ed&geSffd'„«Zveejîd(«d)„«ZxGd*„d&«Zyd+ezd%ezfd,„Z{eGd-„d.««Z|Gd/„d0e}«Z~d1eeYd%eeYfd2„Zd3ee$e€eUefesgeUfd4eed5eeUfd6e"ezezezfd%dfd7„ZGd8„d9«Gd:„d;«Z„e„«Z…y)<éN)Ú ExitStackÚcontextmanager)Údeepcopy)Ú dataclass)ÚchainÚcycle)ÚPath)Ú
default_timer)ÚAnyÚCallableÚDictÚIterableÚIteratorÚListÚNoReturnÚOptionalÚPatternÚSequenceÚSetÚTupleÚTypeVarÚUnionÚcastÚoverload)ÚPool)ÚConfigÚCupyOpsÚ OptimizerÚget_current_ops)Úconvert_recursiveé)ÚaboutÚtyÚutil)ÚLiteral)ÚErrorsÚWarnings)Ú GIT_VERSION)ÚTOKENIZER_INFIXESÚTOKENIZER_PREFIXESÚTOKENIZER_SUFFIXES)ÚBASE_EXCEPTIONSÚ URL_MATCH)Ú load_lookups)Ú
analyze_pipesÚprint_pipe_analysisÚvalidate_attrs)Ú ConfigSchemaÚConfigSchemaInitÚConfigSchemaNlpÚConfigSchemaPretrainÚvalidate_init_settings)ÚScorer©Ú Tokenizer)ÚDoc)Ú
Underscore)ÚExampleÚvalidate_examples)Ú init_tok2vecÚ
init_vocab) Ú_DEFAULT_EMPTY_PIPESÚCONFIG_SECTION_ORDERÚSimpleFrozenDictÚSimpleFrozenListÚ_pipeÚcombine_score_weightsÚ raise_errorÚregistryÚwarn_if_jupyter_cupy)Ú BaseVectors)ÚVocabÚ create_vocabzdefault_config.cfgzdefault_config_pretraining.cfgÚ _AnyContextcóFeZdZUdZee¬«Zeed<eZ e
e e e
fed<eZeeee efed<eZeeee efed<eZeeee efed<dZeeed <eZeeed
<iZe
e efed <iZe
eee geffed <e «Z!e"e ed
<ddddœZ#y)Ú BaseDefaultsz¦Language data defaults, available via Language.Defaults. Can be
overwritten by language subclasses by defining their own subclasses of
Language.Defaults.
©Ú
section_orderÚconfigÚtokenizer_exceptionsÚprefixesÚsuffixesÚinfixesNÚ token_matchÚ url_matchÚsyntax_iteratorsÚlex_attr_gettersÚ
stop_wordsÚltrT)Ú directionÚhas_caseÚ has_letters)$Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrArQÚ__annotations__r,rRr
ÚstrrÚdictr*rSrrrrr+rTr)rUrVr r-rWrXrYÚintr ÚsetrZrÚwriting_system©óúOC:\Users\garci\AppData\Roaming\Python\Python312\site-packages\spacy/language.pyrNrNXññ
Ð*>Ô?€Fˆ?Ø2AИ$˜s D¨¡J˜ÑAØ8J€Hˆhx  c¨7 lÑ 3ÑJØ8J€Hˆhx  c¨7 lÑ 3ÑJØ7H€GˆXh˜u S¨' 
HØ&*€K˜*Ø$-€Iˆx˜Ñ-Ø,.Ðd˜3 ˜.Ø8:Ðd˜3 ¨#¨°¨Ñ 4Л5€JCÓ Ø#(°dÈ4ÑPNrjrNzspacy.Tokenizer.v1ÚreturnÚLanguagecódddtfd}|S)zRegistered function to create a tokenizer. Returns a factory that takes
the nlp object and returns a Tokenizer instance using the language detaults.
Únlprmrlc ó|jj}|jj}|jj}|rt j
|«j nd}|rt j|«j nd}|rt j|«jnd}t|j|jj||||jj|jj¬«S)N)ÚrulesÚ
prefix_searchÚ
suffix_searchÚinfix_finditerrVrW)ÚDefaultsrSrTrUr$Úcompile_prefix_regexÚsearchÚcompile_suffix_regexÚcompile_infix_regexÚfinditerr9ÚvocabrRrVrW)rorSrTrUrrrsrts rkÚtokenizer_factoryz+create_tokenizer.<locals>.tokenizer_factoryqØ—<<×(ˆØ—<<×(ˆØ—,,×&ˆÙFNœ×1°(Ó;×BÐTXˆ
ÙFNœ×1°(Ó;×BÐTXˆ
ÙGNœ×1°'Ó:×CÐTXˆÜØ I‰IØ—,,ן ×—l‘l×
ð
rjr8)r|s rkÚcreate_tokenizerr}ksð 
˜
¬ió
ð" Ðrjzspacy.LookupsDataLoader.v1có`tjjd|«t||¬«}|S)Nz+Loading lookups from spacy-lookups-data: %s)ÚlangÚtables)r$ÚloggerÚdebugr.)rr€Úlookupss rkÚload_lookups_datar„s(ä‡KÑÐCÀVÔ ¨VÔ4€GØ €Nrjcóü
eZdZUdZeZdZeee d<e
Z e e
j¬«ZiZeedfe d< dŸdiddd d
œd eeefd ed
eeefdeedgeegeffdeedgefdeddfdZˆfdZed«Zedeeeffd«Zej>deeefddfd«Zede fd«Z!e!j>de ddfd«Z!ede"efd«Z#ede"efd«Z$ede"e%ee&ffd«Z'ede"efd«Z(ede"e%ee&ffd«Z)ede"efd „«Z*edeeeffd!„«Z+edeee"effd"„«Z,e-d#edefd$„«Z.e-d#edefd%„«Z/e-d#eddfd&„«Z0e-d#eddddfd'„«Z1d#eddfd(„Z2d#ede fd)„Z3e-e «e4«e4«d*e «dd+œd#ed,eeefd-e5ed.e5ed/ed0eeee6fd1eedefd2„«Z7e-e4«e4«d*dd3œd#ed-e5ed.e5ed/ed1ee&ded4eff d5„«Z8gd6¢d*d7œd8e"ed9edeeeeffd:„Z9d#ede&fd;„Z: d e «ddd<œd=ed#eed>eeefd?ee d@ede&f dA„Z;dBedCdd#ede%e&effdD„Z< d ddddde «dddEœd=ed#eedFeeeefdGeeeefdHeedIeedCedd>eeefd?ee d@ede&fdJ„Z= d¡dFeeeefdGeeeefdHeedIeedef
dK„Z>d#edefdL„Z?e «ddMœd#ed=ed>eeefd@ede&f
dN„Z@dOedPeddfdQ„ZAd#ede%ee&ffdR„ZBd#eddfdS„ZCd#eddfdT„ZDe4«ddUœdVeeefdWe5edXeeeeeeffdefdY„ZEd¢d[„ZFddd\œdWeeee5efd]eeee5efddZfd^„ZGdVedefd_„ZHd`eeeeIfdefda„ZJd`eeeeIfdbeKdefdc„ZL d ddddde4«e4«deœdfe5eMdgeedhe6dieeNdjeeee6fdXeeeeeeffdke5edle5efdm„ZOddde4«dnœdfe5eMdieeNdjeeee6fdXeeeeeeffdke5edeee6ff do„ZP d ddpœdqeege5eMfdieeNdeNfdr„ZQ d ddpœdqeege5eMfdieeNdeNfds„ZRddpœdieeNdeNfdt„ZSdueee&e"eeTgeUffdv„ZVddddd*dwœdfe5eMdeedxeeWdXeeeeeeffdyeeeefdzedeeeffd{„ZXd|„ZYeZd}ee[fd~„«Z\e]d4d4d4d4d4dœd€e5eeefde^d*deedWe5edXeeeeeeffdede_efdƒ„«Z`e]d4d4d4d4d4dœd€e5e%eeefeKfde^ddeedWe5edXeeeeeeffdede_e%eeKffd„„«Z`d*de4«dd…dœd€ee5eeefe5e%eeefeKffdedeedWe5edXeeeeeeffdedee_ee_e%eeKfffd†„Z`dWe5efd‡„Zad€e5eeefdˆe5ed4e_efdedede_ef
d‰„Zbd£dŠ„Zce-ifdededede «ddd‹œd>eeeefe fd eeefdWeee5efd]eee5efdkeee5efd
eeefdŒed@eddfd«ZedŽedede5eddfd‘„ZfeZd deegde_egfd“„«Zhe4«d”œd•eeeifdke5eddfd–„ZjekdWeee5efd]eee5efd—e5ede%ed4ffd˜„«Zle4«e «d™œd•eeeifdke5edšeeefddfd›„Zme4«d”œdke5edeIfdœ„Zne4«d”œdeIdke5eddfdž„ZoˆxZpS)¤rmaRA text-processing pipeline. Usually you'll load this once per process,
and pass the instance around your application.
Defaults (class): Settings, data and factory methods for creating the `nlp`
object and processing pipeline.
lang (str): IETF language code, such as 'en'.
DOCS: https://spacy.io/api/language
Nr©ÚerrorÚ FactoryMetaÚ
_factory_metaTi@B)Ú
max_lengthÚmetar}Úcreate_vectorsÚ
batch_sizer{rr}rJrrlc óžtjjj«tj |j «|_t|«|_ d|_
d|_ i|_ i|_
t|t«s;|dur7t!t"j$j'|t)t«¬««|dur|j+di«j+d«}t-|j.|j0|¬«}|s,d|jddi} tj2| «d}||«|_no|j.rc|j.rW|j.|j.k7r>t!t"j6j'|j.|j.¬««||_|j.|j8j.|_g|_t=«|_||_ |s,d |jdd i}
tj2|
«d }||«|_!||_"tF|_$y)
aInitialise a Language object.
vocab (Vocab): A `Vocab` object. If `True`, a vocab is created.
meta (dict): Custom meta data for the Language class. Is written to by
models to add model meta data.
max_length (int): Maximum number of characters in a single text. The
current models may run out memory on extremely long texts, due to
large internal allocations. You should segment these texts into
meaningful units, e.g. paragraphs, subsections etc, before passing
them to spaCy. Default maximum length is 1,000,000 charas (1mb). As
a rule of thumb, if all pipeline components are enabled, spaCy's
default models currently requires roughly 1GB of temporary memory per
100,000 characters in one text.
create_tokenizer (Callable): Function that takes the nlp object and
returns a tokenizer.
batch_size (int): Default batch size for pipe and evaluate.
DOCS: https://spacy.io/api/language#init
NT)r{Ú
vocab_typeÚvectorsÚname)Ú vectors_namero)ror{Ú tokenizer)%r$rGÚ_entry_point_factoriesÚget_allÚDEFAULT_CONFIGÚmergeÚdefault_configÚ_configreÚ_metaÚ_pathÚ
_optimizerÚ
_pipe_metaÚ
_pipe_configsÚ
isinstancerJÚ
ValueErrorr&ÚE918ÚformatÚtypeÚgetrKrruÚresolverÚE150r{Ú _componentsrgÚ _disabledrŠr“rrFÚdefault_error_handler) Úselfr{rr}rÚkwargsrÚ vectors_cfgÚ
tokenizer_cfgs rkÚ__init__zLanguage.__init__žôB
×+¨D×,?Ñ,?ÓŒ ܘ$“ZˆŒ
؈Œ
Ø/3ˆŒà46ˆŒØ02ˆÔä˜%¤Ô'¨E¸Ñ,=ÜœVŸ[™[×/°eÌÌUË Ð D‰=ØŸ8™8 I¨rÓ2×6°vÓ>ˆLÜ  §¡¨D¯M©MÈ ÔUˆEÙ(¨$¯,©,°uÑ*=¸iÑ*HÐI Ü!)×!1Ñ!1°+Ó!>¸yÑ!IÙ*¨5Ó1ˆE ˜eŸjšj¨t¯y©y¸E¿J¹JÒ/FÜ ¤§¡×!3Ñ!3¸¿ ¹ ÈÏÉÐ!3Ó!TÓŒ
Ø 9‰9Ð ØŸ
ŸˆDŒIØ;=ˆÔÜ#&£5ˆŒØŒáØ(¨$¯,©,°uÑ*=¸kÑ*JÐKˆ'×
Ó>¸{Ñ Ù)¨$ÓŒØ$ˆŒÜ%0ˆÕ"rjc ó¸t|di|¤Žtj|jj
«|_|j|j dd<y)Nrorri)ÚsuperÚ__init_subclass__rr—rurQr˜r)Úclsr«Ú __class__s €rkzLanguage.__init_subclass__ãsIø€Ü
Ñ+ FÒ+×1°#·,±,×2EÑ2EÓÔØ,/¯H©Hˆ×ј! )rjcó|jS©N)r©s rkÚpathz
Language.pathès àz‰zÐrjcóŠtjtj«}|jj
r1|j jd|jj
«n&|j jd|j
«|j jdd«|j jdd«|j jd|«|j jdd«|j jd d«|j jd
d«|j jd d«|j jd d«|j jd
t«|jjt|jj«|jjj|jjj|jjjdœ|j d<t|j «|j d<t#|j$«|j d<t#|j&«|j d<t#|j(«|j d<|j S)zßCustom meta data of the language class. If a model is loaded, this
includes details from the model's meta.json.
RETURNS (Dict[str, Any]): The meta.
DOCS: https://spacy.io/api/language#meta
rrÚpipelineÚversionz0.0.0Ú
spacy_versionÚ descriptionÚÚauthorÚemailÚurlÚlicenseÚspacy_git_version)ÚwidthrÚkeysrÚmoderÚlabelsÚ
componentsÚdisabled)r$Úget_minor_version_ranger"Ú __version__r{rÚ
setdefaultr(Úvectors_lengthÚlenrÚn_keysrreÚ pipe_labelsÚlistÚ
pipe_namesÚcomponent_namesrÈ)s rkrz
Language.metaìô×4´U×5FÑ5FÓGˆ
Ø :‰:?Š?Ø J‰J× ! &¨$¯*©*¯/©/Õ J‰J× ! &¨$¯)©)Ô 
×јf 
×јÔ
×јo¨}Ô
×јm¨RÔ
×јÔ
×јg 
×јe 
×јÔ
×ÑÐ1´;Ô—Z‘Zט4Ÿ:™:×—JJ×&×—JJ×&×—JJ×&× !
ˆ
ô $ D×$4Ñ$4Ó5ˆ
ô"& d§o¡oÓ!6ˆ
Ü#'¨×(<Ñ(<Ó#=ˆ
 Ü!% d§m¡mÓ!4ˆ
Øz‰zÐrjÚvaluecó||_y)©s rkrz
Language.metas àˆ
rjcóv|jjdi«|jjdi«|j|jdd<i}g}|jD]_}|j |«}|j |«}d|j i|¥||<|jsŒE|j|j«Œat|j«|jdd<t|j«|jdd<||jd<|jdjdi«}t||«}||jdd<tj|j«s3tt j"j%|j¬ ««|jS)
z÷Trainable config for the current language instance. Includes the
current pipeline components, as well as default training config.
RETURNS (thinc.api.Config): The config.
DOCS: https://spacy.io/api/language#config
roÚtrainingrÚfactoryr¹Ú
score_weights©rQ)r™rÚ
get_pipe_metaÚget_pipe_configrØÚdefault_score_weightsÚappendrÐrEÚsrslyÚis_json_serializabler r&ÚE961r¢)Ú pipe_nameÚ pipe_metaÚ pipe_configÚ prev_weightsÚcombined_score_weightss rkrQzLanguage.configszð
×Ñ  rÔ ×Ñ 
¨BÔ/Ø&*§i¡iˆ ˜Fш؈
Ø×-ˆIØ×*¨9Ó5ˆIØ×.¨yÓ9ˆKØ#,¨i×.?Ñ.?Ð"OÀ;Ð"OˆH Ø××$ Y×%DÑ%DÕ  +/¨t×/CÑ/CÓ*Dˆ ˜'Ü*.¨t¯}©}Ó*=ˆ ˜'Ø%-ˆ —|| /×3°OÀRÓHˆ Ü!6°}ÀlÓ!SÐØ4Jˆ   Ñ×)¨$¯,©,ÔœVŸ[™[×/°t·|±|Ð |‰|Ðrjcó||_y)r™s rkrQzLanguage.config9s àˆ rjcó¾|jDcgc]\}}||jvsŒ|Œ}}}t|tjj d¬«¬«Scc}}w)ziGet the names of all disabled components.
RETURNS (List[str]): The disabled components.
©Úattrr†©rCr&ÚE926r¢)rÚnamess rkzLanguage.disabled=sTð&*×%5Ò%5ÔPÑ%5™'˜$ ¸ÀÇÁÒ9O’Ð%5ˆÑ ¬V¯[©[×-?Ñ-?ÀZÐ-?Ó-PÔQùóQs
A§Acó^t|jj««}t|«S)z_Get names of all available factories.
RETURNS (List[str]): The factory names.
)Ú factoriesrÄrC©s rkÚ
factory_nameszLanguage.factory_namesHs&ô T—^+ˆÜ Ó&rjcólt|jtjj d¬«¬«S)zoGet all (name, component) tuples in the pipeline, including the
currently disabled components.
r†)rCr&s rkzLanguage.componentsQs.ô
 Ø × Ñ ¤F§K¡K×$6Ñ$6¸LÐ$6Ó$Iô
ð
rjcó |jDcgc]\}}|Œ }}}t|tjj d¬«¬«Scc}}w)zÂGet the names of the available pipeline components. Includes all
active and inactive pipeline components.
RETURNS (List[str]): List of component name strings, in order.
r†)rCr&©s rkzLanguage.component_namesZsJð04×/?Ò/?Ô@Ñ/?™|˜y¨!Ð/?ˆÑ ¬V¯[©[×-?Ñ-?ÐEVÐ-?Ó-WÔXùóAó A
cóÂ|jDcgc]\}}||jvsŒ||fŒ}}}t|tjj d¬«¬«Scc}}w)zòThe processing pipeline consisting of (name, component) tuples. The
components are called on the Doc in order as it passes through the
pipeline.
RETURNS (List[Tuple[str, Callable[[Doc], Doc]]]): The pipeline.
r†)Úpipess rkzLanguage.pipelinedsXð%)×$4Ò$4ÔPÑ$4™D˜A˜q¸ÀÇÁÒ8O!Q’Ð$4ˆÑ ¬V¯[©[×-?Ñ-?ÀZÐ-?Ó-PÔQùóQs
A§Acó |jDcgc]\}}|Œ }}}t|tjj d¬«¬«Scc}}w)zƒGet names of available active pipeline components.
RETURNS (List[str]): List of component name strings, in order.
r†)rCr&s rkzLanguage.pipe_namesosDð 04¯}ª}Ô=©}™|˜y¨!’¨}ˆÑ ¬V¯[©[×-?Ñ-?À\Ð-?Ó-RÔSùó>röcó€i}|jD]#\}}|j|«j||<Œ%t|«S)z—Get the component factories for the available pipeline components.
RETURNS (Dict[str, str]): Factory names, keyed by component names.
)rB)Úpipes rkÚpipe_factorieszLanguage.pipe_factoriesxsCð ˆ Ø#×/‰OˆItØ#'×#5Ñ#5°iÓ#@×#HÑ#HˆI ð  Ó*rjcóÄi}|jD]E\}}t|d«r|jdurŒ!t|d«sŒ.t|j«||<ŒGt |«S)zéGet the labels set by the pipeline components, if available (if
the component exposes a labels property and the labels are not
hidden).
RETURNS (Dict[str, List[str]]): Labels keyed by component name.
Ú hide_labelsTrÆ)ÚhasattrrrB)rs rkzLanguage.pipe_labelsƒs`ðˆØ×*‰JˆDt˜×0@Ñ0@ÀDÑ0HØÜt˜# D§K¡KÓ0t ð 
  Ó'rjrcóp|j|«}|tjvxs|tjvS)z=RETURNS (bool): Whether a factory of that name is registered.)Úget_factory_namerG©rÚ
internal_names rkÚ has_factoryzLanguage.has_factory“s5ð×,¨TÓ
Ø”x×P¨]¼h×>PÑ>PÐ-PÐPrjcó@|j|S|jd|S)zŸGet the internal factory name based on the language subclass.
name (str): The factory name.
RETURNS (str): The internal factory name.
ú.)r)rs rkrzLanguage.get_factory_name™s(ð 8‰8Р؈KØ—(‘(˜1˜T˜#rjcóì|j|«}||jvr|j|S||jvr|j|Sttjj d|¬««)z°Get the meta information for a given factory name.
name (str): The component factory name.
RETURNS (FactoryMeta): The meta for the given factory name.
©rr)rr‰r r&ÚE967r¢rs rkÚget_factory_metazLanguage.get_factory_meta¤sqð×,¨TÓ
Ø ˜C× ×$ ]Ñ 3× ×$ TÑ œŸ×ÀÐGrjcó@||j|j|«<y)zšSet the meta information for a given factory name.
name (str): The component factory name.
value (FactoryMeta): The meta to set.
N)r‰r)rs rkÚset_factory_metazLanguage.set_factory_meta²sð9>ˆ×ј#×.¨tÓ5rjcó||jvr*ttjj d|¬««|j|S)z¬Get the meta information for a given component name.
name (str): The component name.
RETURNS (FactoryMeta): The meta for the given component name.
Ú componentr
)rr r&r ©rs rkzLanguage.get_pipe_meta»s>ð t—Ñ œVŸ[™[×/°[ÀtÐ ˜$rjcó’||jvr)ttjj |¬««|j|}|S)z±Get the config used to create a pipeline component.
name (str): The component name.
RETURNS (Config): The config used to create the pipeline component.
©r)r r&ÚE960r¢)rs rkzLanguage.get_pipe_configÅsEð  œVŸ[™[×/°TÐ ×Ñ ØÐrjF)r˜ÚassignsÚrequiresÚ retokenizesrÝÚfuncr˜rrrrcó°tt«s)ttjj d¬««dvr)ttj j ¬««tt«s6tjj dt«¬«}t|«dtdtfˆˆˆˆˆˆˆfd „ } || |«S| S)
a~Register a new pipeline component factory. Can be used as a decorator
on a function or classmethod, or called as a function with the factory
provided as the func keyword argument. To create a component and add
it to the pipeline, you can use nlp.add_pipe(name).
name (str): The name of the component factory.
default_config (Dict[str, Any]): Default configuration, describing the
default values of the factory arguments.
assigns (Iterable[str]): Doc/Token attributes assigned by this component,
e.g. "token.ent_id". Used for pipeline analysis.
requires (Iterable[str]): Doc/Token attributes required by this component,
e.g. "token.ent_id". Used for pipeline analysis.
retokenizes (bool): Whether the component changes the tokenization.
Used for pipeline analysis.
default_score_weights (Dict[str, Optional[float]]): The scores to report during
training, and their default weight towards the final score used to
select the best model. Weights should sum to 1.0 per component and
will be combined and normalized for the whole pipeline. If None,
the score won't be shown in the logs or be weighted.
func (Optional[Callable]): Factory function if not used as a decorator.
DOCS: https://spacy.io/api/language#factory
©Ú decoratorrrzdefault config©ÚstylerÚcfg_typeÚ factory_funcrlc
óòj
«}|tjvrbtjj|«}t j
||«s-t jj
||¬«}t|«t j|«}d|vsd|vr)tt jj
¬««tjj||¬«t
t«t «t‰ j!««‰ ‰ ¬«}j#
|«t%tjj'«t j(¬«_|S)N)rrÚnew_funcrorr)r)r˜rrÚscoresrÝrr†)rrGr$Ú is_same_funcr&ÚE004r¢r Ú
get_arg_namesÚE964Úregisterrˆr1rrBr•ÚE957)
rrÚ
existing_funcÚerrÚ arg_namesÚ factory_metarr˜rrrs
€€€€€€€rkÚ add_factoryz%Language.factory.<locals>.add_factoryýsDø€Ø×Ó6ˆMØ¤× 2Ñ 2Ñ
!)× 2Ñ 2× 6Ñ 6°}Ó E
Ü×°}Ô Ÿ+™+×
À ð% S×*¨<Ó8ˆIؘIѰyÑ)@Ü ¤§¡×!3Ñ!3¸Ð!3Ó!>Ó
× Ñ ×
¸ Ø& ÓÐ1×9Ø&;؈
× Ñ   
×"×,´F·K±KôˆCŒMð Ð rj) rdr r&ÚE963r¢ÚE853reÚE962r£r )
rr˜rrrrr*r-s
``````` rkzLanguage.factoryÐþ€ôF˜$¤ÔœVŸ[™[×/¸)Ð $‰;ÜœVŸ[™[×/°TÐ ˜.¬$Ô—+&¨T¼DÀÓ<Pðˆ˜S“/Ð ' ¤hð' ´' ó' ðR Ð Ù˜ Ðrj©rrrr.cóZftt«s)ttjj d¬««dvr)ttj j ¬««ntj«Šdtdtfˆˆˆˆˆˆˆfd }|«S|S)Register a new pipeline component. Can be used for stateless function
components that don't require a separate factory. Can be used as a
decorator on a function or classmethod, or called as a function with the
factory provided as the func keyword argument. To create a component and
add it to the pipeline, you can use nlp.add_pipe(name).
name (str): The name of the component factory.
assigns (Iterable[str]): Doc/Token attributes assigned by this component,
e.g. "token.ent_id". Used for pipeline analysis.
requires (Iterable[str]): Doc/Token attributes required by this component,
e.g. "token.ent_id". Used for pipeline analysis.
retokenizes (bool): Whether the component changes the tokenization.
Used for pipeline analysis.
func (Optional[Callable[[Doc], Doc]): Factory function if not used as a decorator.
DOCS: https://spacy.io/api/language#component
rrrrÚcomponent_funcrlcóät
t«r)ttjj ‰ ¬««dt dtfˆfd }j «}|tjvrdtjj|«}|j}|r|Dcgc]}|jŒc}dnd}tj|«r|}j!‰ ‰
|¬«Scc}w)NrrrlcóSri)rorr3s €rkrz?Language.component.<locals>.add_component.<locals>.factory_funcPs ø€Ø%rjrr1)r r&ÚE965r¢rdÚ PipeCallablerrGÚ __closure__Ú
cell_contentsr$r#)r3rrr)ÚclosureÚwrappedrÚcomponent_namerrrrs` €€€€€€€rkÚ
add_componentz)Language.component.<locals>.add_componentLù€Ü˜$¤Ô ¤§¡×!3Ñ!3¸Ð!3Ó!HÓ
ð
&´ õ
 ×Ó6ˆMØ¤× 2Ñ 2Ñ!)× 2Ñ 2× 6Ñ 6°}Ó E
Ø'×3ÙCJ±GÓ<±G¨q˜1Ÿ??°GÑ<¸?ÐPTÜ×$ W¨nÔ=Ø#0 K‰KØØØ
ô
ð !ùò=sÂ"C-) rdr r&r.r/r$Úget_object_namer7r )rrrrrr>r=s`````` @rkrzLanguage.component*þ€ð6 Рܘd¤CÔ ¤§¡×!3Ñ!3¸kÐ!3Ó!JÓd‰{Ü ¤§¡×!3Ñ!3¸Ð!3Ó!>Ó?Ø!%Ð!1™´t×7KÑ7KÈDÓ7Qˆð "¬,ð "¼8÷ "ð> Ð Ù  Ó Ðrj)rrr"r)ÚprettyrÄr@có>t||¬«}|r
t||¬«|S)aAnalyze the current pipeline components, print a summary of what
they assign or require and check that all requirements are met.
keys (List[str]): The meta values to display in the table. Corresponds
to values in FactoryMeta, defined by @Language.factory decorator.
pretty (bool): Pretty-print the results.
RETURNS (dict): The data.
))r/r0)r@Úanalysiss rkr/zLanguage.analyze_pipesos"ô! ¨DÔÙ Ü  ¨tÕ ˆrjcó¤|jD]\}}||k(sŒ |cSttjj ||j
¬««)zßGet a pipeline component for a given component name.
name (str): Name of pipeline component to get.
RETURNS (callable): The pipeline component.
DOCS: https://spacy.io/api/language#get_pipe
©rÚopts)ÚKeyErrorr&ÚE001r¢)rrs rkÚget_pipezLanguage.get_pipesNð%)×$4Ô$4Ñ ˆI˜DÓ Ø Ò ð%5ô”v—{‘{×)¨t¸$×:NÑ:NÐPrj)rQÚ
raw_configÚvalidateÚ factory_namerQrIrJcó2||n|}t|t«s6tjj d|t |«¬«}t
|«tj|«s)t
tjj |¬««|j|«setjj |dj|j«dtj|«|j ¬«}t
|«|j#|«}|j$r$t'|j$«j)|«}|j+|«}|t,j.vr|}||dœ|¥d |i¥}||i} t-j0| |¬
«}
t-j2d | |i|¬
«d } t'| «} || d <| j5d d«| j5d
d«| j5dd«|r| j)|«} | |j6|<|
|S)aCreate a pipeline component. Mostly used internally. To create and
add a component to the pipeline, you can use nlp.add_pipe.
factory_name (str): Name of component factory.
name (Optional[str]): Optional name to assign to component instance.
Defaults to factory name if not set.
config (Dict[str, Any]): Config parameters to use for this component.
Will be merged with default config, if available.
raw_config (Optional[Config]): Internals: the non-interpolated config.
validate (bool): Whether to validate the component config against the
arguments and types expected by the factory.
RETURNS (Callable[[Doc], Doc]): The pipeline component.
DOCS: https://spacy.io/api/language#create_pipe
NrQrú, Ú create_pipe)rrEÚmethodrÚ lang_code)rorz
@factories)rJÚcfgrØror)rer&r0r rÚE002Újoinròr$r?rr r˜rr—rrGÚfillÚpoprž) rKrrQrIrJr*rrQÚresolvedÚfilleds rkrNzLanguage.create_pipeð0Ð'‰t¨\ˆÜ˜&¤$Ô—++×$¨8¸$ÌÈfËÐVˆCܘS“/Ð ×)¨&ÔœVŸ[™[×/°vÐ ×Ñ  Ô—+‘+×—Y‘Y˜t××)¨$ÓŸ)™)ð ˆCô˜S“/Ð ×)¨,Ó7ˆ ð × ˜I×;¸FÓCˆFØ×-¨lÓ
ð ¤× 2Ñ 2Ñ (ˆMð tÑS¨vÐS°|À]Ñð˜VÐô×# C°(ÔÜ  s¨<Ñ'8Ð9ÀHÔMÈeÑܘˆØˆyÑØ
< Ô 
5˜Ø
6˜4Ô ñ Ø—\‘\ *Ó-ˆFØ#)ˆ×ј4Ñ Ø˜ Ñ%rjÚ source_nameÚsourcec óât|t«s3ttjj |t
|«¬««|jj|jjk7r3tjtjj |¬««||jvrcttjj ||j dd|j ddj#|j«¬««|j%|«}t'|d«r||_|j*j-«}t/j0|d|«}||j2|<|jj4|jj4k7r@|jj4D]'}|jj4j7|«Œ)||d fS)
auCreate a pipeline component by copying it from an existing model.
source_name (str): Name of the component in the source pipeline.
source (Language): The source nlp object to copy from.
name (str): Optional alternative name to use in current pipeline.
RETURNS (Tuple[Callable[[Doc], Doc], str]): The component and its factory name.
)rrYrrrrM)rÚmodelrE)rmr r&ÚE945r¢r{rÚwarningsÚwarnr'ÚW113rÒrFÚE944rrSrHrrrQÚ interpolater$Ú copy_configržÚstringsÚadd)rXrYrÚ
source_configräÚss rkÚcreate_pipe_from_sourcez Language.create_pipe_from_sourceØsô˜&¤(ÔœVŸ[™[×/°[ÌÈfËÐ :‰:× Ñ  §¡×!5Ñ!5Ò M‰Mœ(Ÿ-™-×.°KÐ ˜f× Ü ×#Ÿ[™[¨Ñ°6·;±;¸vÑ3FÐ2GП 6×#9Ñ#9Óóð
ð˜{Óô Ô ØˆDŒIðŸ
×3ˆ
Ü×& }°\Ñ'BÀ;Ñ'OÓPˆ Ø#.ˆ×ј4Ñ Ø :‰:× Ñ  §¡×!5Ñ!5Ò —\‘\×)Ø
×"×& [ Ñ+rj)ÚbeforeÚafterÚfirstÚlastrYrQrIrJrhrirjrkcóÐt|t«s7t|«} tjj | |¬«} t
| «||n|}||jvr4t
tjj ||j¬««d|vrBtjtjj |jd«¬««||j|||¬«\}
}n|j|||| |
¬«}
|j!||||«}|j#|«|j$|<|j&j)|||
f«|j+«|
S)Add a component to the processing pipeline. Valid components are
callables that take a `Doc` object, modify it and return it. Only one
of before/after/first/last can be set. Default behaviour is "last".
factory_name (str): Name of the component factory.
name (str): Name of pipeline component. Overwrites existing
component.name attribute if available. If no name is set and
the component exposes no name attribute, component.__name__ is
used. An error is raised if a name already exists in the pipeline.
before (Union[str, int]): Name or index of the component to insert new
component directly before.
after (Union[str, int]): Name or index of the component to insert new
component directly after.
first (bool): If True, insert component first in the pipeline.
last (bool): If True, insert component last in the pipeline.
source (Language): Optional loaded nlp object to copy the pipeline
component from.
config (Dict[str, Any]): Config parameters to use for this component.
Will be merged with default config, if available.
raw_config (Optional[Config]): Internals: the non-interpolated config.
validate (bool): Whether to validate the component config against the
arguments and types expected by the factory.
RETURNS (Callable[[Doc], Doc]): The pipeline component.
DOCS: https://spacy.io/api/language#add_pipe
©rrrDr)Úname_in_configr)rrQrIrJ)rdÚreprr&ÚE966r¢r ÚE007r]r^r'ÚW119rUrgrNÚ_get_pipe_indexr rÚinsertÚ_link_components)rKrrhrirjrkrYrQrIrJÚbad_valr*Úpipe_componentÚ
pipe_indexs rkÚadd_pipezLanguage.add_pipeÿsXôP˜Ô˜<Ó(ˆGÜ—+$¨w¸TÐBˆCܘS“/Ð Ð'‰t¨\ˆØ 4× œVŸ[™[×/°TÀ×@TÑ@TÐ  Ü M‰Mœ(Ÿ-™-×.¸f¿j¹jÈÓ>PÐ Ð ð,0×+GÑ+Gؘf¨4ð,Hó,Ñ (ˆN™Lð"×ØØØ ˆNð×)¨&°%¸ÀÓEˆ
Ø $× 5Ñ 5°lÓ Cˆ˜ÑØ ×Ñ×Ñ 
¨T°>Ð,BÔ ×ÑÔØÐrjcóÐ||||dœ}td||||fD««dk\r4ttjj ||j
¬««|st
d|||fD««st|j«S|ryt|t«r]||j
vr4ttjj ||j
¬««|j
j|«St|t«r`||j
vr4ttjj ||j
¬««|j
j|«dzSt|«tk(rV|t|j«k\s|dkr7tjj d ||j
¬
«}t|«|St|«tk(rY|t|j«k\s|dkr7tjj d ||j
¬
«}t|«|dzSttjj ||j
¬««) Determine where to insert a pipeline component based on the before/
after/first/last values.
before (str): Name or index of the component to insert directly before.
after (str): Name or index of component to insert directly after.
first (bool): If True, insert component first in the pipeline.
last (bool): If True, insert component last in the pipeline.
RETURNS (int): The index of the new pipeline component.
)rhrirjrkc3ó$K|]}|duŒ
y­wri)Ú.0Úargs rkú <genexpr>z+Language._get_pipe_index.<locals>.<genexpr>Vsèø€ÐGÑ*F 3ˆs˜$ŒÑ*Fùóé)ÚargsrEc3ó$K|]}|duŒ
y­wri)r|s rkr~z+Language._get_pipe_index.<locals>.<genexpr>Zsèø€ÐQÑ:P°˜5¨Ô,Ñ:PùrrrDr!rh)ÚdirÚidxrEri)Úsumr r&ÚE006r¢ÚanyrÍrdrGÚindexr£rfÚE959)rhrirjrkÚall_argsr*s rkrszLanguage._get_pipe_indexEs'ð %¨u¸uÈdÑÜ ÑG¨6°5¸%ÀÑ*FÓ GÈ1Ò Ü ×°t×7KÑ7KÐð
ñ ”sÑQ¸5À&È%Ñ:PÓt×
ØÜ
˜¤Ô
˜T× Ü—KK×&¨F¸×9MÑ9MÐðð×'×-¨fÓ
˜œsÔ
˜D× Ü—KK×&¨E¸×8LÑ8LÐðð×'×-¨eÓ4°qÑ &\œSÒ
Øœ˜T×.°&¸1²*Ü—kk×  f°4×3GÑ3Gðô“oЈMÜ
%[œCÒ
Øœ˜D׸²Ü—k‘k× U°×1EÑ1Eðô“oИ1‘9Ð ÜœŸ×À×@TÑ@TÐVrjcó||jvS)a Check if a component name is present in the pipeline. Equivalent to
`name in nlp.pipe_names`.
name (str): Name of the component.
RETURNS (bool): Whether a component of the name exists in the pipeline.
DOCS: https://spacy.io/api/language#has_pipe
)rs rkÚhas_pipezLanguage.has_pipe|sðt—Ð&rj)rQrJcó||jvr4ttjj ||j
¬««t
|d«r5tjj t|«|¬«}t|«|jj|«}|j|«t|j«r|t|j«k(r|j||||¬«S|j|||||¬«S)aBReplace a component in the pipeline.
name (str): Name of the component to replace.
factory_name (str): Factory name of replacement component.
config (Optional[Dict[str, Any]]): Config parameters to use for this
component. Will be merged with default config, if available.
validate (bool): Whether to validate the component config against the
arguments and types expected by the factory.
RETURNS (Callable[[Doc], Doc]): The new pipeline component.
DOCS: https://spacy.io/api/language#replace_pipe
rDÚ__call__rm)rrQrJ)rrhrQrJ)r r&rGrÚE968rorˆÚ remove_piperÍry)rrKrQrJr*rxs rkÚ replace_pipezLanguage.replace_pipe‡ð(  œVŸ[™[×/°TÀÇÁÐ < Ô —++×$¬t°LÓ/AÈÐMˆCܘS“/Ð ×Ó
Ø ×јÔÜ
´c¸$×:JÑ:JÓ6KÒ(Kà—= 4°Àðð
ð—=‘=ØØØØ ð
rjÚold_nameÚnew_namecóØ||jvr4ttjj ||j¬««||jvr4ttj
j ||j¬««|jj
|«}||j|df|j|<|jj|«|j|<|jj|«|j|<||jddvr6|jddj|«}||jdd|<|j«y)zËRename a pipeline component.
old_name (str): Name of the component to rename.
new_name (str): New name of the component.
DOCS: https://spacy.io/api/language#rename_pipe
rDr!Ú
initializerÇN)
r r&rGrqrˆrrUr™ru)rr“Úinit_cfgs rkÚ rename_pipezLanguage.rename_pipe²sIð ˜4× Ü ×°t×7KÑ7KÐð
ð  Ü ×°t×7KÑ7KÐð
ð
× Ñ × &  0ˆØ×)9Ñ)9¸!Ñ)<¸QÑ)?Ð@ˆ×Ñ˜ÑØ$(§O¡O×$7Ñ$7¸Ó$Aˆ˜Ñ!Ø'+×'9Ñ'9×'=Ñ'=¸hÓ'Gˆ×ј t—|‘| LÑ1°,Ñ —|| LÑ1°,Ñ?×CÀHÓMˆHØAIˆDL‰L˜Ñ &  4°XÑ  ×ÑÕrjcó’||jvr4ttjj ||j¬««|j
j
|jj|««}|jj
|«|jj
|«|jjdi«j
|d«||jddvr!|jddj
|«||jvr|jj|«|j!«|S)aRemove a component from the pipeline.
name (str): Name of the component to remove.
RETURNS (Tuple[str, Callable[[Doc], Doc]]): A `(name, component)` tuple of the removed component.
DOCS: https://spacy.io/api/language#remove_pipe
rDÚ_sourced_vectors_hashesNr•)r r&rGrUrˆrrr™Úremoveru)rÚremoveds rkrzLanguage.remove_pipeÌsð  œVŸ[™[×/°TÀ×@TÑ@TÐ ×"×& t×';Ñ';×'AÑ'AÀ$Ó'GÓHˆð
×јDÔ ×Ñ×јtÔ
ÐÓ8¸¸ 4—<<  Ñ-¨lÑ L‰L˜Ñ &  4× 8¸Ô 4—= Ø N‰N× ! $Ô  ×ÑÔØˆrjcó¾||jvr4ttjj ||j¬««|j
j
|«y)aDisable a pipeline component. The component will still exist on
the nlp object, but it won't be run as part of the pipeline. Does
nothing if the component is already disabled.
name (str): The name of the component to disable.
rDN)r r&rGrdrs rkÚ disable_pipezLanguage.disable_pipeåsIð  œVŸ[™[×/°TÀ×@TÑ@TÐ  ×ј4Õ rjcóÜ||jvr4ttjj ||j¬««||j
vr|j j|«yy)zÑEnable a previously disabled pipeline component so it's run as part
of the pipeline. Does nothing if the component is already enabled.
name (str): The name of the component to enable.
rDN)r r&rGrrs rkÚ enable_pipezLanguage.enable_pipeðsZð  œVŸ[™[×/°TÀ×@TÑ@TÐ 4—= Ø N‰N× !   !rj)ÚdisableÚ
component_cfgÚtextr¡c óš|j|«}|i}|jD\}}||vrŒ t|d«s3ttj
j
t|«|¬««|j}t|d«r|j«} ||fi|j|i«¤Ž}t|t«rŒttj j
|t|«¬««|S#t$r/}ttjj
|¬««|d}~wt$r}||||g|«Yd}~Œ—d}~wwxYw)Apply the pipeline to some text. The text can span multiple sentences,
and can contain arbitrary whitespace. Alignment into the original string
is preserved.
text (Union[str, Doc]): If `str`, the text to be processed. If `Doc`,
the doc will be passed directly to the pipeline, skipping
`Language.make_doc`.
disable (List[str]): Names of the pipeline components to disable.
component_cfg (Dict[str, dict]): An optional dictionary with extra
keyword arguments for specific components.
RETURNS (Doc): A container for accessing the annotations.
DOCS: https://spacy.io/api/language#call
NrŽrmÚget_error_handlerr)rÚ
returned_type)Ú _ensure_docr¹rr r&ÚE003r¢rFÚE109Ú ExceptionrŸr:ÚE005) rªÚdocrÚprocÚ
error_handlerÚes rkzLanguage.__call__ûs2ð*×јtÓØ Р؈MØŸ-œ-‰JˆDw‰ØÜ˜4 Ô ¤§¡×!3Ñ!3¼dÀ4»jÈtÐ!3Ó!TÓ ×6ˆ1Ø $× 6Ñ 6Ó 8
ð
˜> -×"3Ñ"3°D¸"Ó"=Ñ>ô ˜c¤3Õ ¤§¡×!3Ñ!3¸ÌTÐRUËYÐ!3Ó!WÓXð!(ð"ˆ
øôò
Gä ¤§¡×!3Ñ!3¸Ð!3Ó!>Ó?ÀQÐFûÜò
˜d D¨3¨%°×3ûð
4ús$ÂC5Ã5 E
Ã>*D(Ä( E
Ä4 EÅE
Ú
DisabledPipescóÎtjtjt«t |«dk(rt
|dttf«r|d}|j|¬«S)aVDisable one or more pipeline components. If used as a context
manager, the pipeline will be restored to the initial state at the end
of the block. Otherwise, a DisabledPipes object is returned, that has
a `.restore()` method you can use to undo your changes.
This method has been deprecated since 3.0
r!r))
r]r^r'ÚW096ÚDeprecationWarningrÍÚtupleÚ select_pipesrñs rkÚ
disable_pipeszLanguage.disable_pipes&sPô 
”h—m‘mÔ%7Ô ˆu‹:˜Š?œz¨%°©(´T¼5°MÔ˜!‘HˆEØ× Ñ ¨Ð Ó/rj)Úenabler·có´||ttj«t|t«r|g}|ot|t«r|g}|j
Dcgc] }||vsŒ|Œ }}|:||k7r5ttj j|||j
¬««|}|J|Dcgc]}||jvsŒ|Œ}}t||«Scc}wcc}w)aDisable one or more pipeline components. If used as a context
manager, the pipeline will be restored to the initial state at the end
of the block. Otherwise, a DisabledPipes object is returned, that has
a `.restore()` method you can use to undo your changes.
disable (str or iterable): The name(s) of the pipes to disable
enable (str or iterable): The name(s) of the pipes to enable - all others will be disabled
DOCS: https://spacy.io/api/language#select_pipes
))
r r&ÚE991rŸrdÚE992r¢)Ú
to_disableÚds rkzLanguage.select_pipes3ð ˆ>˜g˜oÜœVŸ[™[Ó gœsÔ iˆ Рܘ&¤#Ô ˜Ø+/¯?ª?ÓQ©? 4¸dÈ&Ò>Pš$¨?ˆÐ" w°*Ò'<Ü Ü—KK×%¨w¸d¿o¹oðóðð
!ˆÐA™g˜¨°$·.±.Ò)@’1˜gˆÐ˜T 7Ó+ùòRùòBsÁ CÁCÂ*CÂ>CcóÎt|«|jkDr=ttjj t|«|j¬««|j
|«S)z{Turn a text into a Doc object.
text (str): The text to process.
RETURNS (Doc): The processed doc.
)ÚlengthrŠ)r r&ÚE088r¢r“)s rkÚmake_doczLanguage.make_docYsQô ˆt9t—Ò Ü ×"¬#¨d«)ÀÇÁÐð
ð~‰~˜#rjÚdoc_likecó4t|t«r|St|t«r|j|«St|t«r$t|j
«j
|«Sttjjt|«¬««)z„Create a Doc if need be, or raise an error if the input is not
a Doc, string, or a byte array (generated by Doc.to_bytes()).)) r:rdÚbytesr{Ú
from_bytesr r&ÚE1041r¢)s rkzLanguage._ensure_docespô Ô ˆOÜ Ô —=‘= Ó Ô t—zz“?×-¨hÓ œŸ×,´$°x³.ÐBrjÚcontextcó6|j|«}||_|S)z>Call _ensure_doc to generate a Doc and set its context object.)Ú_context)s rkÚ_ensure_doc_with_contextz!Language._ensure_doc_with_contextps ð×јxÓØˆŒ ؈
rjg)ÚdropÚsgdÚlossesr¢ÚexcludeÚ annotatesÚexamplesríc ó´|ttj«|i}t|t«rt |«dk(r|St
|d«t|«}|€-|j|j«|_|j}|i}i} t|j«D]_\}
\} } |j| i«t|| «| | <|| jd|«| | jd|j«Œa|jD\} } | |vr%t| d«r| j |fd|dœ|| ¤Ž|dvrI| |vrEt| t"j$«r+| j&r| j(d vr| j+|«| |vsŒt-t/d
|D«| | |j0| | ¬ «|«D] \}
}|
|_ŒŒ¿t5|«S) a<Update the models in the pipeline.
examples (Iterable[Example]): A batch of examples
_: Should not be set - serves to catch backwards-incompatible scripts.
drop (float): The dropout rate.
sgd (Optimizer): An optimizer.
losses (Dict[str, float]): Dictionary to update with the loss, keyed by
component.
component_cfg (Dict[str, Dict]): Config parameters for specific pipeline
components, keyed by component name.
exclude (Iterable[str]): Names of components that shouldn't be updated.
annotates (Iterable[str]): Names of components that should set
annotations on the predicted examples after updating.
RETURNS (Dict[str, float]): The updated losses dictionary
DOCS: https://spacy.io/api/language#update
NrzLanguage.updaterÊrÚupdate©)NF)TFNc3ó4K|]}|jŒy­w©Ú predicted©r|Úegs rkr~z"Language.update.<locals>.<genexpr>¸sèø€Ð¨"˜Ÿ±ùó)r‘)r r&ÚE989rŸr=Ú_copy_examplesrœÚcreate_optimizerÚ enumerater¹rrrr#ÚTrainableComponentÚ is_trainabler[Ú
finish_updateÚziprDÚ_replace_numpy_floats)Ú pipe_kwargsrrr­r×s rkzLanguage.updatexð:
ˆ=ÜœVŸ[™[Ó ˆ>؈ Ô %¬#¨h«-¸1Ò*<؈˜(Ð$5Ô! (Ó+ˆØ ˆÐ&Ø"&×"7Ñ"7Ó"9Ø—//ˆCØ Ð ØˆM؈ ܯ©Ö7‰OˆA‰| × $ T¨2Ô .Ü (¨°tÑ)<Ó =ˆK˜Ñ Ø ˜$Ñ × *¨6°4Ô ˜Ñ × °t·±Õ
Ÿ-œ-‰JˆD˜"¤w¨t°XÔ'>Ø ˜U¨$°vÑÈtÑATÒ˜ Ñ" ×)>Ñ)>Ôן
Ð*=Ñ×&  ÜÙÓ!Ø.2×.HÑ.HØ*¨4Ñ ðö GC˜ð$'B•Lñ ð(ô0% ,rj)c óf
|i}t|t«rt|«dk(r|St|d«|€-|j|j «|_|j}t|j «}tj|«|i}iŠ
ˆ
fd}|j|_ |j|_
|j|_ |D]>\}} ||vs t| d«sŒiŠ
| j|f||dœ|j|i«¤ŽŒ@
j«D]\}
\} } ||
| | «Œ|S)a|Make a "rehearsal" update to the models in the pipeline, to prevent
forgetting. Rehearsal updates run an initial copy of the model over some
data, and update the model so its current predictions are more like the
initial ones. This is useful for keeping a pretrained model on-track,
even if you're updating it with a smaller set of examples.
examples (Iterable[Example]): A batch of `Example` objects.
sgd (Optional[Optimizer]): An optimizer.
component_cfg (Dict[str, Dict]): Config parameters for specific pipeline
components, keyed by component name.
exclude (Iterable[str]): Names of components that shouldn't be updated.
RETURNS (dict): Results from the update.
EXAMPLE:
>>> raw_text_batches = minibatch(raw_texts)
>>> for labelled_batch in minibatch(examples):
>>> nlp.update(labelled_batch)
>>> raw_batch = [Example.from_dict(nlp.make_doc(text), {}) for text in next(raw_text_batches)]
>>> nlp.rehearse(raw_batch)
DOCS: https://spacy.io/api/language#rehearse
rzLanguage.rehearsecó||f|<||fSri)ÚkeyÚdWÚgradss €rkÚ get_gradsz$Language.rehearse.<locals>.get_gradsñsø€Ø˜R˜ˆE#‰JØb5ˆLrjÚrehearserÒ)r=ÚrandomÚshuffleÚ
learn_rateÚb1Úb2rÚitems)rr­s @rkzLanguage.rehearseÃs0ø€ð> ˆˆ Ô %¬#¨h«-¸1Ò*<؈˜(Ð$7Ô ˆÐ&Ø"&×"7Ñ"7Ó"9Ø—//ˆT—]‘]ÓÜØ Р؈M؈ô ð #Ÿ~™~ˆ ÔØ—v‘vˆ Œ Ø—v‘vˆ Œ Û‰JˆDw‰¤g¨d°JÔ&?ØØˆ ˆDM‰MØð
Øñ
Ø:G×:KÑ:KÈDÐRTÓ:Uó
ð  ð"ŸK™KžM‰LˆC! Q˜ˆ
rj©Ú get_examplescóxtjtjt«|j ||¬«S)Nrñ)r]r^r'ÚW089r³r•)s rkÚbegin_trainingzLanguage.begin_trainings*ô 
”h—m‘mÔ%7Ô˜|°ˆÓ5rjcóª|€=tjjd«t|jgd¢¬«Šˆfd}t |d«s5t jjdt|«¬«}t|«|jj«}tj|dt¬ «}|d
}|||« t!||d |d |d
¬«|jj&j(ddk\r/t+«}|jj&j-|«t |j.d«rEt1|j.j2|ddd¬«}|j.j2|fd|i|¤Ž|j4D]c\} }
t7|
t8j:«sŒ!|dj=| i«} t1|
j2| d| ¬«} |
j2|fd|i| ¤ŽŒe|j=d«} | r(tj| t>¬ «}
tA||
|«|jC«||_"|||_"n!|jD|jG«|_"|d}|||«|jDS#t"$r-t#t j$j|d
¬««wxYw)Initialize the pipe for training, using data examples if available.
get_examples (Callable[[], Iterable[Example]]): Optional function that
returns gold-standard Example objects.
sgd (Optional[Optimizer]): An optimizer to use for updates. If not
provided, will be created using the .create_optimizer() method.
RETURNS (thinc.api.Optimizer): The optimizer.
DOCS: https://spacy.io/api/language#initialize
zUNo 'get_examples' callback provided to 'Language.initialize', creating dummy examples)Úz)Úwordscó2tji«gS)r<Ú from_dict)s€rkz)Language.initialize.<locals>.get_examples"sø€Ü×)¨#¨rÓ3rjzLanguage.initialize)rOÚobjr•)ÚschemaÚ before_initÚ
vocab_datarƒr)Údatarƒr)rr!r“)ÚsectionrroÚ pretrainingÚ
after_init)$r$rrr:r{rr&ÚE930r¢Ú TypeErrorrQrarGr3r?ÚIOErrorÚE884rÚshaperÚto_opsr“r6r•r#ÚInitializableComponentr¤r5r>ru)r*rQÚIrÿÚopsÚ tok_settingsrr­Ú
p_settingsÚ pretrain_cfgÚPrs @rkr•zLanguage.initialize sø€ð Ð Ü K‰K× Ñ Ø
ôd—j‘jªÔ8ˆCô
| ZÔ—++×,´$°|Ó2DðˆCô˜C“.Ð à×ä × Ñ ˜V LÑ1Ô:JÔ Ø˜
Ñ&ˆ Ø Ð ˜Ô ð DÜ Ø˜1˜\™?°A°i±LÈ!ÈIÉ,õ
ð
:‰:× Ñ × #  &¨!Ò #ˆ J‰J× Ñ × %  4—>>  ×+‘Ø ô ˆLð
&ˆDN‰N× %  M¸Ð Ò Ÿ-œ-‰JˆD˜$¤× 9Ñ 9Õ˜|™_×°rÓ:
Ü—O‘O Z¸ÈDô
ð   ÑE°$ÐE¸*Ó
—z‘z -Ó Ù Ü× Ñ  Ô6JÔKˆAÜ ˜˜q !Ô  ×ÑÔØˆŒØ ˆ?Ø!ˆD
_‰_Ð
"×5ˆDŒOØ|
Ø Ð  ØÐøôCò DÜœ&Ÿ+™+×,°Q°y±\Ð  Dús Ã
JÊ6Kcó¦t«}|jjjddk\r%|jjj |«|j
D],\}}t
|d«sŒt|j«|_ Œ.|||_
|jS|j|j«|_
|jS)a Continue training a pretrained model.
Create and return an optimizer, and initialize "rehearsal" for any pipeline
component that has a .rehearse() method. Rehearsal is used to prevent
models from "forgetting" their initialized "knowledge". To perform
rehearsal, collect samples of text you want the models to retain performance
on, and call nlp.rehearse() with a batch of Example objects.
RETURNS (Optimizer): The optimizer.
DOCS: https://spacy.io/api/language#resume_training
r!Ú_rehearsal_model) rr{rr r
rrr[r)r
rr­s rkÚresume_trainingzLanguage.resume_trainingXôÓˆØ :‰:× Ñ × #  &¨!Ò J‰J× Ñ × % cÔ Ÿ-œ-‰JˆD0Ü(0°·±Ó(<Õ ˆ!ˆDŒOðÐð_‰_Ð
"×5ˆDŒOØÐrjcóv||_|jD]#\}}t|d«sŒ|j|«Œ%y)aSet an error handler object for all the components in the pipeline
that implement a set_error_handler function.
error_handler (Callable[[str, Callable[[Doc], Doc], List[Doc], Exception], NoReturn]):
Function that deals with a failing batch of documents. This callable
function should take in the component's name, the component itself,
the offending batch of documents, and the exception that was thrown.
DOCS: https://spacy.io/api/language#set_error_handler
Úset_error_handlerN)rr)rs rkrzLanguage.set_error_handlerqs7ð&3ˆÔŸ-œ-‰JˆD×& (rj)rÚscorerr¢Ú
scorer_cfgÚ
per_componentrrrcó(t|«}t|d«t|«}| |j}|i}|i}|€(t |«}|j d|«t
di|¤Ž}t«}|D]'} |j| jj«Œ)|jd|D«||¬«}
t||
«D] \} } | | _
Œt«} |j||¬«}
td|D««}|| |z
z |
d<t!|
«S) aàEvaluate a model's pipeline components.
examples (Iterable[Example]): `Example` objects.
batch_size (Optional[int]): Batch size to use.
scorer (Optional[Scorer]): Scorer to use. If not passed in, a new one
will be created.
component_cfg (dict): An optional dictionary with extra keyword
arguments for specific components.
scorer_cfg (dict): An optional dictionary with extra keyword arguments
for the scorer.
per_component (bool): Whether to return the scores keyed by component
name. Defaults to False.
RETURNS (Scorer): The scorer containing the evaluation results.
DOCS: https://spacy.io/api/language#evaluate
zLanguage.evaluateroc3ó4K|]}|jŒy­ws rkr~z$Language.evaluate.<locals>.<genexpr>²sèø€Ð -¡H˜bˆR\\¡HùrØ)r)rc3óFK|]}t|j«Œy­w)s rkr~z$Language.evaluate.<locals>.<genexpr>ºsèø€Ð;±(¨B”c˜"Ÿ,™,×'±(ùs!Úspeedri)r=rrer7ÚtimerrÀÚ referencer£Úscorer…)rrrrÚ
start_timer×Údocsr¬Úend_timeÚresultsÚn_wordss rkÚevaluatezLanguage.evaluateƒs#ô6˜“>ˆÜ˜(Ð$7Ô! (ÓØ Ð ØŸˆJØ Ð ØˆMØ Ð ØˆJØ ˆ>ܘ*Ó%ˆFØ × Ñ ˜e TÔ Ñ%˜fÑ%ˆFä“Wˆ
㈠M‰M˜"Ÿ,™,× ðy‰yÙ -¡HÓ ó
ˆô
˜8 TÖ*‰GˆB؈B“7ˆØ—,‘,˜x°}ÜÑ;±(Ó;ˆØ" Ñ&;Ñ<ˆÑÜ$ -rjcóZd|jddi}tj|«dS)zCCreate an optimizer, usually using the [training.optimizer] config.Ú optimizerr×)rQrG)Ú subconfigs rkzLanguage.create_optimizer¾s0à  $§+¡+¨jÑ"9¸+Ñ"FÐGˆ Ü×Ñ  Ó*¨;Ñ7rjÚparamsc#ó@K|sdy|jDcgc].\}}t|d«rt|d«r|j|«Œ0}}}|D]} t|«Œd|D]} t|«Œycc}}w#t$rYŒ:wxYw#t$rYŒ2wxYw­w)Replace weights of models in the pipeline with those provided in the
params dictionary. Can be used as a contextmanager, in which case,
models go back to their original weights after the block.
params (dict): A dictionary of parameters keyed by model ID.
EXAMPLE:
>>> with nlp.use_params(optimizer.averages):
>>> nlp.to_disk("/tmp/checkpoint")
DOCS: https://spacy.io/api/language#use_params
use_paramsr[)rr,ÚnextÚ
StopIteration)r*rÚcontextsrÆs rkr,zLanguage.use_paramsÃèø€ñÜ ð#'§-¢-ôá"/JD˜˜4 Ô.´7¸4ÀÔ3Ið Õ'Ø"/ð
ñó$ðܘ•Mð
Û#ðܘ•Mñ$ùóøôÙðûô ÙðüsXB™3A:Á BÁ BÁ BÁ, BÁ7 B B  B B  B BÂBÂBÂB)Ú as_tuplesrÚ n_processÚtextsr0r1cóyri©r2r0rr1s rkz
Language.pipeçóð rjcóyrir4s rkz
Language.pipeôr5rjr!c#ólK|rstttttt
ft f|«}ˆfd|D«}j|||||¬«}|D]} | j}
d| _| |
fŒyttttt
f|«}|dk(rtj«}|i}| j}g} jD]g\} }
| |vrŒ |j| i«}|jd|«tj t"|
| |j$¬«}| j'|«Œi|dk7rI‰j)|«r#t+j,t.j0«j3|| ||«}nˆfd|D«}| D]
}||«}Œ |D]} | Œy­w) aXProcess texts as a stream, and yield `Doc` objects in order.
texts (Iterable[Union[str, Doc]]): A sequence of texts or docs to
process.
as_tuples (bool): If set to True, inputs should be a sequence of
(text, context) tuples. Output will then be a sequence of
(doc, context) tuples. Defaults to False.
batch_size (Optional[int]): The number of texts to buffer.
disable (List[str]): Names of the pipeline components to disable.
component_cfg (Dict[str, Dict]): An optional dictionary with extra keyword
arguments for specific components.
n_process (int): Number of processors to process texts. If -1, set `multiprocessing.cpu_count()`.
YIELDS (Doc): Documents in the order of the original text.
DOCS: https://spacy.io/api/language#pipe
c3óHK|]\}}j||«Œy­w))r|s €rkr~z Language.pipe.<locals>.<genexpr>s'øèø€ð"ÙRWÁÀÀw×-¨d°G×<ÑRWùsƒ")rr1Néÿÿÿÿr)rr!c3ó@K|]}j|«Œy­w))r|s €rkr~z Language.pipe.<locals>.<genexpr>Rsøèø€Ð=±u¨t$ T×*±uùsƒ)rrrrrdr:rLÚmpÚ cpu_countrÚ functoolsÚpartialrDÚ_has_gpu_modelr]r^r'ÚW114Ú_multiprocessing_pipe)r2r0rr1Údocs_with_contextsr"rr­Úfrýs` rkz
Language.pipeøèø€ñ8 Üœ¤%¬¬c´3¨h©¼Ð(DÑ"EÑÓNˆ"ÙRWó"Ð ð—9Ø óˆDóØŸ,™,Ø# ؘGð
ä”Xœe¤C¬ H™oÑÓ𠘊?ÜŸ ˆIØ Ð ØˆMØ Ð ØŸˆJð
ð ðŸ-œ-‰JˆDw‰ØØ"×& t¨RÓ0ˆ × Ñ ˜l¨JÔ ×ØØØØ&*×&@Ñ&@ô ˆ
L‰L˜ ˜Š>Ø×" 
œhŸm™mÔ×-¨e°U¸IÀzÓR‰Dó>±uÓ=ˆDÛÙ˜D“z‘ðãˆCØ‹IñùsƒF1F4có|jD]p\}}t|d«xr |j}||vs|sŒ't|d«sŒ4t|jd«sŒKt |jj
t «sŒpyy)NrÞr[r
TF)rr[r
r)rr­s rkr?zLanguage._has_gpu_modelXsmØŸ-œ-‰JˆD" ÓN¸T×=NÑ=Nˆw‰¡lØät˜%¬'°$·*±*¸eÕ*DÌÐTX×T^ÑT^×TbÑTbÔdkÕIlÙð
rjc
#ódKdttttfdttttt
ft ffd}||«}tj|«\}}t|«Dcgc]}tj«Œ} }tt|«Dcgc]}tjd«Œc}Ž\}
} tj||«} t!| | |¬«}
|
j#«|
j#«t| | «Dcgc]A\}}tj$t&|j(|||t+j,«f¬«ŒC}}}|D]}|j/«Œ| D]}|j1«Œt3j4dt7|
«D««} t9t||«d«D\}\}\}}}|0t|j:«j=|«}||_|nR|PtAjB|«}|jEdddtGtHjJjM|¬ «««||zd
k(sŒš|
jO«Œ« | D]'}|jQtR«|j1«Œ)|
D]}|j1«Œ|D]}|jU«ŒtWd |D««s$tYjZt\j^«yycc}wcc}wcc}}w#| D]'}|jQtR«|j1«Œ)|
D]}|j1«Œ|D]}|jU«ŒtWd |D««s$tYjZt\j^«wwxYw­w) Nr2rlc3ó¼K|D]S}t|t«r-|j«tt|j
«fŒ@|ttd«fŒUy­w)r:Úto_bytesrrL)r2s rkÚ
prepare_inputz5Language._multiprocessing_pipe.<locals>.prepare_inputjsOèø€ó "ܘh¬Ô#×´[À(×BSÑBSÓ0TÐ#¤T¬+°tÓ%<Ð"ùsAAF)Ú
chunk_size)Útargetrc3ó<K|]}|j«Œy­w)Úrecv)r|rLs rkr~z1Language._multiprocessing_pipe.<locals>.<genexpr>¡sèø€ð*
Ù$;˜DˆDI‰IKÑ$;ùsr!r†rc3ó:K|]}|jdk(Œy­w)rN)Úexitcode)r|r­s rkr~z1Language._multiprocessing_pipe.<locals>.<genexpr>Èsèø€Ð<±e¨dt—}‘}¨Õ)±eùs)0rrrdr:rrLÚ itertoolsÚteeÚranger;ÚQueueràÚPiper$Ú minibatchÚ_SenderÚsendÚProcessÚ _apply_pipesrÉr;Ú get_stateÚstartÚcloserÚ
from_iterablerr{Ú
msgpack_loadsr©r r&ÚE871r¢ÚstepÚputÚ_WORK_DONE_SENTINELrSÚallr]r^r'ÚW127)r2r1rrHÚserialized_texts_with_ctxÚ raw_textsríÚtexts_qÚbytedocs_recv_chÚbytedocs_send_chÚ batch_textsÚsenderÚrchÚschÚprocsr­ÚtxÚ byte_tuplesrÚbyte_docrÆÚ
byte_errorr¬r‡Úrs rkrAzLanguage._multiprocessing_pipecsEèø€ð
œE¤#¤s (™OÑ
”eœE¤#¤u -¬{Ð

%2°%Ó$8Ð$Ÿ=™=Ð)BÓˆˆyä7<¸YÔ7GÓ"HÑ7G°!¤2§8¡8¥:Ð7GˆÐ"Hä-0Ü&+¨IÔ&6Ó
7Ñ&6 Œbg‰genÐ&6Ñ
.
ÑЗn‘n U¨JÓ ô˜ g¸)Ôà Œ
Ø Œ
ô  Ð)9Ô 
ñ;
J‰JÜרØÜ× ö
ð ñ 
óˆDØ J‰Jó #ˆ H‰H
×*
Ü$)Ð*:Ô$;ó*
ó
ˆ ð% -Ü;DÜI˜+¨Qö<Ñ7Ñ76˜ '¨:ðИdŸj™j/×4°XÓ>CØ#*C”LØ“IØÐ!×
Ó;טd D¬*´V·[±[×5GÑ5GÈeÐ5GÓ5TÓ*Uôðz> —KK•Mñ<ó&ØÔ• ðó&Ø• ðØ ðôÑ<±eÓ
œhŸm™mÕ=ùò]#Iùò8ùó 
øó^ØÔ• ðó&Ø• ðØ ðôÑ<±eÓ
œhŸm™mÕ=üsNA3N0Á5L ÂN0Â$LÃAN0ÄALÅ AN0Æ7B/LÉ'LÉ:B!N0ÌBN-Î-N0có.|jD]\}}t|d«sŒ||_Œt|j«D]U\}\}}t |t
j «sŒ$i|_|j|dzdD]\}}|j|«ŒŒWy)zmRegister 'listeners' within pipeline components, to allow them to
effectively share weights.
rr!N) r¹rrr#ÚListenedToComponentÚ listener_mapÚfind_listeners)rr­rÚname1Úproc1Úname2Úproc2s rkruzLanguage._link_componentsËsˆðŸ-œ-‰JˆDt˜VÕ • ð"+¨4¯=©=Ö!9Ñ ˆA‰~˜×!7Ñ!7Õ8Ø%'Ô"Ø$(§M¡M°!°a±%°'Ó$:LE˜×Õ%;ñ":rj)r{rÚ auto_fillrJr|c ó8
|r*t|jt¬«j|«}d|vr)t t
j j|¬««d|dvr
ddi|dd<|djd«} | ]| |jk7rNt t
jj|dd|jtj|«¬ ««|j|dd<tj|«}|jd
i«}
|jd d«} i|d
<|rtj ||t"¬ «} n|} |
| d
<|
|d
<|
| | d <| |d <tj$| d|t&¬ «}
|
d
}|
d}|
d}|
d}|
d}|}|Z||«}t)|t*«rt-||«r||ur2t t
j.jt+|«¬««t1«|||||¬«}|G||«}t)||«s3t t
j2jdt+|«¬««| j4s| j7«n| }|jd
i«}i}i}d}|ddD]^}||vrIdj9|j;««}t t
j<j||¬««tj||«}t| d
|«}|vsŒd|vr0d|vr,t
j>j||¬«}t |«d|vr(|jd«}|jA|||||¬«Œßd|vsJ||jBjEddg¬«}|d} | |vr&tjF| |jBdg¬«|| <|jd |«}!d!}"d"|vrU|| jI«|| jJD]0\}#}$|!tM|$d#g«vsŒ|| jO|#|!|d"«d$}"Œ2tQjR«5tQjTd%d&¬'«|jA|!|| |¬(«ddd«| |vr6tW|| jBjXjEdg¬««|| <d)|jZvri|jZd)<|| |jZd)|<|"sŒ\|| =Œa||jBj]|«t)|t^«r|g}t)|t^«r|g}t)t^«rgŠta|«tatb«k7rn|djd*g«}%te|%«rNtg|%«ji|«s4tQjjtljnj||%¬+««|jqtsh|£|djd,g«£«||dd«}&tgˆfd-„|&D««|_:|dd.|_;|r| n||_<|G||«}t)||«s3t t
j2jd/t+|«¬««|S#1swYŒxYw)0a5Create the nlp object from a loaded config. Will set up the tokenizer
and language data, add pipeline components etc. If no config is provided,
the default config of the given language is used.
config (Dict[str, Any] / Config): The loaded config.
vocab (Vocab): A Vocab object. If True, a vocab is created.
disable (Union[str, Iterable[str]]): Name(s) of pipeline component(s) to disable.
Disabled pipes will be loaded but they won't be run unless you
explicitly enable them by calling nlp.enable_pipe.
enable (Union[str, Iterable[str]]): Name(s) of pipeline component(s) to enable. All other
pipes will be disabled (and can be enabled using `nlp.enable_pipe`).
exclude (Union[str, Iterable[str]]): Name(s) of pipeline component(s) to exclude.
Excluded components won't be loaded.
meta (Dict[str, Any]): Meta overrides for nlp.meta.
auto_fill (bool): Automatically fill in missing values in config based
on defaults and function argument annotations.
validate (bool): Validate the component config and arguments against
the types expected by the factory.
RETURNS (Language): The initialized Language class.
DOCS: https://spacy.io/api/language#from_config
rOrorz@vectorszspacy.Vectors.v1rN)Ú
bad_lang_coderPrr)rJr“Úbefore_creationÚafter_creationÚafter_pipeline_creation))r{r}rÚcreation)rrMrDrY)rrQ)rrQrJrIrc©)r{rreplace_listenersÚlistening_componentsTÚignorez\[W113\])Úmessage)rYrÚenabled)rˆc3ó,K|] }|vsŒ|Œ
y­wri)r|s €rkr~z'Language.from_config.<locals>.<genexpr>½søèø€ÐJ¡~ !¸À'Ò9IœA¡~ùsƒ rÚpipeline_creation)=rr˜rAr—r r&ÚE985r¢rÚE958r$r?rbrUrGrTr2r4Ú
issubclassÚE943rHÚE942Úis_interpolatedrarSÚE956ÚE984ryr{rGÚ
load_modelruÚgetattrr„r]Úcatch_warningsÚfilterwarningsÚhashrrrdÚidr@rgÚissubsetr^r'ÚW123Ú_resolve_component_statusrÐrrQ)'r²rQr{rr|rJÚ config_langÚ
orig_pipelineÚorig_pretrainingrWÚ resolved_nlpr}rr€rÚlang_clsroÚ interpolatedr¹Ú source_nlpsÚsource_nlp_vectors_hashesÚvocab_brârEÚpipe_cfgrIr*r[rXÚlisteners_replacedrr­rˆÚdisabled_pipess' ` rkÚ from_configzLanguage.from_configáø€ñF ÜØ×"Ô2Fôç‰eF
ð ˜Ñ ÜœVŸ[™[×/°vÐ  ˜F 5™MÑ )Ø(2Ð4FÐ'GˆF5‰M˜ ˜Um×Ó/ˆ Ø Ð " {°c·h±hÒ'>ÜÜ ×"Ø"(¨¡-°Ñ"7Ø!Ÿh™hÜ×-¨cÓóð
ð!$§¡ˆˆu‰
ô
×! )ˆØŸ
 Ó4ˆ
Ø!Ÿ:™: m°TÓØˆ|ÑÙ Ü—]‘] 6°HÄ\ÔR‰FàˆF؈|ÑØˆ|ÑØ Ð 'Ø$4ˆF !Ø$4ˆF × 5‰M H´
ˆ ð ÑØ% 0ˆØ&Ð'8Ñ9ˆØ%Ð&6Ñ7ˆØ".Ð/HÑ"IÐØˆØ Ð & +ˆ˜Ô! (¨CÔ 3Ñ ¤§¡×!3Ñ!3¼$¸x».Ð!3Ó!IÓ Ôñ ØØô 
ˆð Ð   Ó%ˆCܘc 3Ô ¤§¡×!3Ñ!3¸Ì4ÐPSË9Ð!3Ó!UÓ4:×3IÒ3Iv×+Èvˆ Ø×# L°"Ó5ˆðˆ Ø$&Јؠ zÕ2ˆIØ Ñ—y‘y §¡£Ó1Ü ¤§¡×!3Ñ!3¸ÈÐ!3Ó!NÓ×°Ñ(;Ó<ˆ  |Ñ 4°YÑ ?Ó@ˆ Ò HÑÀÑ1IÜ Ÿ+™+×,°)ÀHÐM$ S Ñ&Ÿl™l¨9Ó5—LØ'Ø!)Ø#-ð ð$ Ø"%§)¡)×"4Ñ"4¸Ð=SÐ"4Ó"T˜Ø$ . /ä-1¯_©_د©¸Y¸Kô.˜  EÑ#+§,¡,¨{¸IÓ"FKØ).Ð*¨hÑ$ *×=Ø*5°eÑ*<×*EÔ*E™J˜D *¬g°dÐ<RÐTVÓ.WÒWØ +¨EÑ 2× DÑ DØ$(¨+°xÐ@SÑ7Tô!"ð6:Ñ 2ð +Fô "× ×À,ÕŸ Ø ¸EÑ0BÈð÷Ð$=Ñ=Ü;?ØÑ.×4×<×EØ)2¨ ðFóó<Ð1°%Ñ
¿¹Ñ@Ø>@˜ŸÐ!:Ñ2°%Ñ—H‘HÐóÒ.ðQ3ðT Ð Ø I‰I× Ñ  Ô  gœsÔ iˆ fœcÔ Xˆ gœsÔ iˆGô ˆf‹:œÔ ˜Um×'¨ °2Ó6ˆ7Œ|¤C¨£L×$9Ñ$9¸&Ô$AÜ
Ü—MM×%Ø 'ðôð× Ð??˜V E™]×.¨z¸ Ø 5‰M˜ 
ˆô
ÓJ¡~ÓJˆŒ
à  |ÑŒÙ(‘V¨fˆŒ
Ø )¨#Ó.ˆ˜c  Ü—KK×&Ð,?ÄtÈCÃyÐððˆ
÷{2ús Ñ/ZÚZ Ú tok2vec_namerâÚ listenerscó®||jvrGtjj|||dj |j«¬«}t |«||jvrGtjj|||dj |j«¬«}t |«|j
|«}|j|«}t|tj«s3t tjj|t|«¬««|j}|jj|g«}|j
|«} |j |}
|r·t"j$j'd|«t)t+|««t)|«k7r7tj,j|||t)|«¬«}t |«|D]d} t#j.|
| «|d} d|j4vr!|j4d}
|
|d|
dd «} t#j6|
| | «Œf|D}|j9«}|j4jd
«}|ot)t;j<|«j>«}|d k(r ||«}n9|d
k(r ||||«}n)t tj@j|¬««t#jB| j||«|jE||«ŒÓy y #t0$r.tj2j||| ¬«}t |«wxYw)Find listener layers (connecting to a token-to-vector embedding
component) of a given pipeline component model and replace
them with a standalone copy of the token-to-vector layer. This can be
useful when training a pipeline with components sourced from an existing
pipeline: if multiple components (e.g. tagger, parser, NER) listen to
the same tok2vec component, but some of them are frozen and not updated,
their performance may degrade significantly as the tok2vec component is
updated with new data. To prevent this, listeners can be replaced with
a standalone tok2vec layer that is owned by the component and doesn't
change if the component isn't updated.
tok2vec_name (str): Name of the token-to-vector component, typically
"tok2vec" or "transformer".
pipe_name (str): Name of pipeline component to replace listeners for.
listeners (Iterable[str]): The paths to the listeners, relative to the
component config, e.g. ["model.tok2vec"]. Typically, implementations
will only connect to one tok2vec component, [model.tok2vec], but in
theory, custom models can use multiple listeners. The value here can
either be an empty list to not replace any listeners, or a complete
(!) list of the paths to all listener layers used by the model.
DOCS: https://spacy.io/api/language#replace_listeners
rM)Útok2vecrÚunknownrE)rz%Replacing listeners of component '%s')rÚpathsÚ n_listeners)rr[Úreplace_listener_cfgr¬Úreplace_listenerNr!é)Ú
num_params)#rÑr&ÚE889r¢rSr rHr#ruÚE888r£r[rvr$rrÚE887Ú
dot_to_objectrFÚE886ÚattrsÚset_dot_to_objectÚcopyÚinspectÚ signatureÚ
parametersÚE1055Úreplace_model_nodeÚremove_listener)r*Ú tok2vec_cfgÚ
tok2vec_modelÚpipe_listenersrýÚ
listener_pathÚ
new_configÚ replace_funcÚlistenerÚ new_modelÚreplace_listener_funcr³s rkr„zLanguage.replace_listenersÉsð: ˜tŸÑ —+‘+ר—Y‘Y˜tŸÓˆCô ˜S“/Ð ˜DŸO™OÑ —+‘+ר—Y‘Y˜tŸÓˆCô ˜S“/Ð —-‘-  ÓØ×*¨<Ó8ˆ ܘ'¤2×#9Ñ#9ÔœVŸ[™[×/°\ÌÈWË
Ð Ÿ
ˆ
Ø ×1°)¸RÓ@ˆØ}‰}˜'ˆØ×% iÑÚ Ü K‰K× Ñ ÐEÀyÔ ”4˜ “?Ó#¤s¨>Ó':Ò—kk×#Ü # NÓ 3ð ô ! “oÐ"+
ð×& Ô Ñ1
Ø)¨]×-@Ñ-@Ñ@Ø#0×#6Ñ#6Ð7MÑ#NLÙ!-Ø# ,¨h°wÑ.?À Ñ.Jó"×& À
Õ"+ó"+Ø)×0 Ø(5×(;Ñ(;×(?Ñ(?Ð@RÓ(SÐ"%Ü×)Ð*?Ó@×"" QÙ$9¸)Ó$D™ Ø# Ù$9¸)ÀXÈwÓ$W™ 䯩×)<Ñ)<È
Ð)<Ó)SÓׯ
©
°H¸×°)Õ<ñ#+ðA øô& ò Ÿ+™+× À=ð% S*ús Ç"LÌ7MÚmemc #óþK|
t«}t«5}|j|jj |««g}t |j d«r9|j|j|j j |«««|jD]A\}}t |d«sŒ|j|j|j |«««ŒC|ddd«y#1swYyxYw­w)Begin a block where all resources allocated during the block will
be freed at the end of it. If a resources was created within the
memory zone block, accessing it outside the block is invalid.
Behaviour of this invalid access is undefined. Memory zones should
not be nested.