unstale

pypi / spacy

spacy

What changed in spacy 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.

80 breaking5 deprecations59 new APIs and options2 performance3 behavior and defaults1 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.3 on npm

spacy 3102 changes

Breaking changes 64

  • A component for setting token attributes using match patterns; it replaces language-data tag maps and morph rules.

    3.0.0upgrade guiderelease notes

  • Pipeline construction and training settings are now defined in config.cfg.

    3.0.0release notes

  • Custom components must be registered with Language.component or Language.factory decorators.

    3.0.0upgrade guide

  • Now accepts a list of patterns as its second argument instead of a variable number of arguments.

    3.0.0upgrade guide

  • Check whether a doc has annotation on a token attribute.

    3.0.0upgrade guiderelease notes

  • Doc.is_parsed was removed; use Doc.has_annotation.

    3.0.0release notes

  • Doc.is_tagged was removed; use Doc.has_annotation.

    3.0.0release notes

  • Doc.merge was removed; use Doc.retokenize.

    3.0.0release notes

  • Doc.tokens_from_list was removed; use Doc.__init__.

    3.0.0release notes

  • Use exclude=["vocab"] instead of vocab=False on serialization methods.

    3.0.0release notes

  • Removed and replaced by Corpus.

    3.0.0upgrade guiderelease notes

  • Removed and replaced by Example.

    3.0.0upgrade guiderelease notes

  • Convert word vectors for use with spaCy; it replaces spacy init-model.

    3.0.0upgrade guide

  • Various keyword arguments across functions and methods are now explicitly keyword-only.

    3.0.0release notes

  • KnowledgeBase.dump was removed; use KnowledgeBase.to_disk.

    3.0.0release notes

  • Removed and replaced by KnowledgeBase.get_alias_candidates.

    3.0.0upgrade guide

  • KnowledgeBase.load_bulk was removed; use KnowledgeBase.from_disk.

    3.0.0release notes

  • Pass a string name of the component factory instead of a component function; the method also returns the pipeline component.

    3.0.0upgrade guide

  • Removed and replaced by Language.initialize.

    3.0.0upgrade guide

  • Custom pipeline components need to use the @Language.component or @Language.factory decorator.

    3.0.0release notes

  • Disable a loaded pipeline component without removing it.

    3.0.0upgrade guide

  • Removed in favor of Language.select_pipes, Language.disable_pipe, and Language.enable_pipe.

    3.0.0upgrade guiderelease notes

  • Enable a loaded pipeline component.

    3.0.0upgrade guide

  • Language.entity was removed; use Language.get_pipe.

    3.0.0release notes

  • Now takes batches of Example objects instead of Docs and GoldParse objects or raw text with annotation dictionaries.

    3.0.0upgrade guide

  • The verbose argument was removed; use logging at DEBUG level.

    3.0.0release notes

  • Custom pipeline components need to use the @Language.factory or @Language.component decorator.

    3.0.0release notes

  • Initialize a model using a function that returns a sequence of Example objects; this replaces begin_training.

    3.0.0upgrade guiderelease notes

  • Language.parser was removed; use Language.get_pipe.

    3.0.0release notes

  • Use a context manager to enable or disable specific pipeline components for a block.

    3.0.0upgrade guide

  • Language.tagger was removed; use Language.get_pipe.

    3.0.0release notes

  • Now takes batches of Example objects instead of Docs and GoldParse objects or raw text with annotation dictionaries.

    3.0.0upgrade guide

  • Now accepts a list of patterns as its second argument instead of a variable number of arguments; on_match is an optional keyword argument.

    3.0.0upgrade guide

  • Matcher.pipe was removed because it is not needed.

    3.0.0release notes

  • A pipeline's meta.json now provides metadata only; it no longer constructs the processing pipeline.

    3.0.0release notes

  • Language-data morph rules were replaced by the AttributeRuler component.

    3.0.0upgrade guide

  • The n_threads argument was removed from Tokenizer, Matcher, and PhraseMatcher; use n_process.

    3.0.0release notes

  • Now accepts a list of patterns as its second argument instead of a variable number of arguments; on_match is an optional keyword argument.

    3.0.0upgrade guide

  • PhraseMatcher.pipe was removed because it is not needed.

    3.0.0release notes

  • The -PRON- indicator for pronoun lemmas has been removed.

    3.0.0release notes

  • The pronoun-lemma symbol was removed.

    3.0.0upgrade guiderelease notes

  • spaCy drops Python 2 support and requires Python 3.6 or later.

    3.0.0upgrade guide

  • The SentenceSegmenter hook was removed; use user hooks, Sentencizer, or SentenceRecognizer.

    3.0.0release notes

  • Shortcuts such as en are no longer supported; load a pipeline using its full package name.

    3.0.0upgrade guide

  • SimilarityHook was removed; use user hooks, Sentencizer, or SentenceRecognizer.

    3.0.0release notes

  • Removed and replaced by spacy debug data.

    3.0.0upgrade guiderelease notes

  • The debug data command now only takes a config.cfg.

    3.0.0release notes

  • Removed and replaced by spacy init vectors.

    3.0.0upgrade guiderelease notes

  • The pretrain command now only takes a config.cfg.

    3.0.0release notes

  • spacy profile was removed; use spacy debug profile.

    3.0.0release notes

  • Training now takes a config.cfg file rather than many command-line arguments.

    3.0.0upgrade guiderelease notes

  • The spacy.gold module is renamed to spacy.training.

    3.0.0upgrade guiderelease notes

  • A binary training data format created by serializing a DocBin, representing a collection of Doc objects.

    3.0.0upgrade guide

  • Span.lower was removed.

    3.0.0release notes

  • Span.merge was removed; use Doc.retokenize.

    3.0.0release notes

  • Span.string was removed; use Span.text.

    3.0.0release notes

  • Span.upper was removed.

    3.0.0release notes

  • Language-data tag maps were replaced by the AttributeRuler component.

    3.0.0upgrade guide

  • The textcat component now supports only mutually exclusive classes, with one predicted class per input; use textcat_multilabel for multi-label classification.

    3.0.0upgrade guide

  • Use this component for multi-label classification; textcat is now limited to mutually exclusive classes.

    3.0.0upgrade guide

  • Token.string was removed; use Token.text.

    3.0.0release notes

  • Now takes batches of Example objects instead of Docs and GoldParse objects or raw text with annotation dictionaries.

    3.0.0upgrade guide

  • util.get_data_path was removed; symlinks are deprecated and the method is not needed.

    3.0.0release notes

  • util.set_data_path was removed; symlinks are deprecated and the method is not needed.

    3.0.0release notes

