Skip to content

Add anySeg to the spaCy Universe - #14066

Closed
SergeyShk wants to merge 2 commits into
explosion:masterfrom
SergeyShk:universe-anyseg
Closed

SergeyShk wants to merge 2 commits into
explosion:masterfrom
SergeyShk:universe-anyseg

Conversation

@SergeyShk

@SergeyShk SergeyShk commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Added anySeg to the spaCy Universe.

anySeg segments text into tokens, words and sentences with their positions in the source text, following the conventions of Universal Dependencies. The core is written in Rust and the text is never changed. Russian and Spanish are supported.

Its spaCy integration (pip install "anyseg[spacy]") adds the tokenizer anyseg.Tokenizer.v1 and the component anyseg_sentencizer, registered through entry points, so they are used by name in a config. The component sets sentence starts before the parser, which keeps them. The words of a multiword token, such as Spanish del, are in token._.anyseg_words.

On the UD test sets, from raw text:

  • with ru_core_news_sm, sentence F1 goes from 95.4% to 98.9% on SynTagRus and from 80.4% to 89.9% on Taiga, and LAS rises by 1 to 3.5 points;
  • with es_core_news_sm, sentence F1 goes from 97.7% to 98.7% on AnCora and from 88.1% to 91.0% on GSD, and LAS rises by 1.2 to 1.7 points;
  • on Russian text, the tokenizer is about ten times faster than the default one.

Docs: https://sergeyshk.github.io/anySeg/spacy/

Types of change

An enhancement to the spaCy Universe: a new entry in website/meta/universe.json.

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed. (python .github/validate_universe_json.py website/meta/universe.json; the code example runs with anySeg 0.3.0 and ru_core_news_sm 3.8.0.)
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

SergeyShk and others added 2 commits October 31, 2026 19:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SergeyShk

Copy link
Copy Markdown
Contributor Author

Closing: anySeg 0.5.0 removes the spaCy integration, so this entry would describe a package extra that no longer exists. The integration remains in 0.4 (pip install "anyseg[spacy]>=0.4,<0.5"). Thank you for your time.

@SergeyShk SergeyShk closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant