B An]h@sddlmZddlZddlZddlZddZeGdddeZeGdddeZeGd d d eZ Gd d d e Z Gd dde Z e ee dZddZddZejdZeejdZeejdZddZddZddZd ddZdS)!)unicode_literalsNcsGfdddt}|S)z=Add error codes to string messages via class attribute names.cseZdZfddZdS)z"add_codes..ErrorsWithCodescst|}dj||dS)Nz[{code}] {msg})codemsg)getattrformat)selfrr)err_clso/home/app_decipher_dev_19-4/dev/decipher-analysis/serverless-application/helper/df_spacy/python/spacy/errors.py__getattribute__ s z3add_codes..ErrorsWithCodes.__getattribute__N)__name__ __module__ __qualname__r r )rr r ErrorsWithCodes sr)object)rrr )rr add_codes src@sLeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdS)WarningszAs of spaCy v2.0, the keyword argument `path=` is deprecated. You can now call spacy.load with the path as its first argument, and the model's meta.json will be used to determine the language to load. For example: nlp = spacy.load('{path}')zTokenizer.from_list is now deprecated. Create a new Doc object instead and pass in the strings as the `words` keyword argument, for example: from spacy.tokens import Doc doc = Doc(nlp.vocab, words=[...])z|Positional arguments to Doc.merge are deprecated. Instead, use the keyword arguments, for example tag=, lemma= or ent_type=.zaNo text fixing enabled. Run `pip install ftfy` to enable fixing using ftfy.fix_text if necessary.a!Doc object not parsed. This means displaCy won't be able to generate a dependency visualization for it. Make sure the Doc was processed with a model that supports dependency parsing, and not just a language class like `English()`. For more info, see the docs: https://spacy.io/usage/modelszNo entities to visualize found in Doc object. If this is surprising to you, make sure the Doc was processed using a model that supports named entity recognition, and check the `doc.ents` property manually if necessary.aThe model you're using has no word vectors loaded, so the result of the {obj}.similarity method will be based on the tagger, parser and NER, which may not give useful similarity judgements. This may happen if you're using one of the small models, e.g. `en_core_web_sm`, which don't ship with word vectors and only use context-sensitive tensors. You can always add your own word vectors, or use one of the larger models instead if available.z3Evaluating {obj}.similarity based on empty vectors.z`Custom factory '{name}' provided by entry points of another package overwrites built-in factory.zyAs of v2.1.0, the PhraseMatcher doesn't have a phrase length limit anymore, so the max_length argument is now deprecated.a>It looks like you're calling displacy.serve from within a Jupyter notebook or a similar environment. This likely means you're already running a local web server, so there's no need to make displaCy start another one. Instead, you should be able to replace displacy.serve with displacy.render to show the visualization.aA Doc object you're adding to the PhraseMatcher for pattern '{key}' is parsed and/or tagged, but to match on '{attr}', you don't actually need this information. This means that creating the patterns is potentially much slower, because all pipeline components are applied. To only create tokenized Doc objects, try using `nlp.make_doc(text)` or process all texts as a stream using `list(nlp.tokenizer.pipe(all_texts))`.zAs of v2.1.0, {obj}.merge is deprecated. Please use the more efficient and less error-prone Doc.retokenize context manager instead.zAs of v2.1.0, the `disable` keyword argument on the serialization methods is and should be replaced with `exclude`. This makes it consistent with the other objects serializable.zAs of v2.1.0, the use of keyword arguments to exclude fields from being serialized or deserialized is deprecated. Please use the `exclude` argument instead. For example: exclude=['{arg}'].zThe keyword argument `n_threads` on the is now deprecated, as the v2.x models cannot release the global interpreter lock. Future versions may introduce a `n_process` argument for parallel inference via multiprocessing.N)r r rW001ZW002ZW003ZW004ZW005ZW006ZW007ZW008ZW009ZW010ZW011ZW012ZW013ZW014W015ZW016r r r r rs rc@seZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Zd=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYdXZZdYZ[dZZ\d[Z]d\Z^d]Z_d^Z`d_Zad`ZbdaZcdbZddcZeddZfdeZgdfZhdgZidhZjdiZkdjZldkZmdlZndmZodnZpdoZqdpZrdqZsdrZtdsZudtZvduZwdvZxdwZydxZzdyZ{dzZ|d{Z}d|Z~d}Zd~ZdZdZdZdS)Errorsz@No component '{name}' found in pipeline. Available names: {opts}afCan't find factory for '{name}'. This usually happens when spaCy calls `nlp.create_pipe` with a component name that's not built in - for example, when constructing the pipeline from a model's meta.json. If you're using a custom component, you can write to `Language.factories['{name}']` or remove it from the model meta and add it via `nlp.add_pipe` instead.zXNot a valid pipeline component. Expected callable, but got {component} (name: '{name}').zkIf you meant to add a built-in component, use `create_pipe`: `nlp.add_pipe(nlp.create_pipe('{component}'))`z|Pipeline component '{name}' returned None. If you're using a custom component, maybe you forgot to return the processed Doc?zWInvalid constraints. You can only set one of the following: before, after, first, last.z;'{name}' already exists in pipeline. Existing names: {opts}a Some current components would be lost when restoring previous pipeline state. If you added components after calling `nlp.disable_pipes()`, you should remove them explicitly with `nlp.remove_pipe()` before the pipeline is restored. Names of the new components: {names}zcThe `update` method expects same number of docs and golds, but got: {n_docs} docs, {n_golds} golds.zWord vectors set to length 0. This may be because you don't have a model installed or loaded, or because your model doesn't include word vectors. For more info, see the docs: https://spacy.io/usage/modelsz)Unknown operator: '{op}'. Options: {opts}z9Cannot add pattern for zero tokens to matcher. Key: {key}z!Error selecting action in matcherzUknown tag ID: {tag}zTConflicting morphology exception for ({tag}, {orth}). Use `force=True` to overwrite.z_MultitaskObjective target should be function or one of: dep, tag, ent, dep_tag_offset, ent_tag.z5Can only add unicode or bytes. Got type: {value_type}z.Can't retrieve string for hash '{hash_value}'.znCan't create transition with unknown action ID: {action}. Action IDs are enumerated in spacy/syntax/{src}.pyx.aCould not find a gold-standard action to supervise the dependency parser. The tree is non-projective (i.e. it has crossing arcs - see spacy/syntax/nonproj.pyx for definitions). The ArcEager transition system only supports projective trees. To learn non-projective representations, transform the data before training and after parsing. Either pass `make_projective=True` to the GoldParse class, or use spacy.syntax.nonproj.preprocess_training_data.zCould not find a gold-standard action to supervise the dependency parser. The GoldParse was projective. The transition system has {n_actions} actions. State at failure: {state}zDCould not find a transition with the name '{name}' in the NER model.z`Error cleaning up beam: The same state occurred twice at memory address {addr} and position {i}.zCould not find an optimal move to supervise the parser. Usually, this means the GoldParse was not correct. For example, are all labels added to the model?z6String is too long: {length} characters. Max is 2**30.zOError accessing token at position {i}: out of bounds in Doc of length {length}.zArguments 'words' and 'spaces' should be sequences of the same length, or 'spaces' should be left default at None. spaces should be a sequence of booleans, with True meaning that the word owns a ' ' character following it.zyorths_and_spaces expects either a list of unicode string or a list of (unicode, bool) tuples. Got bytes instance: {value}znoun_chunks requires the dependency parse, which requires a statistical model to be installed and loaded. For more info, see the documentation: https://spacy.io/usage/modelszSentence boundaries unset. You can add the 'sentencizer' component to the pipeline with: nlp.add_pipe(nlp.create_pipe('sentencizer')) Alternatively, add the dependency parser, or set sentence boundaries by setting doc[i].is_sent_start.z1Invalid token: empty string ('') at position {i}.a Conflicting attributes specified in doc.from_array(): (HEAD, SENT_START). The HEAD attribute currently sets sentence boundaries implicitly, based on the tree structure. This means the HEAD attribute would potentially override the sentence boundaries set by SENT_START.z2Cannot load into non-empty Doc of length {length}.zDoc.merge received {n_args} non-keyword arguments. Expected either 3 arguments (deprecated), or 0 (use keyword arguments). Arguments supplied: {args} Keyword arguments:{kwargs}zPError creating span with start {start} and end {end} for Doc of length {length}.zPError calculating span: Can't find a token starting at character offset {start}.zLError calculating span: Can't find a token ending at character offset {end}.z8Error finding sentence for span. Infinite loop detected.zArray bounds exceeded while searching for root word. This likely means the parse tree is in an invalid state. Please report this issue here: http://github.com/explosion/spaCy/issuesz8Attempt to access token at {i}, max length {max_length}.z7Invalid comparison operator: {op}. Likely a Cython bug?z?Error accessing doc[{i}].nbor({j}), for doc of length {length}.zkRefusing to write to token.sent_start if its document is parsed, because this may cause inconsistent state.zNInvalid value for token.sent_start: {value}. Must be one of: None, True, Falsez maximum length ({max_len}).zQError setting tensor on Doc: tensor has {rows} rows, while Doc has {words} words.zsError computing {value}: number of Docs ({n_docs}) does not equal number of GoldParse objects ({n_golds}) in batch.zwError computing score: number of words in Doc ({words_doc}) does not equal number of words in GoldParse ({words_gold}).ztError computing states in beam: number of predicted beams ({pbeams}) does not equal number of gold beams ({gbeams}).z%Duplicate state found in beam: {key}.zjError getting gradient in beam: number of histories ({n_hist}) does not equal number of losses ({losses}).zError deprojectivizing parse: number of heads ({n_heads}), projective heads ({n_proj_heads}) and labels ({n_labels}) do not match.z|Error setting extension: only one of `default`, `method`, or `getter` (plus optional `setter`) is allowed. Got: {nr_defined}z=Error assigning label ID {label} to span: not in StringStore.z*Can't create lexeme for string '{string}'.zfError deserializing lexeme '{string}': orth ID {orth_id} does not match hash {hash_id} in StringStore.z Unknown displaCy style: {style}.aText of length {length} exceeds maximum of {max_length}. The v2.x parser and NER models require roughly 1GB of temporary memory per 100,000 characters in the input. This means long texts may cause memory allocation errors. If you're not using the parser or NER, it's probably safe to increase the `nlp.max_length` limit. The limit is in number of characters, so you can check whether your inputs are too long by checking `len(text)`.zrExtensions can't have a setter argument without a getter argument. Check the keyword arguments on `set_extension`.z{Extension '{name}' already exists on {obj}. To overwrite the existing extension, set `force=True` on `{obj}.set_extension`.zOInvalid extension attribute {name}: expected callable or None, but got: {value}zCould not find or assign name for word vectors. Ususally, the name is read from the model's meta.json in vector.name. Alternatively, it is built from the 'lang' and 'name' keys in the meta.json. Vector names are required to avoid issue #1660.z=token.ent_iob values make invalid sequence: I without B {seq}z4Error reading line {line_num} in vectors file {loc}.zsCan't write to frozen dictionary. This is likely an internal error. Are you writing to a default function argument?zjInvalid object passed to displaCy: Can only visualize Doc or Span objects, or dicts if set to manual=True.zeInvalid pattern: expected token pattern (list of dicts) or phrase pattern (string) but got: {pattern}z:Invalid pattern specified: expected both SPEC and PATTERN.zTFirst node of pattern should be a root node. The root should only contain NODE_NAME.zMNodes apart from the root should contain NODE_NAME, NBOR_NAME and NBOR_RELOP.zfNODE_NAME should be a new node and NBOR_NAME should already have have been declared in previous edges.zMCan't merge non-disjoint spans. '{token}' is already part of tokens to merge.zTrying to set conflicting doc.ents: '{span1}' and '{span2}'. A token can only be part of one entity, so make sure the entities you're setting don't overlap.z$Can't find JSON schema for '{name}'.zkThe Doc.print_tree() method is now deprecated. Please use Doc.to_json() instead or write your own function.zNCan't find doc._.{attr} attribute specified in the underscore settings: {opts}z7Value of doc._.{attr} is not JSON-serializable: {value}zAs of spaCy v2.1, the pipe name `sbd` has been deprecated in favor of the pipe name `sentencizer`, which does the same thing. For example, use `nlp.create_pipeline('sentencizer')`zqModel for component '{name}' not initialized. Did you forget to load a model, or forget to call begin_training()?z>Invalid displaCy render wrapper. Expected callable, got: {obj}a:Pickling a token is not supported, because tokens are only views of the parent Doc and can't exist on their own. A pickled token would always have to include its Doc and Vocab, which has practically no advantage over pickling the parent Doc directly. So instead of pickling the token, pickle the Doc it belongs to.axPickling a span is not supported, because spans are only views of the parent Doc and can't exist on their own. A pickled span would always have to include its Doc and Vocab, which has practically no advantage over pickling the parent Doc directly. So instead of pickling the span, pickle the Doc it belongs to or use Span.as_doc to convert the span to a standalone Doc object.z8The newly split token can only have one root (head = 0).z6The newly split token needs to have a root (head = 0).z)All subtokens must have associated heads.zCannot currently add labels to pre-trained text classifier. Add labels before training begins. This functionality was available in previous versions, but had significant bugs that led to poor performance.zdThe newly split tokens must match the text of the original token. New orths: {new}. Old text: {old}.zThe custom extension attribute '{attr}' is not registered on the Token object so it can't be set during retokenization. To register an attribute, use the Token.set_extension classmethod.a^Can't set custom extension attribute '{attr}' during retokenization because it's not writable. This usually means it was registered with a getter function (and no setter) or as a method extension, so the value is computed dynamically. To overwrite a custom attribute manually, it should be registered with a default value or with a getter AND setter.z~Can't set custom extension attributes during retokenization. Expected dict mapping attribute names to values, but got: {value}z`Can't bulk merge spans. Attribute length {attr_len} should be equal to span length ({span_len}).z1Cannot find token to be split. Did it get merged?z9Cannot find head of token to be split. Did it get merged?z;Cannot read from file: {path}. Supported formats: {formats}zUnexpected value: {value}z}Unexpected matcher predicate: '{bad}'. Expected one of: {good}. This is likely a bug in spaCy, so feel free to open an issue.zXCannot create phrase pattern representation for length 0. This is likely a bug in spaCy.zUnsupported serialization argument: '{arg}'. The use of keyword arguments to exclude fields from being serialized or deserialized is now deprecated. Please use the `exclude` argument instead. For example: exclude=['{arg}'].a:Cannot write the label of an existing Span object because a Span is a read-only view of the underlying Token objects stored in the Doc. Instead, create a new Span object and specify the `label` keyword argument, for example: from spacy.tokens import Span span = Span(doc, start={start}, end={end}, label='{label}')N)r r rZE001ZE002ZE003ZE004ZE005ZE006ZE007ZE008ZE009ZE010ZE011ZE012ZE013ZE014ZE015ZE016ZE017ZE018ZE019ZE020ZE021ZE022ZE023ZE024ZE025ZE026ZE027ZE028ZE029ZE030ZE031ZE032ZE033ZE034ZE035ZE036ZE037ZE038ZE039ZE040ZE041ZE042ZE043ZE044ZE045ZE046ZE047E048E049E050E051E052E053E054E055E056E057ZE058ZE059ZE060ZE061ZE062ZE063ZE064ZE065ZE066ZE067ZE068ZE069ZE070ZE071ZE072ZE073ZE074ZE075ZE076ZE077ZE078ZE079ZE080ZE081ZE082ZE083ZE084ZE085ZE086ZE087ZE088ZE089ZE090ZE091ZE092ZE093ZE094E095ZE096ZE097ZE098ZE099ZE100ZE101ZE102ZE103ZE104ZE105ZE106ZE107ZE108ZE109ZE110ZE111ZE112ZE113ZE114ZE115ZE116ZE117ZE118ZE119ZE120ZE121ZE122ZE123ZE124ZE125ZE126ZE127E128ZE129r r r r rUsrc@seZdZdZdZdZdZdS) TempErrorsz>Resizing pre-trained Tagger models is not currently supported.z=Currently parser depth is hard-coded to 1. Received: {value}.ztCan't yet set {attr} from Span. Vote for this feature on the issue tracker: http://github.com/explosion/spaCy/issueszBad configuration of Tagger. This is probably a bug within spaCy. We changed the name of an internal attribute for loading pre-trained vectors, and the class has been passed the old name (pretrained_dims) but not the new name (pretrained_vectors).N)r r rZT003ZT004ZT007ZT008r r r r r"tsr"c@seZdZddZdS)MatchPatternErrorcCsTd|}x8|D],\}}ddd|D}|d||7}qWt||dS)zCustom error for validating match patterns. key (unicode): The name of the matcher rule. errors (dict): Validation errors (sequence of strings) mapped to pattern ID, i.e. the index of the added pattern. z-Invalid token patterns for matcher rule '{}'  cSsg|]}d|qS)z- {})r).0er r r sz.MatchPatternError.__init__..z Pattern {}: {} N)ritemsjoin ValueError__init__)rkeyerrorsrZ pattern_idxZ error_msgsZpattern_errorsr r r r+s  zMatchPatternError.__init__N)r r rr+r r r r r#sr#c@s eZdZdS) ModelsWarningN)r r rr r r r r.sr.)user deprecationmodelscCs4|dkr gS|r|dkr tSdd|dDS)NallcSs g|]}|tkr|qSr )stripWARNINGS)r%Zw_typer r r r'sz#_get_warn_types..,)r5keyssplit)argr r r _get_warn_typess  r:cCs|sgSdd|dDS)NcSsg|] }|qSr )r4)r%w_idr r r r'sz"_get_warn_excl..r6)r8)r9r r r _get_warn_exclsr<SPACY_WARNING_FILTERSPACY_WARNING_TYPESSPACY_WARNING_IGNOREcCst|ddS)Nr/)_warn)messager r r user_warningsrBcCst|ddS)Nr0)r@)rAr r r deprecation_warningsrCcCst|ddS)Nr1)r@)rAr r r models_warningsrDr/c Cs|dr(|dddddd}nd}|o6|tk}|tkr|st|}td}t.t rrt t |t |||d|dWdQRXdS)za message (unicode): The message to display. category (Warning): The Warning to show. []rN) startswithr8r?r>r5inspectstackwarningscatch_warningsr= simplefilter warn_explicit)rAZ warn_typer;Zignore_warningcategoryrLr r r r@s      r@)r/) __future__rosrMrKrrrrr"r*r# UserWarningr.DeprecationWarningr5r:r<environgetr=r>r?rBrCrDr@r r r r s4  >