Deprecations 3

  • The link command is deprecated; use full pipeline package names explicitly.

    3.0.0release notes

  • Shortcut names for pipelines are deprecated; use full package names explicitly.

    3.0.0release notes

  • The link command and pipeline package symlinks are deprecated; use full pipeline package names explicitly.

    3.0.0upgrade guiderelease notes

New APIs and options 31

  • Select whether spacy package builds none, a wheel, or both an sdist and wheel.

    3.0.0upgrade guide

  • A single config file describes training settings and hyperparameters, enabling configurable, repeatable training without hidden defaults.

    3.0.0upgrade guide

  • A new trained German transformer-based pipeline using bert-base-german-cased.

    3.0.0upgrade guide

  • Debug training configurations.

    3.0.0upgrade guide

  • Match patterns within dependency parses using Semgrex operators and an API that follows the token-based Matcher.

    3.0.0upgrade guide

  • Store and access named span groups, including collections of potentially overlapping spans.

    3.0.0upgrade guide

  • A new trained English transformer-based pipeline using roberta-base.

    3.0.0upgrade guide

  • A new trained Spanish transformer-based pipeline using bert-base-spanish-wwm-cased.

    3.0.0upgrade guide

  • A new trained French transformer-based pipeline using camembert-base.

    3.0.0upgrade guide

  • Initialize a starter training configuration.

    3.0.0upgrade guide

  • Fill a starter training configuration with default values.

    3.0.0upgrade guide

  • Generate JSON files for labels in the data to speed up training.

    3.0.0upgrade guide

  • Use this callback to modify tokenizer settings when training from a base model.

    3.0.0upgrade guide

  • Analyze the current pipeline and report component attributes, training scores, and required attributes that are not set.

    3.0.0upgrade guide

  • Register pipeline component factories and define default configuration and metadata.

    3.0.0upgrade guide

  • Experimentally continue training a trained pipeline and initialize rehearsal for components that implement a rehearse method.

    3.0.0upgrade guide

  • A standalone component for rule-based and lookup lemmatization that can be explicitly added and configured.

    3.0.0upgrade guide

  • Component models use a unified API and can serve as sublayers in larger networks, including combinations of implementations from different frameworks.

    3.0.0upgrade guide

  • A trainable component that predicts morphological features.

    3.0.0upgrade guide

  • A suite of CLI commands lets developers clone, run, and manage end-to-end spaCy projects.

    3.0.0upgrade guide

  • Map functions to string names that can be referenced in configuration files.

    3.0.0upgrade guide

  • A trainable pipeline component for sentence segmentation.

    3.0.0upgrade guide

  • An extension package that adds the ray command to the spaCy CLI for parallel training when installed in the same environment.

    3.0.0upgrade guide

  • Run parallel training with Ray on one or more remote machines.

    3.0.0upgrade guide

  • Provides the Transformer pipeline component for using transformer models, accessing outputs, and aligning tokens.

    3.0.0upgrade guide

  • Access a token’s Lexeme.

    3.0.0upgrade guide

  • Access a token’s morphological analysis.

    3.0.0upgrade guide

  • A base class for trainable pipeline components.

    3.0.0upgrade guide

  • Trained components can be sourced from other pipelines in the training config.

    3.0.0release notes

  • Use pretrained transformers in spaCy pipelines, share a transformer across components with multi-task learning, and interoperate with PyTorch and HuggingFace transformers.

    3.0.0upgrade guide

  • A new trained Chinese transformer-based pipeline using bert-base-chinese.

    3.0.0upgrade guide

