$ show explosion/spacy-models
This repository is the official distribution and testing hub for spaCy's pre-trained NLP models. It does not contain the actual model binaries (which are released as Python wheels via GitHub Releases), but instead houses metadata JSON files for hundreds of model versions across 20+ languages, a comprehensive pytest-based test suite for validating model performance, and shortcut mappings for quick model loading. The metadata files follow a consistent schema that records pipeline components, label inventories, training data sources, accuracy benchmarks, and version compatibility constraints, making them machine-readable for automated model discovery and comparison. The test infrastructure is designed to be reusable for any spaCy model, including custom ones. It uses command-line flags (--model, --lang, --has-parser, etc.) to parameterize tests and conditionally skip components that are not present. The test suite includes corpus-level evaluation against performance thresholds defined in a CSV file, as well as language-specific tests for tagger, parser, NER, and morphologizer components. This allows users to validate that models meet minimum accuracy bars before deployment. While the repository is actively maintained (with model versions up to 3.8.0 and recent commits), it is primarily a release artifact store rather than a training pipeline. Reproducing the models themselves requires access to the original training code and data, which are not included here. However, the metadata and test suite provide a solid foundation for evaluating and comparing spaCy models, and the test patterns can be adapted for other NLP pipelines.
The LLM identified 4 files worth highlighting for reuse:
Provides pytest fixtures and command-line options for testing any spaCy model. Defines flags like --model, --lang, --has-parser, --has-tagger, --has-ner, etc., and dynamically generates test cases from a performance thresholds CSV. The pattern of using markers and conditional skips based on model capabilities is clean and reusable for other NLP model validation suites.
Contains helper functions json_path_to_examples() and evaluate_corpus() that convert CoNLL-U-derived JSON test files into spaCy Example objects and compute accuracy scores. These functions are self-contained and can be extracted to evaluate any spaCy model against standard treebank data, making them a reusable asset for NLP evaluation pipelines.
Defines minimum expected accuracy thresholds (e.g., dep_uas, dep_las, ents_f, tag_acc) for each language and model size. This CSV is consumed by the test suite to ensure models meet quality bars. The pattern of maintaining a simple CSV-based threshold file is reusable for any project that needs to enforce performance regression checks across multiple model variants.
Exemplifies the consistent metadata schema used across all spaCy model releases. Contains fields for pipeline components, label sets, training sources, accuracy metrics, speed benchmarks, checksums, and version constraints. This schema is a reusable pattern for packaging and documenting any NLP model, enabling automated discovery, comparison, and validation.