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

83 lines
8.8 KiB
Plaintext
Raw Normal View History

2026-03-15 13:27:50 +00:00
Ë
=û gìã
ó@ddlmZmZmZmZmZmZmZddlm Z ddl
m Z ddl m
Z
mZmZddlmZerddlmZgd¢Zd eed
eefd Zd d
ded
eeeeffdZedœd d
deed
eeeeeeeeffffdZedœdeeeeeeeefffdeed
dfdZy)é)Ú
TYPE_CHECKINGÚDictÚ ItemsViewÚIterableÚListÚSetÚUnion)Úmsgé)ÚErrors)ÚDocÚSpanÚToken)Ú dot_to_dict)ÚLanguage)ÚrequiresÚassignsÚscoresÚ retokenizesÚvaluesÚreturnc
ó¼
t|Dcic]}|dŒc}«}tttdœ}|j «D]\Š
}
dk(r||Dcgc]}|j d«sŒ|Œ}}|Dcgc]}|j d«rŒ|Œ}}|r8t
tjjdj|«¬««
|vrDdjˆ
fd|D««}t
tjj
|¬ ««t|t«s)t
tjj
¬
««|j «D]o\}}|d k(r |dur8t
tjjd j
«¬
««|j «D]P\}} | dusŒ
d
|}
|
ddj| «} t
tjj| |
¬««Œ¬|j!d «r-t
tj"j||dd¬««|durG‰
d|}
|
ddj|«} t
tjj| |
¬««|
} t%| |«rŒHt
tj&j
|¬««ŒŽ|Scc}wcc}wcc}w)Validate component attributes provided to "assigns", "requires" etc.
Raises error for invalid attributes and formatting. Doesn't check if
custom extension attributes are registered, since this is something the
user might want to do themselves later in the component.
values (Iterable[str]): The string attributes to check, e.g. `["token.pos"]`.
RETURNS (Iterable[str]): The checked attributes.
T)ÚdocÚtokenÚspanrzspan.zspan._.ú, )Úattrsc3óFK|]}|j«sŒ|Œy­w©N)Ú
startswith)Ú.0Úobj_keys €úTC:\Users\garci\AppData\Roaming\Python\Python312\site-packages\spacy/pipe_analysis.pyú <genexpr>z!validate_attrs.<locals>.<genexpr>$søèø€Ð%Q±¨A¸1¿<¹<ÈÕ;P¤a±ùsƒ!š!)Úobjr)ÚattrÚ_z{}._z._.ú.)r'ÚsolutionNéÿÿÿÿ)r&r')rr
rrÚitemsr Ú
ValueErrorr ÚE180ÚformatÚjoinÚE181Ú
isinstanceÚdictÚE182ÚE183ÚendswithÚE184ÚhasattrÚE185)rÚvalueÚdataÚobjsrr'Ú
span_attrsÚ
invalid_attrsÚext_attrÚ ext_valueÚgoodÚbadr&r#s @r$Úvalidate_attrsrCsø€ô ±Ó¨˜˜t™ °Ñ 9€Dܤ´Ñ 5€DØŸ*™*Ÿ,‰ˆØ  á+1ÓN©6 4°T·_±_ÀWÕ5Mš$¨6ˆNÙ+5ÓX©: 4¸T¿_¹_ÈYÕ=Wš$¨:ˆJÐÜ ¤§¡×!3Ñ!3¸$¿)¹)ÀJÓ:OÐ!3Ó!PÓ ˜ Ø ŸI™IÓ%Q±Ó%QÓQˆMÜœVŸ[™[×/°GÀ=Ð ˜ÔœVŸ[™[×/°WÐ  Ÿ;™;Ÿ=‰KˆDsŠ{ؘD$¤V§[¡[×%7Ñ%7¸V¿]¹]È7Ó=SÐ%7Ó%TÓUØ+0¯;©;®=Ñ'H˜ ¨Ò,Ø") ¨#¨h¨ZÐ8˜Ø!%  ¯©°Ó(;Ð'<Ð=˜Ü¯©×);Ñ);ÀÈtÐ);Ó)TÓ ,9ð Ø}‰}˜SÔ ¤§¡×!3Ñ!3¸ÈÈSÈbÈ Ð!3Ó!RÓ˜ Ø ! D 6Ð*ؘ˜a §¡¨£Ð1Ü ¤§¡×!3Ñ!3¸ÀtÐ!3Ó!LÓw‘-ˆCܘ3 Ö ¤§¡×!3Ñ!3¸ÀdÐ!3Ó!KÓLò''ð@ €MùòE9ùò
OùÚXs
KÁKÁ%KÁ/KÂKÚnlprr'cóÞggdœ}|jD]X}|j|«}||jvr|dj|«||jvsŒE|dj|«ŒZ|S)a%Check which components in the pipeline assign or require an attribute.
nlp (Language): The current nlp object.
attr (str): The attribute, e.g. "doc.tensor".
RETURNS (Dict[str, List[str]]): A dict keyed by "assigns" and "requires",
mapped to a list of component names.
)rrrr)Ú
pipe_namesÚ
get_pipe_metarÚappendr)rDr'ÚresultÚ pipe_nameÚmetas r$Ú
get_attr_inforL?sqð02¸rÑ#B€FØ—^”^ˆ Ø× Ñ  Ó+ˆØ 4—< Ø  × $ YÔ 4—=‘=Ò Ø  × % iÕ  €Mó)ÚkeysrNc
ó¦iidœ}t«}t|j«D\}}|j|«}|j |j
«|j |j «|Dcic]}|t||d«Œc}|d|<|jd|}|j D cic]} | dŒ}
} |
r1|D],\} } |j| «}
|
j
D]} d|
| <Œ Œ.|
j«D cgc]
\} }|rŒ | Œ c}} |d|<Œø|Dcic]}|t||«Œc}|d<|Scc}wcc} wcc}} wcc}w)aXPrint a formatted summary for the current nlp object's pipeline. Shows
a table with the pipeline components and why they assign and require, as
well as any problems if available.
nlp (Language): The nlp object.
keys (List[str]): The meta keys to show in the table.
RETURNS (dict): A dict with "summary" and "problems".