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

135 lines
14 KiB
Plaintext
Raw Normal View History

2026-03-15 13:27:50 +00:00
Ë
=û gv)ãódZddlZddlmZmZmZmZmZmZddl m
Z
m Z ddl m
Z
mZddlmZmZdd lmZmZmZiZdad
d d did fd eeee
eefe
eefd
edededeedeeefdedefdZd
dd id ddd fd eee
e
fd
edededeeefdededededdfdZdZifdee
efdeeefdeeeffdZifde
deeefdeeeffd „Zifde
deeefdeeeffd!„Z d"eegefddfd#„Z!de
deeeffd$„Z"y)%z¤
spaCy's built in visualization suite for dependencies and named entities.
DOCS: https://spacy.io/api/top-level#displacy
USAGE: https://spacy.io/usage/visualizers
éN)ÚAnyÚCallableÚDictÚIterableÚOptionalÚUnioné)ÚErrorsÚWarnings)ÚDocÚSpan)Úfind_available_portÚ
is_in_jupyteré)ÚDependencyRendererÚEntityRendererÚ SpanRendererÚdepFÚdocsÚstyleÚpageÚminifyÚjupyterÚoptionsÚmanualÚreturncóVttfttftt
fdœ}||vr)t
tjj|¬««t|tttf«r|g}|Dcgc]$}t|t«s|n|j«Œ&}}td|D««st
tj «||\} }
| |¬«} |s|D cgc] } |
| |«Œ
c} n|}
|r1|D],} t| t«sŒd| vsŒt#| dd¬«| d<Œ.| j%|
||¬«j'«t(d <t(d }t* t+|«}|s |€/t-«r%d
d lm}m}||d j|«««S|Scc}wcc} w)
Render displaCy visualisation.
docs (Union[Iterable[Union[Doc, Span, dict]], Doc, Span, dict]]): Document(s) to visualise.
a 'dict' is only allowed here when 'manual' is set to True
style (str): Visualisation style, 'dep' or 'ent'.
page (bool): Render markup as full HTML page.
minify (bool): Minify HTML markup.
jupyter (bool): Override Jupyter auto-detection.
options (dict): Visualiser-specific options, e.g. colors.
manual (bool): Don't parse `Doc` and instead expect a dict/list of dicts.
RETURNS (str): Rendered SVG or HTML markup.
DOCS: https://spacy.io/api/top-level#displacy.render
USAGE: https://spacy.io/usage/visualizers
)rÚentÚspan)rc3óRK|]}t|tttf«Œ!y­w)N)Ú
isinstancer r
Údict)Ú.0Úobjs úXC:\Users\garci\AppData\Roaming\Python\Python312\site-packages\spacy/displacy/__init__.pyú <genexpr>zrender.<locals>.<genexpr>5sèø€ÐB¹T°cŒz˜#¤¤T¬4Ð0×1¹Tùs%')rÚentscó|d|dfS)startÚend©)Úxs r%ú<lambda>zrender.<locals>.<lambda>=sÀÀ7ÁÈQÈuÉXÑ@Vó)Úkey)rrÚparsedr)ÚHTMLÚdisplayz&<span class="tex2jax_ignore">{}</span>)rÚ
parse_depsrÚ
parse_entsrÚ parse_spansÚ
ValueErrorr
ÚE087Úformatr!r r
r"Úas_docÚallÚE096ÚsortedÚrenderÚstripÚ_htmlÚRENDER_WRAPPERrÚIPython.core.displayr1r2)rrrrrrrÚ factoriesr$Ú
renderer_funcÚ converterÚrendererÚdocr0Úhtmlr1r2s r%r=r=s‰ô2#¤JФ
М{ЀIð

ÜœŸ×+°%Мd¤DЈvˆÙJNÓ OÉ$À3”z #¤tÔ,‰C°#·*±*³,Ñ >È$€DÐ ÑB¹TÓ œŸÓÑ€M -€HÙ>D±Ó
¨#‰i˜˜Ò
6È$€FÙ
ÛˆCܘ#œtÕ°3ªÜ$ S¨¡[Ñ6VÔWF’ ðð—o‘o f°4ÀO„Eˆ( ‰?€DÜИdÓÙ7?¤}¤÷‘tÐD×KÈDÓ €Kùò) Pùò
7s Á4)F!Ã!F&Tiˆz0.0.0.0ÚportÚhostÚauto_select_portc ó¾ddlm} t|||«}t«r#t j
t j«t||||||¬«| j||t«}
td|d«td|d|d« |
j«|
j«y #t$rtd |d
«YŒ+wxYw#|
j«wxYw) aServe displaCy visualisation.
docs (list or Doc): Document(s) to visualise.
style (str): Visualisation style, 'dep' or 'ent'.
page (bool): Render markup as full HTML page.
minify (bool): Minify HTML markup.
options (dict): Visualiser-specific options, e.g. colors.
manual (bool): Don't parse `Doc` and instead expect a dict/list of dicts.
port (int): Port to serve visualisation.
host (str): Host to serve visualisation.
auto_select_port (bool): Automatically select a port if the specified port is in use.
DOCS: https://spacy.io/api/top-level#displacy.serve
USAGE: https://spacy.io/usage/visualizers
r)Ú
simple_server)rrrrrz
Using the 'z ' visualizerzServing on http://ú:z ...
zShutting down server on port ú.N)ÚwsgirefrLrrÚwarningsÚwarnr ÚW011r=Ú make_serverÚappÚprintÚ
serve_foreverÚKeyboardInterruptÚ server_close) rrrrrrrHrIrJrLÚhttpds r%ÚserverZKõ4 ˜t TÐ+;Ó <€DäÜ
”h—m
ˆ4u 4°ÀÐPVÕ × % d¨D´#Ó 6€EÜ ˆM˜%˜  Ð
 Ð ˜t˜f A d V¨6Ð
