Skip to main content

Text language identifier

This package serves as a wrapper for the most performant text language identifier.

Currently it wraps fasttext (NLLB version).

Before detecting the language, it preprocesses the text to improve results.

Usage

%pip install textlangid

import textlangid

lang = textlangid.detect("This is some text.")

top_languages = TextLanguageIdentifier.detect(text, top_k=3)

top_languages_with_confidence = TextLanguageIdentifier.detect(
        text, top_k=3, return_confidence=True
    )

top_languages_with_threshold = TextLanguageIdentifier.detect(
        text, top_k=3, return_confidence=True, confidence_threshold=0.2
    )

The language is returned in a FLORES-200 language code. Full list available here.

Metadata

Release files for textlangid 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for textlangid 0.0.7
File Size Uploaded Provenance Actions
textlangid-0.0.7.tar.gz 2.9 kB Without provenance Details for textlangid-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for textlangid 0.0.7
File Interpreter ABI Platform Actions
textlangid-0.0.7-py3-none-any.whl Python 3 none any Details for textlangid-0.0.7-py3-none-any.whl

Total release size: 6.0 kB

Release files / textlangid-0.0.7.tar.gz

Download URL textlangid-0.0.7.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8ae0a84532bb5b1027fa4d2ca263d6e0cbcd00a94d39338a3d1a90672ac554cd
BLAKE2b-256 checksum
How to use checksums
1d5abe0c24cc44f1218b5e41fce45c00c5b23c92d0942246516144e90c91a6e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / textlangid-0.0.7-py3-none-any.whl

Download URL textlangid-0.0.7-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ff35369cdbe95bbc7d8e46ad7df00de75a1bff6e2f363041701e9b96ef38dea
BLAKE2b-256 checksum
How to use checksums
264ca39fc77d359481297d04d565dd4b8952a7bdee23d3c429538ffcf965bd28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Security for textlangid 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page