repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/lv/test_tokenizer.py
spacy/tests/lang/lv/test_tokenizer.py
import pytest LV_BASIC_TOKENIZATION_TESTS = [ ( "Nevienu nedrīkst spīdzināt vai cietsirdīgi vai pazemojoši ar viņu " "apieties vai sodīt.", [ "Nevienu", "nedrīkst", "spīdzināt", "vai", "cietsirdīgi", "vai", ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/da/test_prefix_suffix_infix.py
spacy/tests/lang/da/test_prefix_suffix_infix.py
import pytest @pytest.mark.parametrize("text", ["(under)"]) def test_da_tokenizer_splits_no_special(da_tokenizer, text): tokens = da_tokenizer(text) assert len(tokens) == 3 @pytest.mark.parametrize("text", ["ta'r", "Søren's", "Lars'"]) def test_da_tokenizer_handles_no_punct(da_tokenizer, text): tokens =...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/da/test_text.py
spacy/tests/lang/da/test_text.py
import pytest from spacy.lang.da.lex_attrs import like_num def test_da_tokenizer_handles_long_text(da_tokenizer): text = """Der var så dejligt ude på landet. Det var sommer, kornet stod gult, havren grøn, høet var rejst i stakke nede i de grønne enge, og der gik storken på sine lange, røde ben og snakkede ægypti...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/da/__init__.py
spacy/tests/lang/da/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/da/test_exceptions.py
spacy/tests/lang/da/test_exceptions.py
import pytest @pytest.mark.parametrize("text", ["ca.", "m.a.o.", "Jan.", "Dec.", "kr.", "jf."]) def test_da_tokenizer_handles_abbr(da_tokenizer, text): tokens = da_tokenizer(text) assert len(tokens) == 1 @pytest.mark.parametrize("text", ["Jul.", "jul.", "Tor.", "Tors."]) def test_da_tokenizer_handles_ambigu...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/da/test_noun_chunks.py
spacy/tests/lang/da/test_noun_chunks.py
import pytest from spacy.tokens import Doc def test_noun_chunks_is_parsed(da_tokenizer): """Test that noun_chunks raises Value Error for 'da' language if Doc is not parsed. To check this test, we're constructing a Doc with a new Vocab here and forcing is_parsed to 'False' to make sure the noun chunks...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/tt/__init__.py
spacy/tests/lang/tt/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/tt/test_tokenizer.py
spacy/tests/lang/tt/test_tokenizer.py
import pytest INFIX_HYPHEN_TESTS = [ ("Явым-төшем күләме.", "Явым-төшем күләме .".split()), ("Хатын-кыз киеме.", "Хатын-кыз киеме .".split()), ] PUNC_INSIDE_WORDS_TESTS = [ ( "Пассаҗир саны - 2,13 млн — кеше/көндә (2010), 783,9 млн. кеше/елда.", "Пассаҗир саны - 2,13 млн — кеше / көндә ( 2...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/sl/test_text.py
spacy/tests/lang/sl/test_text.py
import pytest def test_long_text(sl_tokenizer): # Excerpt: European Convention on Human Rights text = """ upoštevajoč, da si ta deklaracija prizadeva zagotoviti splošno in učinkovito priznavanje in spoštovanje v njej razglašenih pravic, upoštevajoč, da je cilj Sveta Evrope doseči večjo enotnost med njegovimi ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/sl/__init__.py
spacy/tests/lang/sl/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/sl/test_tokenizer.py
spacy/tests/lang/sl/test_tokenizer.py
import pytest SL_BASIC_TOKENIZATION_TESTS = [ ( "Vsakdo ima pravico do spoštovanja njegovega zasebnega in " "družinskega življenja, doma in dopisovanja.", [ "Vsakdo", "ima", "pravico", "do", "spoštovanja", "njegovega", ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/et/test_text.py
spacy/tests/lang/et/test_text.py
import pytest def test_long_text(et_tokenizer): # Excerpt: European Convention on Human Rights text = """ arvestades, et nimetatud deklaratsiooni eesmärk on tagada selles kuulutatud õiguste üldine ja tõhus tunnustamine ning järgimine; arvestades, et Euroopa Nõukogu eesmärk on saavutada tema liikmete suurem üh...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/et/__init__.py
spacy/tests/lang/et/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/lang/et/test_tokenizer.py
spacy/tests/lang/et/test_tokenizer.py
import pytest ET_BASIC_TOKENIZATION_TESTS = [ ( "Kedagi ei või piinata ega ebainimlikult või alandavalt kohelda " "ega karistada.", [ "Kedagi", "ei", "või", "piinata", "ega", "ebainimlikult", "või", ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/morphology/test_morph_converters.py
spacy/tests/morphology/test_morph_converters.py
from spacy.morphology import Morphology def test_feats_converters(): feats = "Case=dat,gen|Number=sing" feats_dict = {"Case": "dat,gen", "Number": "sing"} # simple conversions assert Morphology.dict_to_feats(feats_dict) == feats assert Morphology.feats_to_dict(feats) == feats_dict # roundtri...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/morphology/test_morph_pickle.py
spacy/tests/morphology/test_morph_pickle.py
import pickle import pytest from spacy.morphology import Morphology from spacy.strings import StringStore @pytest.fixture def morphology(): morphology = Morphology(StringStore()) morphology.add("Feat1=Val1|Feat2=Val2") morphology.add("Feat3=Val3|Feat4=Val4") return morphology def test_morphology_p...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/morphology/__init__.py
spacy/tests/morphology/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/morphology/test_morph_features.py
spacy/tests/morphology/test_morph_features.py
import pytest from spacy.morphology import Morphology from spacy.strings import StringStore, get_string_id @pytest.fixture def morphology(): return Morphology(StringStore()) def test_init(morphology): pass def test_add_morphology_with_string_names(morphology): morphology.add({"Case": "gen", "Number":...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/vocab_vectors/test_similarity.py
spacy/tests/vocab_vectors/test_similarity.py
import numpy import pytest from spacy.tokens import Doc from spacy.vocab import Vocab from ..util import add_vecs_to_vocab, get_cosine @pytest.fixture def vectors(): return [("apple", [1, 2, 3]), ("orange", [-1, -2, -3])] @pytest.fixture() def vocab(en_vocab, vectors): add_vecs_to_vocab(en_vocab, vectors)...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/vocab_vectors/test_vectors.py
spacy/tests/vocab_vectors/test_vectors.py
import numpy import pytest from numpy.testing import assert_allclose, assert_almost_equal, assert_equal from thinc.api import NumpyOps, get_current_ops from spacy.lang.en import English from spacy.strings import hash_string # type: ignore from spacy.tokenizer import Tokenizer from spacy.tokens import Doc from spacy.t...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/vocab_vectors/test_vocab_api.py
spacy/tests/vocab_vectors/test_vocab_api.py
import os import pytest from spacy.attrs import IS_ALPHA, LEMMA, ORTH from spacy.lang.en import English from spacy.parts_of_speech import NOUN, VERB from spacy.vocab import Vocab from ..util import make_tempdir @pytest.mark.issue(1868) def test_issue1868(): """Test Vocab.__contains__ works with int keys.""" ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/vocab_vectors/test_lexeme.py
spacy/tests/vocab_vectors/test_lexeme.py
import numpy import pytest from spacy.attrs import IS_ALPHA, IS_DIGIT from spacy.lookups import Lookups from spacy.tokens import Doc from spacy.util import OOV_RANK from spacy.vocab import Vocab @pytest.mark.issue(361) @pytest.mark.parametrize("text1,text2", [("cat", "dog")]) def test_issue361(en_vocab, text1, text2...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/vocab_vectors/test_memory_zone.py
spacy/tests/vocab_vectors/test_memory_zone.py
from spacy.vocab import Vocab def test_memory_zone_no_insertion(): vocab = Vocab() with vocab.memory_zone(): pass lex = vocab["horse"] assert lex.text == "horse" def test_memory_zone_insertion(): vocab = Vocab() _ = vocab["dog"] assert "dog" in vocab assert "horse" not in voc...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/vocab_vectors/__init__.py
spacy/tests/vocab_vectors/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/vocab_vectors/test_stringstore.py
spacy/tests/vocab_vectors/test_stringstore.py
import pytest from spacy.strings import StringStore @pytest.fixture def stringstore(): return StringStore() def test_string_hash(stringstore): """Test that string hashing is stable across platforms""" assert stringstore.add("apple") == 8566208034543834098 heart = "\U0001f499" h = stringstore.ad...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/vocab_vectors/test_lookups.py
spacy/tests/vocab_vectors/test_lookups.py
import pytest from spacy.lookups import Lookups, Table from spacy.strings import get_string_id from spacy.vocab import Vocab from ..util import make_tempdir def test_lookups_api(): table_name = "test" data = {"foo": "bar", "hello": "world"} lookups = Lookups() lookups.add_table(table_name, data) ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/tokenizer/test_whitespace.py
spacy/tests/tokenizer/test_whitespace.py
import pytest @pytest.mark.parametrize("text", ["lorem ipsum"]) def test_tokenizer_splits_single_space(tokenizer, text): tokens = tokenizer(text) assert len(tokens) == 2 @pytest.mark.parametrize("text", ["lorem ipsum"]) def test_tokenizer_splits_double_space(tokenizer, text): tokens = tokenizer(text) ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/tokenizer/test_urls.py
spacy/tests/tokenizer/test_urls.py
import pytest from spacy.lang.tokenizer_exceptions import BASE_EXCEPTIONS URLS_BASIC = [ "http://www.nytimes.com/2016/04/20/us/politics/new-york-primary-preview.html?hp&action=click&pgtype=Homepage&clickSource=story-heading&module=a-lede-package-region&region=top-news&WT.nav=top-news&_r=0", "www.red-stars.com...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/tokenizer/test_explain.py
spacy/tests/tokenizer/test_explain.py
import re import string import hypothesis import hypothesis.strategies import pytest import spacy from spacy.tokenizer import Tokenizer from spacy.util import get_lang_class # Only include languages with no external dependencies # "is" seems to confuse importlib, so we're also excluding it for now # excluded: ja, ru...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/tokenizer/test_naughty_strings.py
spacy/tests/tokenizer/test_naughty_strings.py
import pytest # Examples taken from the "Big List of Naughty Strings" # https://github.com/minimaxir/big-list-of-naughty-strings NAUGHTY_STRINGS = [ # ASCII punctuation r",./;'[]\-=", r'<>?:"{}|_+', r'!@#$%^&*()`~"', # Unicode additional control characters, byte order marks r"­؀؁؂؃؄؅؜۝܏᠎​‌‍‎‏...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/tokenizer/__init__.py
spacy/tests/tokenizer/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/tokenizer/test_exceptions.py
spacy/tests/tokenizer/test_exceptions.py
import sys import pytest def test_tokenizer_handles_emoticons(tokenizer): # Tweebo challenge (CMU) text = ( """:o :/ :'( >:o (: :) >.< XD -__- o.O ;D :-) @_@ :P 8D :1 >:( :D =| :> ....""" ) tokens = tokenizer(text) assert tokens[0].text == ":o" assert tokens[1].text == ":/" assert...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/tokenizer/test_tokenizer.py
spacy/tests/tokenizer/test_tokenizer.py
import re import numpy import pytest from spacy.lang.de import German from spacy.lang.en import English from spacy.symbols import ORTH from spacy.tokenizer import Tokenizer from spacy.tokens import Doc from spacy.training import Example from spacy.util import ( compile_infix_regex, compile_prefix_regex, c...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/test_logger.py
spacy/tests/training/test_logger.py
import pytest import spacy from spacy.training import loggers @pytest.fixture() def nlp(): nlp = spacy.blank("en") nlp.add_pipe("ner") return nlp @pytest.fixture() def info(): return { "losses": {"ner": 100}, "other_scores": {"ENTS_F": 0.85, "ENTS_P": 0.90, "ENTS_R": 0.80}, ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/test_corpus.py
spacy/tests/training/test_corpus.py
import tempfile from contextlib import contextmanager from pathlib import Path from typing import IO, Generator, Iterable, List, TextIO, Tuple import pytest from spacy.lang.en import English from spacy.training import Example, PlainTextCorpus from spacy.util import make_tempdir # Intentional newlines to check that t...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/test_new_example.py
spacy/tests/training/test_new_example.py
import pytest from spacy.tokens import Doc from spacy.training.example import Example from spacy.util import to_ternary_int from spacy.vocab import Vocab def test_Example_init_requires_doc_objects(): vocab = Vocab() with pytest.raises(TypeError): Example(None, None) with pytest.raises(TypeError):...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/test_readers.py
spacy/tests/training/test_readers.py
from typing import Callable, Dict, Iterable import pytest from thinc.api import Config, fix_random_seed from spacy import Language from spacy.schemas import ConfigSchemaTraining from spacy.training import Example from spacy.util import load_model_from_config, registry, resolve_dot_names def test_readers(): conf...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/test_rehearse.py
spacy/tests/training/test_rehearse.py
from typing import List import pytest import spacy from spacy.training import Example TRAIN_DATA = [ ( "Who is Kofi Annan?", { "entities": [(7, 18, "PERSON")], "tags": ["PRON", "AUX", "PROPN", "PRON", "PUNCT"], "heads": [1, 1, 3, 1, 1], "deps": ["at...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/test_training.py
spacy/tests/training/test_training.py
import random import numpy import pytest import srsly from thinc.api import Adam, compounding import spacy from spacy.lang.en import English from spacy.tokens import Doc, DocBin from spacy.training import ( Alignment, Corpus, Example, biluo_tags_to_offsets, biluo_tags_to_spans, docs_to_json, ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
true
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/test_pretraining.py
spacy/tests/training/test_pretraining.py
from pathlib import Path import numpy as np import pytest import srsly from thinc.api import Config, get_current_ops from spacy import util from spacy.lang.en import English from spacy.language import DEFAULT_CONFIG_PATH, DEFAULT_CONFIG_PRETRAIN_PATH from spacy.ml.models.multi_task import create_pretrain_vectors from...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/__init__.py
spacy/tests/training/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/training/test_augmenters.py
spacy/tests/training/test_augmenters.py
import random from contextlib import contextmanager import pytest from spacy.lang.en import English from spacy.pipeline._parser_internals.nonproj import contains_cycle from spacy.tokens import Doc, DocBin, Span from spacy.training import Corpus, Example from spacy.training.augment import ( create_lower_casing_aug...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/package/test_requirements.py
spacy/tests/package/test_requirements.py
import re from pathlib import Path def test_build_dependencies(): # Check that library requirements are pinned exactly the same across different setup files. libs_ignore_requirements = [ "numpy", "pytest", "pytest-timeout", "mock", "flake8", "hypothesis", ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/package/__init__.py
spacy/tests/package/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_pickle_doc.py
spacy/tests/doc/test_pickle_doc.py
from spacy.compat import pickle from spacy.language import Language def test_pickle_single_doc(): nlp = Language() doc = nlp("pickle roundtrip") data = pickle.dumps(doc, 1) doc2 = pickle.loads(data) assert doc2.text == "pickle roundtrip" def test_list_of_docs_pickles_efficiently(): nlp = Lan...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_retokenize_split.py
spacy/tests/doc/test_retokenize_split.py
import numpy import pytest from spacy.tokens import Doc, Token from spacy.vocab import Vocab @pytest.mark.issue(3540) def test_issue3540(en_vocab): words = ["I", "live", "in", "NewYork", "right", "now"] tensor = numpy.asarray( [[1.0, 1.1], [2.0, 2.1], [3.0, 3.1], [4.0, 4.1], [5.0, 5.1], [6.0, 6.1]], ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_json_doc_conversion.py
spacy/tests/doc/test_json_doc_conversion.py
import pytest import srsly import spacy from spacy import schemas from spacy.tokens import Doc, Span, Token from .test_underscore import clean_underscore # noqa: F401 @pytest.fixture() def doc(en_vocab): words = ["c", "d", "e"] spaces = [True, True, True] pos = ["VERB", "NOUN", "NOUN"] tags = ["VBP...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_array.py
spacy/tests/doc/test_array.py
import numpy import pytest from spacy.attrs import DEP, MORPH, ORTH, POS, SHAPE from spacy.tokens import Doc @pytest.mark.issue(2203) def test_issue2203(en_vocab): """Test that lemmas are set correctly in doc.from_array.""" words = ["I", "'ll", "survive"] tags = ["PRP", "MD", "VB"] lemmas = ["-PRON-"...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_span_group.py
spacy/tests/doc/test_span_group.py
from random import Random from typing import List import pytest from spacy.matcher import Matcher from spacy.tokens import Doc, Span, SpanGroup from spacy.util import filter_spans @pytest.fixture def doc(en_tokenizer): doc = en_tokenizer("0 1 2 3 4 5 6") matcher = Matcher(en_tokenizer.vocab, validate=True) ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_doc_api.py
spacy/tests/doc/test_doc_api.py
import warnings import weakref import numpy import pytest from numpy.testing import assert_array_equal from thinc.api import NumpyOps, get_current_ops from spacy.attrs import ( DEP, ENT_IOB, ENT_TYPE, HEAD, IS_ALPHA, MORPH, POS, SENT_START, TAG, ) from spacy.lang.en import English ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
true
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_graph.py
spacy/tests/doc/test_graph.py
from spacy.tokens.doc import Doc from spacy.tokens.graph import Graph from spacy.vocab import Vocab def test_graph_init(): doc = Doc(Vocab(), words=["a", "b", "c", "d"]) graph = Graph(doc, name="hello") assert graph.name == "hello" assert graph.doc is doc def test_graph_edges_and_nodes(): doc = ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_creation.py
spacy/tests/doc/test_creation.py
import pytest from spacy import util from spacy.tokens import Doc from spacy.vocab import Vocab @pytest.fixture def vocab(): return Vocab() def test_empty_doc(vocab): doc = Doc(vocab) assert len(doc) == 0 def test_single_word(vocab): doc = Doc(vocab, words=["a"]) assert doc.text == "a " d...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_span.py
spacy/tests/doc/test_span.py
import numpy import pytest from numpy.testing import assert_array_equal from thinc.api import get_current_ops from spacy.attrs import LENGTH, ORTH from spacy.lang.en import English from spacy.tokens import Doc, Span, Token from spacy.util import filter_spans from spacy.vocab import Vocab from ..util import add_vecs_t...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/__init__.py
spacy/tests/doc/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_morphanalysis.py
spacy/tests/doc/test_morphanalysis.py
import pytest @pytest.fixture def i_has(en_tokenizer): doc = en_tokenizer("I has") doc[0].set_morph({"PronType": "prs"}) doc[1].set_morph( { "VerbForm": "fin", "Tense": "pres", "Number": "sing", "Person": "three", } ) return doc de...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_add_entities.py
spacy/tests/doc/test_add_entities.py
import pytest from spacy import registry from spacy.pipeline import EntityRecognizer from spacy.pipeline.ner import DEFAULT_NER_MODEL from spacy.tokens import Doc, Span from spacy.training import Example def _ner_example(ner): doc = Doc( ner.vocab, words=["Joe", "loves", "visiting", "London", "du...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_token_api.py
spacy/tests/doc/test_token_api.py
import numpy import pytest from spacy.attrs import IS_ALPHA, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_STOP, IS_TITLE from spacy.symbols import VERB from spacy.tokens import Doc from spacy.training import Example from spacy.vocab import Vocab @pytest.fixture def doc(en_vocab): # fmt: off words = ["This", "is", "a", "...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_retokenize_merge.py
spacy/tests/doc/test_retokenize_merge.py
import pytest from spacy.attrs import LEMMA from spacy.tokens import Doc, Token from spacy.vocab import Vocab def test_doc_retokenize_merge(en_tokenizer): text = "WKRO played songs by the beach boys all night" attrs = { "tag": "NAMED", "lemma": "LEMMA", "ent_type": "TYPE", "mo...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/doc/test_underscore.py
spacy/tests/doc/test_underscore.py
import pytest from mock import Mock from spacy.tokens import Doc, Span, Token from spacy.tokens.underscore import Underscore @pytest.fixture(scope="function", autouse=True) def clean_underscore(): # reset the Underscore object after the test, to avoid having state copied across tests yield Underscore.doc...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_preset_sbd.py
spacy/tests/parser/test_preset_sbd.py
import pytest from thinc.api import Adam from spacy import registry from spacy.attrs import NORM from spacy.pipeline import DependencyParser from spacy.pipeline.dep_parser import DEFAULT_PARSER_MODEL from spacy.tokens import Doc from spacy.training import Example from spacy.vocab import Vocab @pytest.fixture def voc...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_parse_navigate.py
spacy/tests/parser/test_parse_navigate.py
import pytest from spacy.tokens import Doc @pytest.fixture def words(): # fmt: off return [ "\n", "It", "was", "a", "bright", "cold", "day", "in", "April", ",", "and", "the", "clocks", "were", "striking", "thirteen", ".", "\n", "Winston", "Smith", ",", "his", "chin", "nuzzled", "into"...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_add_label.py
spacy/tests/parser/test_add_label.py
import pytest from thinc.api import Adam, fix_random_seed from spacy import registry from spacy.attrs import NORM from spacy.language import Language from spacy.pipeline import DependencyParser, EntityRecognizer from spacy.pipeline.dep_parser import DEFAULT_PARSER_MODEL from spacy.pipeline.ner import DEFAULT_NER_MODEL...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_ner.py
spacy/tests/parser/test_ner.py
import logging import random import pytest from numpy.testing import assert_equal from spacy import registry, util from spacy.attrs import ENT_IOB from spacy.lang.en import English from spacy.lang.it import Italian from spacy.language import Language from spacy.lookups import Lookups from spacy.pipeline import Entity...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_nn_beam.py
spacy/tests/parser/test_nn_beam.py
import hypothesis import hypothesis.strategies import numpy import pytest from thinc.tests.strategies import ndarrays_of_shape from spacy.language import Language from spacy.pipeline._parser_internals._beam_utils import BeamBatch from spacy.pipeline._parser_internals.arc_eager import ArcEager from spacy.pipeline._pars...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_arc_eager_oracle.py
spacy/tests/parser/test_arc_eager_oracle.py
import pytest from spacy import registry from spacy.pipeline import DependencyParser from spacy.pipeline._parser_internals.arc_eager import ArcEager from spacy.pipeline._parser_internals.nonproj import projectivize from spacy.pipeline.dep_parser import DEFAULT_PARSER_MODEL from spacy.tokens import Doc from spacy.train...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_state.py
spacy/tests/parser/test_state.py
import pytest from spacy.pipeline._parser_internals.stateclass import StateClass from spacy.tokens.doc import Doc from spacy.vocab import Vocab @pytest.fixture def vocab(): return Vocab() @pytest.fixture def doc(vocab): return Doc(vocab, words=["a", "b", "c", "d"]) def test_init_state(doc): state = S...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/__init__.py
spacy/tests/parser/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_parse.py
spacy/tests/parser/test_parse.py
import pytest from numpy.testing import assert_equal from thinc.api import Adam from spacy import registry, util from spacy.attrs import DEP, NORM from spacy.lang.en import English from spacy.pipeline import DependencyParser from spacy.pipeline.dep_parser import DEFAULT_PARSER_MODEL from spacy.pipeline.tok2vec import ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_nonproj.py
spacy/tests/parser/test_nonproj.py
import pytest from spacy.pipeline._parser_internals import nonproj from spacy.pipeline._parser_internals.nonproj import ( ancestors, contains_cycle, is_nonproj_arc, is_nonproj_tree, ) from spacy.tokens import Doc @pytest.fixture def tree(): return [1, 2, 2, 4, 5, 2, 2] @pytest.fixture def cycli...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_space_attachment.py
spacy/tests/parser/test_space_attachment.py
import pytest from spacy.tokens import Doc from ..util import apply_transition_sequence def test_parser_space_attachment(en_vocab): # fmt: off words = ["This", "is", "a", "test", ".", "\n", "To", "ensure", " ", "spaces", "are", "attached", "well", "."] heads = [1, 1, 3, 1, 1, 4, 7, 11, 7, 11, 11, 11, 11...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/parser/test_neural_parser.py
spacy/tests/parser/test_neural_parser.py
import pytest from thinc.api import Model from spacy import registry from spacy.pipeline._parser_internals.arc_eager import ArcEager from spacy.pipeline.dep_parser import DEFAULT_PARSER_MODEL from spacy.pipeline.tok2vec import DEFAULT_TOK2VEC_MODEL from spacy.pipeline.transition_parser import Parser from spacy.tokens....
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_pipe_factories.py
spacy/tests/pipeline/test_pipe_factories.py
import pytest try: from pydantic.v1 import StrictInt, StrictStr except ImportError: from pydantic import StrictInt, StrictStr # type: ignore from thinc.api import ConfigValidationError, Linear, Model import spacy from spacy.lang.de import German from spacy.lang.en import English from spacy.language import L...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_edit_tree_lemmatizer.py
spacy/tests/pipeline/test_edit_tree_lemmatizer.py
import pickle import hypothesis.strategies as st import pytest from hypothesis import given from spacy import util from spacy.lang.en import English from spacy.language import Language from spacy.pipeline._edit_tree_internals.edit_trees import EditTrees from spacy.strings import StringStore from spacy.training import...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_initialize.py
spacy/tests/pipeline/test_initialize.py
import pytest try: from pydantic.v1 import StrictBool except ImportError: from pydantic import StrictBool # type: ignore from thinc.api import ConfigValidationError from spacy.lang.en import English from spacy.language import Language from spacy.training import Example def test_initialize_arguments(): ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_spancat.py
spacy/tests/pipeline/test_spancat.py
import numpy import pytest from numpy.testing import assert_almost_equal, assert_array_equal from thinc.api import NumpyOps, Ragged, get_current_ops from spacy import util from spacy.lang.en import English from spacy.language import Language from spacy.tokens import SpanGroup from spacy.tokens._dict_proxies import Spa...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_pipe_methods.py
spacy/tests/pipeline/test_pipe_methods.py
import gc import numpy import pytest from thinc.api import get_current_ops import spacy from spacy.lang.en import English from spacy.lang.en.syntax_iterators import noun_chunks from spacy.language import Language from spacy.pipeline import TrainablePipe from spacy.tokens import Doc from spacy.training import Example ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_functions.py
spacy/tests/pipeline/test_functions.py
import pytest from spacy.language import Language from spacy.pipeline.functions import merge_subtokens from spacy.tokens import Doc, Span from ..doc.test_underscore import clean_underscore # noqa: F401 @pytest.fixture def doc(en_vocab): # fmt: off words = ["This", "is", "a", "sentence", ".", "This", "is", ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_annotates_on_update.py
spacy/tests/pipeline/test_annotates_on_update.py
from typing import Callable, Iterable, Iterator import pytest from thinc.api import Config from spacy.lang.en import English from spacy.language import Language from spacy.training import Example from spacy.training.loop import train from spacy.util import load_model_from_config, registry @pytest.fixture def config...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_entity_ruler.py
spacy/tests/pipeline/test_entity_ruler.py
import pytest from thinc.api import NumpyOps, get_current_ops from spacy import registry from spacy.errors import MatchPatternError from spacy.lang.en import English from spacy.language import Language from spacy.pipeline import EntityRecognizer, EntityRuler, SpanRuler, merge_entities from spacy.pipeline.ner import DE...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_entity_linker.py
spacy/tests/pipeline/test_entity_linker.py
from typing import Any, Callable, Dict, Iterable, Tuple import pytest from numpy.testing import assert_equal from spacy import Language, registry, util from spacy.attrs import ENT_KB_ID from spacy.compat import pickle from spacy.kb import Candidate, InMemoryLookupKB, KnowledgeBase, get_candidates from spacy.lang.en i...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
true
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_lemmatizer.py
spacy/tests/pipeline/test_lemmatizer.py
import pickle import pytest from spacy import registry, util from spacy.lang.en import English from spacy.lookups import Lookups from ..util import make_tempdir @pytest.fixture def nlp(): @registry.misc("cope_lookups") def cope_lookups(): lookups = Lookups() lookups.add_table("lemma_lookup"...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_span_finder.py
spacy/tests/pipeline/test_span_finder.py
import pytest from thinc.api import Config from spacy import util from spacy.lang.en import English from spacy.language import Language from spacy.pipeline.span_finder import span_finder_default_config from spacy.tokens import Doc from spacy.training import Example from spacy.util import fix_random_seed, make_tempdir,...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_analysis.py
spacy/tests/pipeline/test_analysis.py
import pytest from mock import Mock from spacy.language import Language from spacy.pipe_analysis import get_attr_info, validate_attrs def test_component_decorator_assigns(): @Language.component("c1", assigns=["token.tag", "doc.tensor"]) def test_component1(doc): return doc @Language.component( ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_tagger.py
spacy/tests/pipeline/test_tagger.py
import pytest from numpy.testing import assert_almost_equal, assert_equal from thinc.api import compounding, get_current_ops from spacy import util from spacy.attrs import TAG from spacy.lang.en import English from spacy.language import Language from spacy.training import Example from ..util import make_tempdir @py...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_models.py
spacy/tests/pipeline/test_models.py
from typing import List import numpy import pytest from numpy.testing import assert_almost_equal from thinc.api import Model, data_validation, get_current_ops from thinc.types import Array2d, Ragged from spacy.lang.en import English from spacy.ml import FeatureExtractor, StaticVectors from spacy.ml._character_embed i...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_attributeruler.py
spacy/tests/pipeline/test_attributeruler.py
import numpy import pytest from spacy import registry, util from spacy.lang.en import English from spacy.pipeline import AttributeRuler from spacy.tokens import Doc from spacy.training import Example from ..util import make_tempdir @pytest.fixture def nlp(): return English() @pytest.fixture def pattern_dicts(...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_sentencizer.py
spacy/tests/pipeline/test_sentencizer.py
import pytest import spacy from spacy.lang.en import English from spacy.pipeline import Sentencizer from spacy.tokens import Doc def test_sentencizer(en_vocab): doc = Doc(en_vocab, words=["Hello", "!", "This", "is", "a", "test", "."]) sentencizer = Sentencizer(punct_chars=None) doc = sentencizer(doc) ...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/__init__.py
spacy/tests/pipeline/__init__.py
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_morphologizer.py
spacy/tests/pipeline/test_morphologizer.py
import pytest from numpy.testing import assert_almost_equal, assert_equal from thinc.api import get_current_ops from spacy import util from spacy.attrs import MORPH from spacy.lang.en import English from spacy.language import Language from spacy.morphology import Morphology from spacy.tests.util import make_tempdir fr...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_textcat.py
spacy/tests/pipeline/test_textcat.py
import random import numpy.random import pytest from numpy.testing import assert_almost_equal from thinc.api import Config, compounding, fix_random_seed, get_current_ops from wasabi import msg import spacy from spacy import util from spacy.cli.evaluate import print_prf_per_type, print_textcats_auc_per_cat from spacy....
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
true
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_span_ruler.py
spacy/tests/pipeline/test_span_ruler.py
import pytest from thinc.api import NumpyOps, get_current_ops import spacy from spacy import registry from spacy.errors import MatchPatternError from spacy.tests.util import make_tempdir from spacy.tokens import Span from spacy.training import Example @pytest.fixture @registry.misc("span_ruler_patterns") def pattern...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_tok2vec.py
spacy/tests/pipeline/test_tok2vec.py
import pytest from numpy.testing import assert_array_equal from thinc.api import Config, get_current_ops from spacy import util from spacy.lang.en import English from spacy.ml.models.tok2vec import ( MaxoutWindowEncoder, MultiHashEmbed, build_Tok2Vec_model, ) from spacy.pipeline.tok2vec import Tok2Vec, Tok...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/tests/pipeline/test_senter.py
spacy/tests/pipeline/test_senter.py
import pytest from numpy.testing import assert_equal from spacy import util from spacy.attrs import SENT_START from spacy.lang.en import English from spacy.language import Language from spacy.tests.util import make_tempdir from spacy.training import Example def test_label_types(): nlp = Language() senter = n...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/training/pretrain.py
spacy/training/pretrain.py
import re import time from collections import Counter from pathlib import Path from typing import Callable, Iterable, List, Optional, Union import srsly from thinc.api import ( Config, Model, Optimizer, fix_random_seed, set_dropout_rate, set_gpu_allocator, ) from thinc.config import ConfigValid...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/training/batchers.py
spacy/training/batchers.py
import itertools from functools import partial from typing import ( Any, Callable, Iterable, Iterator, List, Optional, Sequence, TypeVar, Union, ) from ..util import minibatch, registry Sizing = Union[Sequence[int], int] ItemT = TypeVar("ItemT") BatcherT = Callable[[Iterable[ItemT]...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/training/corpus.py
spacy/training/corpus.py
import random import warnings from pathlib import Path from typing import TYPE_CHECKING, Callable, Iterable, Iterator, List, Optional, Union import srsly from .. import util from ..errors import Errors, Warnings from ..tokens import Doc, DocBin from ..vocab import Vocab from .augment import dont_augment from .example...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/training/loggers.py
spacy/training/loggers.py
import sys from pathlib import Path from typing import IO, TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union import srsly import tqdm from wasabi import Printer from .. import util from ..errors import Errors from ..util import registry if TYPE_CHECKING: from ..language import Language # noqa: F4...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/training/callbacks.py
spacy/training/callbacks.py
from typing import TYPE_CHECKING, Callable, Optional from ..errors import Errors from ..util import load_model, logger, registry if TYPE_CHECKING: from ..language import Language def create_copy_from_base_model( tokenizer: Optional[str] = None, vocab: Optional[str] = None, ) -> Callable[["Language"], "L...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/training/__init__.py
spacy/training/__init__.py
from .alignment import Alignment # noqa: F401 from .augment import dont_augment, orth_variants_augmenter # noqa: F401 from .batchers import minibatch_by_padded_size, minibatch_by_words # noqa: F401 from .callbacks import create_copy_from_base_model # noqa: F401 from .corpus import Corpus, JsonlCorpus, PlainTextCorp...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false
explosion/spaCy
https://github.com/explosion/spaCy/blob/c1e7cb2ebf387a833d56e3b0bee23788d54b1448/spacy/training/initialize.py
spacy/training/initialize.py
import gzip import tarfile import warnings import zipfile from itertools import islice from pathlib import Path from typing import IO, TYPE_CHECKING, Any, Dict, Optional, Union import numpy import srsly import tqdm from thinc.api import Config, ConfigValidationError, fix_random_seed, set_gpu_allocator from ..errors i...
python
MIT
c1e7cb2ebf387a833d56e3b0bee23788d54b1448
2026-01-04T14:42:48.113774Z
false