Performance 1

  • Pre-built binary wheels are available for all trained pipeline packages and are more efficient.

    3.0.0release notes

Behavior and default changes 3

  • Matcher supports greedy patterns.

    3.0.0release notes

  • spaCy adopts pydantic for data validation, including validation of typed arguments for registered config functions.

    3.0.0upgrade guide

  • Automatically builds an installable sdist; --build can select none, wheel, or sdist,wheel.

    3.0.0upgrade guide

spacy 248 changes

Breaking changes 16

  • Emoji are split into separate tokens wherever possible.

    2.0.0release notes

  • Training now explicitly begins with this method, which returns an optimizer to pass to update; it replaces Language.end_training.

    2.0.0upgrade guiderelease notes

  • This replaces the former Language.create_make_doc attribute.

    2.0.0upgrade guide

  • The Matcher API is revised.

    2.0.0release notes

  • Patterns are added with a match ID, optional callback and one or more patterns in a single call.

    2.0.0upgrade guide

  • This replaces Matcher.get_entity.

    2.0.0upgrade guide

  • This replaces Matcher.has_entity.

    2.0.0upgrade guide

  • Serialization is consistent across objects; containers and pipeline components expose disk and bytes serialization methods, with Pickle support.

    2.0.0release notes

  • Language-specific data now lives in this submodule, and language data is lazy-loaded when a Language class or model is loaded.

    2.0.0upgrade guide

  • English language data and Language classes are imported from the new spacy.lang submodule rather than spacy.en.

    2.0.0upgrade guide

  • Calls to spacy.load should no longer use the path keyword argument; use Language.from_disk when loading only binary data.

    2.0.0upgrade guide

  • Strings resolve to hash values instead of state-dependent integer IDs, so mappings match across vocabularies and models.

    2.0.0upgrade guide

  • This replaces Tagger.tag_names.

    2.0.0upgrade guide

  • This replaces Token.is_ancestor_of.

    2.0.0upgrade guide

  • Models trained with v1.x input are incompatible with v2.0 and must be retrained.

    2.0.0upgrade guiderelease notes

  • Vector resizing moves from Vocab.resize_vectors to Vectors.resize.

    2.0.0upgrade guide

