--- id: spacy-language-detection version: "0.2.1" license: LGPLv3 license_treatment: copyleft maintenance: abandoned --- # spacy-language-detection — Fully customizable language detection for spaCy pipeline License: copyleft · Maintenance: abandoned · Downloads: 992.9K/mo ## What it is and what it does spacy_language_detection is a spaCy pipeline component that detects the language of text at both document and sentence level. It wraps langdetect under the hood and exposes language predictions as custom attributes (doc._.language and span._.language) on spaCy Doc and Span objects. The package was forked from spacy-langdetect to fix a seed problem and add spaCy 3.0 support. The component is fully customizable: you can replace the default langdetect detector with your own language detection function (e.g., googletrans or pycld2) by passing a callable to the LanguageDetector constructor. This makes it useful for pipelines where you need language identification as a preprocessing or filtering step, or where you want to swap detection backends without rewriting integration code. Use it for: - Filter or route multilingual documents to language-specific NLP pipelines based on detected language. - Identify language switches within a document to handle code-switching or mixed-language text. - Preprocess text corpora to separate documents by language before applying language-specific models. - Add language metadata to spaCy Doc objects for downstream analysis or logging. - Integrate a custom language detector (e.g., from an external API) into a spaCy workflow. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds language detection to spaCy pipelines at document and sentence level, using langdetect by default but accepting custom detection functions. No. The package is abandoned (last update 2021-09-08, 1801 days ago) with no maintenance signal. While it has low install friction and no known vulnerabilities, the lack of updates means it may break with newer spaCy versions or Python releases. If you need language detection in spaCy, consider maintaining a fork or using a more actively maintained alternative. ## Install pip install spacy-language-detection uv add spacy-language-detection poetry add spacy-language-detection ## Installing spacy-language-detection Before you install: Low install friction with just two runtime dependencies (spacy and langdetect). However, the package is abandoned—last commit was 2021-09-08 and no updates since. Use only if you need this specific functionality and are comfortable maintaining a fork yourself. License in practice: Licensed under LGPLv3 (copyleft). You must disclose source code and license any derivative work under the same terms if you distribute it; internal use has no obligation. Quickstart: import spacy from spacy.language import Language from spacy_language_detection import LanguageDetector def get_lang_detector(nlp, name): return LanguageDetector(seed=42) nlp = spacy.load("en_core_web_sm") Language.factory("language_detector", func=get_lang_detector) nlp.add_pipe('language_detector', last=True) doc = nlp("This is English text.") print(doc._.language) Requires a spaCy model to be installed separately (e.g., spacy download en_core_web_sm). Verify before relying: - Accuracy and performance of langdetect on modern language distributions and edge cases. - Compatibility with spaCy versions released after 2021-09-08. - Whether the seed-fixing fork resolves the original spacy-langdetect randomness issue completely. ## Package facts - License: LGPLv3 (copyleft) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 992.9K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags spacy language detection, detect document language, multilingual text processing, sentence language identification, spacy nlp pipeline extension, language classifier for spacy, identify text language, nlp-pipeline, language-detection, abandoned [View on SkillFed](https://skillfed.io/packages/spacy-language-detection) · [View on PyPI](https://pypi.org/project/spacy-language-detection/)