Ø
×ÑÔð ×ÑÕøô ò
Ð-¨d¨V°1Ð7ûð ×ÑÕús$ B,Â,CÃC
ÃCÃC
Ã
CcóRdg}|d|«tdjd¬«}|gS)N)z Content-typeztext/html; charset=utf-8z200 OKr0zutf-8)Úencoding)r?Úencode)ÚenvironÚstart_responseÚheadersÚress r%rTrTws2Ø<€GÙ8˜
‰/×
Ñ
¨'Ð
Ó
2€CØ ˆ5€Lr.Úorig_doccó>t|t«r|j«}t|j«j |j
ddg¬««}|jd«s#tjtj«|jdd«r‰|j«5}t|j«D]W}|j j"|j j$|j j&dœ}|j)||¬«ŒY d d d «|jd
d «rg}|d d D}|j*s|j-d
«j*sŒ+|j.}|j.d
z} | t1|«kr2|| j*r#| d
z
} | t1|«kr|| j*rŒ#||| }
|j3|
|j"|j$|j&f«Œ¿|j«5}|D] \}
} } }
| | |
dœ}|j)|
|¬«Œ" d d d «|jd«}|jd«}|Dcgc]8}|j4|r |j"n |j6|r |j$nd dœŒ:}}g}|D}|j.|j8j.kr?|j3|j.|j8j.|j:ddœ«Œe|j.|j8j.kDsŒ‰|j3|j8j.|j.|j:ddœ«ŒÈ||t=|«dœS#1swYŒdxYw#1swYŒXxYwcc}w)aGenerate dependency parse in {'words': [], 'arcs': []} format.
orig_doc (Union[Doc, Span]): Document to parse.
options (Dict[str, Any]): Dependency parse specific visualisation options.
RETURNS (dict): Generated dependency parse keyed by words and arcs.
Ú user_dataÚ
user_hooks)ÚexcludeÚDEPÚcollapse_phrasesF)ÚtagÚlemmaÚent_type)ÚattrsNÚcollapse_punctTéÿÿÿÿrÚ fine_grainedÚ add_lemma)ÚtextrirjÚleft)r)r*ÚlabelÚdirÚright)ÚwordsÚarcsÚsettings)r!r
r9r ÚvocabÚ
from_bytesÚto_bytesÚhas_annotationrPrQr ÚW005ÚgetÚ
retokenizeÚlistÚ noun_chunksÚrootÚtag_Úlemma_Ú ent_type_ÚmergeÚis_punctÚnborÚlenÚappendrqÚpos_ÚheadÚdep_Úget_doc_settings)rbrrFÚ retokenizerÚnprlÚspansÚwordr)r*rrirjrkrorpÚwrvrws r%r3r3~sÿô(œDÔ—?‘?ÓÜ
ˆhn‰nÓ
×
×Ñ  Ð"=ÐÓ €Cð × Ñ ˜eÔ 
”h—m‡{% 
^‰^Ô
 Ü˜3Ÿ?™?Ö+àŸ7™7Ÿ<™<ØŸW™WŸ^™^Ø "§¡× 1Ñ 1ñð
×! "¨EÐ
ð‡{# TՈؘ˜“HˆDØ}Š} D§I¡I¨a£L×$9Ò$9ØØ—FFˆ—&&˜1*ˆœ˜C. ¡X×%6Ò%6Øq‘ðœ˜C›’. S¨¡X×%6Ó%6àu˜S>ˆ L‰L˜$ § ¡ ¨4¯;©;¸¿¹Ð ð^‰^Ô
 Û.3Ñ*c˜5 (Ø #¨eÀÑJØ×! $¨eÐ/4÷ð—;‘;˜~Ó.€LØ ˜KÓ(€Iñó