Deprecations 2

  • This attribute is deprecated and should be replaced with Span.is_sent_start.

    2.0.0upgrade guide

  • This method is deprecated and should be replaced with Doc.

    2.0.0upgrade guide

New APIs and options 28

  • This boolean keyword argument accepts an iterator of text-context pairs and returns an iterator of Doc-context tuples.

    2.0.0upgrade guiderelease notes

  • New neural models for tagging, parsing and entity recognition are smaller, more accurate and cheaper to run than the previous generation.

    2.0.0upgrade guide

  • Pipeline components can be functions that receive, modify and return a Doc, allowing custom processing at pipeline stages.

    2.0.0upgrade guide

  • A list of component names can be passed when loading to disable those pipeline components.

    2.0.0upgrade guide

  • The dependency and named entity visualizers are now part of spaCy and can serve a web page or generate HTML or SVG, with Jupyter rendering detected automatically.

    2.0.0upgrade guide

  • Extension attributes can add custom attributes, properties and methods to Doc objects.

    2.0.0release notes

  • Custom attributes, properties and methods can be added to Doc, Token and Span objects.

    2.0.0upgrade guide

  • The new English model makes about 25% fewer mistakes than its v1.x counterpart and is within 1% of the current state-of-the-art.

    2.0.0upgrade guide

  • Container classes including Language, Doc, Vocab and StringStore now expose a consistent byte-deserialization method supporting the Pickle protocol.

    2.0.0upgrade guide

  • Container classes including Language, Doc, Vocab and StringStore now expose a consistent disk-deserialization method.

    2.0.0upgrade guide

  • Built-in pipeline components can be created by component name, including tagger, parser, ner and textcat.

    2.0.0upgrade guide

  • Pipeline components can be disabled with this method or context manager.

    2.0.0upgrade guide

  • In addition to Doc and GoldParse sequences, update accepts strings and dictionaries describing annotations.

    2.0.0upgrade guiderelease notes

  • spaCy now supports simple lookup-based lemmatization.

    2.0.0upgrade guide

  • A matcher for efficiently matching large terminology lists using Doc objects as patterns.

    2.0.0upgrade guide

  • When creating a vocabulary with spacy init-model, this flag automatically prunes vectors.

    2.0.0upgrade guide

  • An entry point for the spacy command is provided as an alternative to python -m spacy.

    2.0.0release notes

  • A blank language can be initialized with this function instead of importing its Language class directly.

    2.0.0upgrade guide

  • Models can be loaded by shortcut link, installed model package name or path, with the Language class selected from model settings.

    2.0.0upgrade guide

  • Extension attributes can add custom attributes, properties and methods to Span objects.

    2.0.0release notes

  • Strings can be added explicitly to the StringStore with this method.

    2.0.0upgrade guide

  • Text categorization models can be added to pipelines, supporting multiple labels that are not mutually exclusive.

    2.0.0upgrade guide

  • Container classes including Language, Doc, Vocab and StringStore now expose a consistent byte-serialization method supporting the Pickle protocol.

    2.0.0upgrade guide

  • Container classes including Language, Doc, Vocab and StringStore now expose a consistent disk-serialization method.

    2.0.0upgrade guide

  • Extension attributes can add custom attributes, properties and methods to Token objects.

    2.0.0release notes

  • A token’s hash is available through this attribute.

    2.0.0upgrade guide

  • The new class manages vectors assigned to strings, supports individual assignments and GloVe loading, and can map multiple keys to one table row.

    2.0.0upgrade guide

  • Vectors can be pruned through this new Vocab method.

    2.0.0upgrade guide

Performance 1

  • Batching documents with this method brings a significant performance advantage when processing documents in a row.

    2.0.0upgrade guiderelease notes

Fixes and other changes 1