sdkagent

spaCy API reference

194 public APIs from spaCy (explosion/spaCy) — 22 classes, 92 functions, 80 methods. Signatures extracted by static analysis of the actual source.

Repository: explosion/spaCy

KindCount
Classes22
Functions92
Methods80

API list

funcspacy.cli._util.setup_gpu(use_gpu:int, silent=None) -> None
Configure the GPU and log info.
classspacy.cli.benchmark_speed.time_context
Register the running time of a context.
funcspacy.cli.find_threshold.set_nested_item(config:Dict[str, Any], keys:List[str], value:float) -> Dict[str, Any]
Set item in nested dictionary.
funcspacy.cli.info.info_model(model:str, *silent:bool=True) -> Dict[str, Any]
Generate info about a specific model.
funcspacy.cli.info.info_model_url(model:str) -> Dict[str, Any]
Return the download URL for the latest version of a pipeline.
funcspacy.cli.info.info_spacy() -> Dict[str, Any]
Generate info about the current spaCy intallation.
classspacy.cli.init_config.InitValues
Default values for initialization.
funcspacy.cli.package.generate_readme(meta:Dict[str, Any]) -> str
Generate a Markdown-formatted README text from a model meta.json.
funcspacy.cli.validate.reformat_version(version:str) -> str
Hack to reformat old versions ending on '-alpha' to match pip format.
funcspacy.displacy.render(docs:Union[Iterable[Union[Doc, Span, dict]], Doc, Span, dict], style:str='dep', page:bool=False, minify:bool=False, jupyter:Optional[bool]=None, options:Dict[str, Any]={}, manual:bool=False) -> str
Render displaCy visualisation.
classspacy.displacy.render.DependencyRenderer
Render dependency parses as SVGs.
methodspacy.displacy.render.DependencyRenderer.get_arc(x_start:int, y:int, y_curve:int, x_end:int) -> str
Render individual arc.
methodspacy.displacy.render.DependencyRenderer.get_arrowhead(direction:str, x:int, y:int, end:int) -> str
Render individual arrow head.
methodspacy.displacy.render.DependencyRenderer.get_levels(arcs:List[Dict[str, Any]]) -> Dict[Tuple[int, int, str], int]
Calculate available arc height "levels".
methodspacy.displacy.render.DependencyRenderer.render(parsed:List[Dict[str, Any]], page:bool=False, minify:bool=False) -> str
Render complete markup.
methodspacy.displacy.render.DependencyRenderer.render_arrow(label:str, start:int, end:int, direction:str, i:int) -> str
Render individual arrow.
methodspacy.displacy.render.DependencyRenderer.render_svg(render_id:Union[int, str], words:List[Dict[str, Any]], arcs:List[Dict[str, Any]]) -> str
Render SVG.
methodspacy.displacy.render.DependencyRenderer.render_word(text:str, tag:str, lemma:Optional[str], i:int) -> str
Render individual word.
classspacy.displacy.render.EntityRenderer
Render named entities as HTML.
methodspacy.displacy.render.EntityRenderer.render(parsed:List[Dict[str, Any]], page:bool=False, minify:bool=False) -> str
Render complete markup.
methodspacy.displacy.render.EntityRenderer.render_ents(text:str, spans:List[Dict[str, Any]], title:Optional[str]) -> str
Render entities in text.
classspacy.displacy.render.SpanRenderer
Render Spans as SVGs.
methodspacy.displacy.render.SpanRenderer.render(parsed:List[Dict[str, Any]], page:bool=False, minify:bool=False) -> str
Render complete markup.
methodspacy.displacy.render.SpanRenderer.render_spans(tokens:List[str], spans:List[Dict[str, Any]], title:Optional[str]) -> str
Render span types in text.
funcspacy.displacy.serve(docs:Union[Iterable[Doc], Doc], style:str='dep', page:bool=True, minify:bool=False, options:Dict[str, Any]={}, manual:bool=False, port:int=5000, host:str='0.0.0.0', auto_select_port:bool=False) -> None
Serve displaCy visualisation.
funcspacy.lang.ar.lex_attrs.like_num(text)
Check if text resembles a number
funcspacy.lang.bo.lex_attrs.like_num(text)
Check if text resembles a number
funcspacy.lang.ca.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.de.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.el.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
classspacy.lang.en.lemmatizer.EnglishLemmatizer
English lemmatizer.
funcspacy.lang.en.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.es.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.fa.lex_attrs.like_num(text)
check if text resembles a number
funcspacy.lang.fa.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.fi.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.fr.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
classspacy.lang.ht.lemmatizer.HaitianCreoleLemmatizer
Minimal Haitian Creole lemmatizer.
funcspacy.lang.id.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.it.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.ja.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.lb.lex_attrs.like_num(text)
check if text resembles a number
funcspacy.lang.ml.lex_attrs.like_num(text)
Check if text resembles a number
funcspacy.lang.ms.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.nb.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.nl.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.pt.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.sa.lex_attrs.like_num(text)
Check if text resembles a number
funcspacy.lang.sv.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
funcspacy.lang.tr.syntax_iterators.noun_chunks(doclike:Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]
Detect base noun phrases from a dependency parse.
classspacy.language.BaseDefaults
Language data defaults, available via Language.Defaults.
classspacy.language.DisabledPipes
Manager for temporary pipeline disabling.
classspacy.language.Language
A text-processing pipeline.
methodspacy.language.Language.component(name:str, *assigns:Iterable[str]=SimpleFrozenList(), *requires:Iterable[str]=SimpleFrozenList(), *retokenizes:bool=False, *func:Optional[PipeCallable]=None) -> Callable[..., Any]
Register a new pipeline component.
methodspacy.language.Language.component_names() -> List[str]
Get the names of the available pipeline components.
methodspacy.language.Language.config() -> Config
Trainable config for the current language instance.
methodspacy.language.Language.create_pipe(factory_name:str, name:Optional[str]=None, *config:Dict[str, Any]=SimpleFrozenDict(), *raw_config:Optional[Config]=None, *validate:bool=True) -> PipeCallable
Create a pipeline component.
methodspacy.language.Language.disable_pipe(name:str) -> None
Disable a pipeline component.
methodspacy.language.Language.disable_pipes(*names) -> 'DisabledPipes'
Disable one or more pipeline components.
methodspacy.language.Language.disabled() -> List[str]
Get the names of all disabled components.
methodspacy.language.Language.factory_names() -> List[str]
Get names of all available factories.
methodspacy.language.Language.from_bytes(bytes_data:bytes, *exclude:Iterable[str]=SimpleFrozenList()) -> 'Language'
Load state from a binary string.
methodspacy.language.Language.from_disk(path:Union[str, Path], *exclude:Iterable[str]=SimpleFrozenList(), *overrides:Dict[str, Any]=SimpleFrozenDict()) -> 'Language'
Loads state from a directory.
methodspacy.language.Language.get_factory_meta(name:str) -> 'FactoryMeta'
Get the meta information for a given factory name.
methodspacy.language.Language.get_factory_name(name:str) -> str
Get the internal factory name based on the language subclass.
methodspacy.language.Language.get_pipe(name:str) -> PipeCallable
Get a pipeline component for a given component name.
methodspacy.language.Language.get_pipe_config(name:str) -> Config
Get the config used to create a pipeline component.
methodspacy.language.Language.get_pipe_meta(name:str) -> 'FactoryMeta'
Get the meta information for a given component name.
methodspacy.language.Language.has_factory(name:str) -> bool
RETURNS (bool): Whether a factory of that name is registered.
methodspacy.language.Language.has_pipe(name:str) -> bool
Check if a component name is present in the pipeline.
methodspacy.language.Language.make_doc(text:str) -> Doc
Turn a text into a Doc object.
methodspacy.language.Language.meta() -> Dict[str, Any]
Custom meta data of the language class.
methodspacy.language.Language.pipe_names() -> List[str]
Get names of available active pipeline components.
methodspacy.language.Language.remove_pipe(name:str) -> Tuple[str, PipeCallable]
Remove a component from the pipeline.
methodspacy.language.Language.rename_pipe(old_name:str, new_name:str) -> None
Rename a pipeline component.
methodspacy.language.Language.replace_pipe(name:str, factory_name:str, *config:Dict[str, Any]=SimpleFrozenDict(), *validate:bool=True) -> PipeCallable
Replace a component in the pipeline.
methodspacy.language.Language.resume_training(*sgd:Optional[Optimizer]=None) -> Optimizer
Continue training a pretrained model.
methodspacy.language.Language.select_pipes(*disable:Optional[Union[str, Iterable[str]]]=None, *enable:Optional[Union[str, Iterable[str]]]=None) -> 'DisabledPipes'
Disable one or more pipeline components.
methodspacy.language.Language.set_factory_meta(name:str, value:'FactoryMeta') -> None
Set the meta information for a given factory name.
methodspacy.language.Language.to_bytes(*exclude:Iterable[str]=SimpleFrozenList()) -> bytes
Serialize the current state to a binary string.
methodspacy.language.Language.to_disk(path:Union[str, Path], *exclude:Iterable[str]=SimpleFrozenList()) -> None
Save the current state to a directory.
funcspacy.language.create_tokenizer() -> Callable[['Language'], Tokenizer]
Registered function to create a tokenizer.
classspacy.lookups.Lookups
Container for large lookup tables and dictionaries, e.g.
methodspacy.lookups.Lookups.add_table(name:str, data:dict=SimpleFrozenDict()) -> Table
Add a new table to the lookups.
methodspacy.lookups.Lookups.from_bytes(bytes_data:bytes, **kwargs) -> 'Lookups'
Load the lookups from a bytestring.
methodspacy.lookups.Lookups.from_disk(path:Union[str, Path], filename:str='lookups.bin', **kwargs) -> 'Lookups'
Load lookups from a directory containing a lookups.bin.
methodspacy.lookups.Lookups.get_table(name:str, default:Any=UNSET) -> Table
Get a table.
methodspacy.lookups.Lookups.has_table(name:str) -> bool
Check if the lookups contain a table of a given name.
methodspacy.lookups.Lookups.remove_table(name:str) -> Table
Remove a table.
methodspacy.lookups.Lookups.set_table(name:str, table:Table) -> None
Set a table.
methodspacy.lookups.Lookups.tables() -> List[str]
RETURNS (List[str]): Names of all tables in the lookups.
methodspacy.lookups.Lookups.to_bytes(**kwargs) -> bytes
Serialize the lookups to a bytestring.
methodspacy.lookups.Lookups.to_disk(path:Union[str, Path], filename:str='lookups.bin', **kwargs) -> None
Save the lookups to a directory as lookups.bin.
classspacy.lookups.Table
A table in the lookups.
methodspacy.lookups.Table.from_bytes(bytes_data:bytes) -> 'Table'
Load a table from a bytestring.
methodspacy.lookups.Table.from_dict(data:dict, name:Optional[str]=None) -> 'Table'
Initialize a new table from a dict.
methodspacy.lookups.Table.get(key:Union[str, int], default:Optional[Any]=None) -> Any
Get the value for a given key.
methodspacy.lookups.Table.set(key:Union[str, int], value:Any) -> None
Set new key/value pair.
methodspacy.lookups.Table.to_bytes() -> bytes
Serialize table to a bytestring.
funcspacy.ml.extract_spans.forward(model:Model, source_spans:Tuple[Ragged, Ragged], is_train:bool) -> Tuple[Ragged, Callable]
Get subsequences from source vectors.
funcspacy.ml.models.tok2vec.BiLSTMEncoder(width:int, depth:int, dropout:float) -> Model[List[Floats2d], List[Floats2d]]
Encode context using bidirectonal LSTM layers.
funcspacy.pipeline._edit_tree_internals.schemas.validate_edit_tree(obj:Dict[str, Any]) -> List[str]
Validate edit tree.
classspacy.pipeline.entity_linker.EntityLinker
Pipeline component for named entity linking.
methodspacy.pipeline.entity_linker.EntityLinker.from_disk(path:Union[str, Path], *exclude:Iterable[str]=SimpleFrozenList()) -> 'EntityLinker'
Load the pipe from disk.
methodspacy.pipeline.entity_linker.EntityLinker.set_annotations(docs:Iterable[Doc], kb_ids:List[str]) -> None
Modify a batch of documents, using pre-computed scores.
methodspacy.pipeline.entity_linker.EntityLinker.to_disk(path:Union[str, Path], *exclude:Iterable[str]=SimpleFrozenList()) -> None
Serialize the pipe to disk.
funcspacy.pipeline.factories.register_factories() -> None
Register all factories with the registry.
funcspacy.pipeline.functions.merge_entities(doc:Doc)
Merge entities into a single token.
funcspacy.pipeline.functions.merge_noun_chunks(doc:Doc) -> Doc
Merge noun chunks into a single token.
funcspacy.pipeline.functions.merge_subtokens(doc:Doc, label:str='subtok') -> Doc
Merge subtokens into a single token.
classspacy.pipeline.legacy.entity_linker.EntityLinker_v1
Pipeline component for named entity linking.
methodspacy.pipeline.legacy.entity_linker.EntityLinker_v1.from_disk(path:Union[str, Path], *exclude:Iterable[str]=SimpleFrozenList()) -> 'EntityLinker_v1'
Load the pipe from disk.
methodspacy.pipeline.legacy.entity_linker.EntityLinker_v1.to_disk(path:Union[str, Path], *exclude:Iterable[str]=SimpleFrozenList()) -> None
Serialize the pipe to disk.
classspacy.pipeline.span_finder.SpanFinder
Pipeline that learns span boundaries.
methodspacy.pipeline.span_finder.SpanFinder.set_annotations(docs:Iterable[Doc], scores:Floats2d) -> None
Modify a batch of Doc objects, using pre-computed scores.
classspacy.pipeline.spancat.SpanCategorizer
Pipeline component to label spans of text.
methodspacy.pipeline.spancat.SpanCategorizer.add_label(label:str) -> int
Add a new label to the pipe.
methodspacy.pipeline.spancat.SpanCategorizer.key() -> str
Key of the doc.spans dict to save the spans under.
methodspacy.pipeline.spancat.SpanCategorizer.set_annotations(docs:Iterable[Doc], indices_scores) -> None
Modify a batch of Doc objects, using pre-computed scores.
funcspacy.pipeline.spancat.build_ngram_suggester(sizes:List[int]) -> Suggester
Suggest all spans of the given lengths.
classspacy.pipeline.textcat.TextCategorizer
Pipeline component for single-label text classification.
methodspacy.pipeline.textcat.TextCategorizer.add_label(label:str) -> int
Add a new label to the pipe.
methodspacy.pipeline.textcat.TextCategorizer.set_annotations(docs:Iterable[Doc], scores) -> None
Modify a batch of Doc objects, using pre-computed scores.
funcspacy.registrations.populate_registry() -> None
Populate the registry with all necessary components.
classspacy.schemas.DocJSONSchema
JSON/dict format for JSON representation of Doc objects.
funcspacy.schemas.get_arg_model(func:Callable, *exclude:Iterable[str]=tuple(), *name:str='ArgModel', *strict:bool=True) -> type[BaseModel]
Generate a pydantic model for function arguments.
funcspacy.schemas.validate(schema:Type[BaseModel], obj:Dict[str, Any]) -> List[str]
Validate data against a given pydantic schema.
classspacy.scorer.PRFScore
A precision / recall / F score.
classspacy.scorer.ROCAUCScore
An AUC ROC score.
classspacy.scorer.Scorer
Compute evaluation scores.
methodspacy.scorer.Scorer.score(examples:Iterable[Example], *per_component:bool=False) -> Dict[str, Any]
Evaluate a list of Examples.
methodspacy.scorer.Scorer.score_links(examples:Iterable[Example], *negative_labels:Iterable[str], **cfg) -> Dict[str, Any]
Returns PRF for predicted links on the entity level.
methodspacy.scorer.Scorer.score_tokenization(examples:Iterable[Example], **cfg) -> Dict[str, Any]
Returns accuracy and PRF scores for tokenization.
classspacy.tokens._serialize.DocBin
Pack Doc objects for binary serialization.
methodspacy.tokens._serialize.DocBin.add(doc:Doc) -> None
Add a Doc's annotations to the DocBin for serialization.
methodspacy.tokens._serialize.DocBin.from_bytes(bytes_data:bytes) -> 'DocBin'
Deserialize the DocBin's annotations from a bytestring.
methodspacy.tokens._serialize.DocBin.from_disk(path:Union[str, Path]) -> 'DocBin'
Load the DocBin from a file (typically called .spacy).
methodspacy.tokens._serialize.DocBin.get_docs(vocab:Vocab) -> Iterator[Doc]
Recover Doc objects from the annotations, using the given vocab.
methodspacy.tokens._serialize.DocBin.merge(other:'DocBin') -> None
Extend the annotations of this DocBin with the annotations from another.
methodspacy.tokens._serialize.DocBin.to_bytes() -> bytes
Serialize the DocBin's annotations to a bytestring.
methodspacy.tokens._serialize.DocBin.to_disk(path:Union[str, Path]) -> None
Save the DocBin to a file (typically called .spacy).
funcspacy.tokens.underscore.get_ext_args(**kwargs:Any)
Validate and convert arguments.
methodspacy.training.corpus.Corpus.read_docbin(vocab:Vocab, locs:Iterable[Union[str, Path]]) -> Iterator[Doc]
Yield training examples as example dicts
funcspacy.training.initialize.open_file(loc:Union[str, Path]) -> IO
Handle .gz, .tar.gz or unzipped files
funcspacy.training.loop.clean_output_dir(path:Optional[Path]) -> None
Remove an existing output directory.
funcspacy.training.loop.train(nlp:'Language', output_path:Optional[Path]=None, *use_gpu:int=-1, *stdout:IO=sys.stdout, *stderr:IO=sys.stderr) -> Tuple['Language', Optional[Path]]
Train a pipeline.
funcspacy.training.pretrain.make_update(model:Model, docs:Iterable[Doc], optimizer:Optimizer, objective_func:Callable) -> float
Perform an update over a single batch of documents.
funcspacy.util.add_lookups(default_func:Callable[[str], Any], *lookups) -> Callable[[str], Any]
Extend an attribute function with special cases.
funcspacy.util.check_bool_env_var(env_var:str) -> bool
Convert the value of an environment variable to a boolean.
funcspacy.util.compile_infix_regex(entries:Iterable[Union[str, Pattern]]) -> Pattern
Compile a sequence of infix rules into a regex object.
funcspacy.util.compile_prefix_regex(entries:Iterable[Union[str, Pattern]]) -> Pattern
Compile a sequence of prefix rules into a regex object.
funcspacy.util.compile_suffix_regex(entries:Iterable[Union[str, Pattern]]) -> Pattern
Compile a sequence of suffix rules into a regex object.
funcspacy.util.copy_config(config:Union[Dict[str, Any], Config]) -> Config
Deep copy a Config.
funcspacy.util.dict_to_dot(obj:Dict[str, dict], *for_overrides:bool=False) -> Dict[str, Any]
Convert dot notation to a dict.
funcspacy.util.dot_to_dict(values:Dict[str, Any]) -> Dict[str, dict]
Convert dot notation to a dict.
funcspacy.util.ensure_path(path:Any) -> Any
Ensure string is converted to a Path.
funcspacy.util.escape_html(text:str) -> str
Replace <, >, &, " with their HTML encoded representation.
funcspacy.util.filter_spans(spans:Iterable['Span']) -> List['Span']
Filter a sequence of spans and remove duplicates or overlaps.
funcspacy.util.find_available_port(start:int, host:str, auto_select:bool=False) -> int
Given a starting port and a host, handle finding a port.
funcspacy.util.get_arg_names(func:Callable) -> List[str]
Get a list of all named arguments of a function (regular, keyword-only).
funcspacy.util.get_base_version(version:str) -> str
Generate the base version without any prerelease identifiers.
funcspacy.util.get_lang_class(lang:str) -> Type['Language']
Import and load a Language class.
funcspacy.util.get_model_lower_version(constraint:str) -> Optional[str]
From a version range like >=1.2.3,<1.3.0 return the lower pin.
funcspacy.util.get_model_meta(path:Union[str, Path]) -> Dict[str, Any]
Get model meta.json from a directory path and validate its contents.
funcspacy.util.get_module_path(module:ModuleType) -> Path
Get the path of a Python module.
funcspacy.util.get_object_name(obj:Any) -> str
Get a human-readable name of a Python object, e.g.
funcspacy.util.get_package_path(name:str) -> Path
Get the path to an installed package.
funcspacy.util.get_package_version(name:str) -> Optional[str]
Get the version of an installed package.
funcspacy.util.import_file(name:str, loc:Union[str, Path]) -> ModuleType
Import module from a file.
funcspacy.util.is_compatible_version(version:str, constraint:str, prereleases:bool=True) -> Optional[bool]
Check if a version (e.g.
funcspacy.util.is_cython_func(func:Callable) -> bool
Slightly hacky check for whether a callable is implemented in Cython.
funcspacy.util.is_package(name:str) -> bool
Check if string maps to a package installed via pip.
funcspacy.util.is_prerelease_version(version:str) -> bool
Check whether a version is a prerelease version.
funcspacy.util.lang_class_is_loaded(lang:str) -> bool
Check whether a Language class is already loaded.
funcspacy.util.load_config(path:Union[str, Path], overrides:Dict[str, Any]=SimpleFrozenDict(), interpolate:bool=False) -> Config
Load a config file.
funcspacy.util.load_config_from_str(text:str, overrides:Dict[str, Any]=SimpleFrozenDict(), interpolate:bool=False)
Load a full config from a string.
funcspacy.util.load_language_data(path:Union[str, Path]) -> Union[dict, list]
Load JSON language data using the given path as a base.
funcspacy.util.load_meta(path:Union[str, Path]) -> Dict[str, Any]
Load a model meta.json from a path and validate its contents.
funcspacy.util.minibatch(items, size)
Iterate over batches of items.
funcspacy.util.minify_html(html:str) -> str
Perform a template-specific, rudimentary HTML minification for displaCy.
methodspacy.util.registry.ensure_populated() -> None
Ensure the registry is populated with all necessary components.
methodspacy.util.registry.get(registry_name:str, func_name:str) -> Callable
Get a registered function from the registry.
methodspacy.util.registry.get_registry_names() -> List[str]
List all available registries.
methodspacy.util.registry.has(registry_name:str, func_name:str) -> bool
Check whether a function is available in a registry.
funcspacy.util.replace_model_node(model:Model, target:Model, replacement:Model) -> None
Replace a node within a model with a new one, updating refs.
funcspacy.util.resolve_dot_names(config:Config, dot_names:List[Optional[str]]) -> Tuple[Any, ...]
Resolve one or more "dot notation" names, e.g.
funcspacy.util.run_command(command:Union[str, List[str]], *stdin:Optional[Any]=None, *capture:bool=False) -> subprocess.CompletedProcess
Run a command on the command line as a subprocess.
funcspacy.util.set_dot_to_object(config:Config, section:str, value:Any) -> None
Update a config at a given position from a dot notation.
funcspacy.util.set_lang_class(name:str, cls:Type['Language']) -> None
Set a custom Language class name that can be loaded via get_lang_class.
funcspacy.util.split_command(command:str) -> List[str]
Split a string command using shlex.
funcspacy.util.split_requirement(requirement:str) -> Tuple[str, str]
Split a requirement like spacy>=1.2.3 into ("spacy", ">=1.2.3").
funcspacy.util.update_exc(base_exceptions:Dict[str, List[dict]], *addition_dicts) -> Dict[str, List[dict]]
Update and validate tokenizer exceptions.
funcspacy.util.walk_dict(node:Dict[str, Any], parent:List[str]=[], *for_overrides:bool=False) -> Iterator[Tuple[List[str], Any]]
Walk a dict and yield the path and values of the leaves.
funcspacy.util.working_dir(path:Union[str, Path]) -> Iterator[Path]
Change current working directory and returns to previous on exit.

About this data

These signatures were extracted from the public source of explosion/spaCy using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries