spaCy top-level functions

spacy.load

Load a model via its shortcut link, the name of an installed model package, a unicode path or a Path-like object. spaCy will try resolving the load argument in this order. If a model is loaded from a shortcut link or package name, spaCy will assume it's a Python package and import it and call the model's own load() method. If a model is loaded from a path, spaCy will assume it's a data directory, read the language and pipeline settings off the meta.json and initialise the Language class. The data will be loaded in via Language.from_disk() .

NameTypeDescription
nameunicode or PathModel to load, i.e. shortcut link, package name or path.
disablelist Names of pipeline components to disable.
returnsLanguageA Language object with the loaded model.

spacy.info

The same as the info command . Pretty-print information about your installation, models and local setup from within spaCy. To get the model meta data as a dictionary instead, you can use the meta attribute on your nlp object with a loaded model, e.g. nlp['meta'].

NameTypeDescription
modelunicodeA model, i.e. shortcut link, package name or path (optional).
markdownboolPrint information as Markdown.

spacy.explain

Get a description for a given POS tag, dependency label or entity type. For a list of available terms, see glossary.py .

NameTypeDescription
termunicodeTerm to explain.
returnsunicodeThe explanation, or None if not found in the glossary.

spacy.set_factory

Set a factory that returns a custom processing pipeline component. Factories are useful for creating stateful components, especially ones which depend on shared data.

NameTypeDescription
factory_idunicode Unique name of factory. If added to a new pipeline, spaCy will look up the factory for this ID and use it to create the component.
factorycallable Callable that takes a Vocab object and returns a pipeline component.
Read next: displaCy