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)
| File | Size | Uploaded | |
|---|---|---|---|
| textlangid-0.0.7.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| textlangid-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
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
|