Skip to main content

For when you want fastText language identification, but you also want to believe the answers

Project description

lumi_language_id

Utilities for reliable-enough language detection.

This is a maintained fork of the original (archived) lumi-language-id, updated to work with numpy 2.x. It is published on PyPI as lumi-language-id-2, but the import name stays lumi_language_id:

pip install lumi-language-id-2   # or: uv add lumi-language-id-2

This package wraps fastText's "lid.176" language-detection model with another classifier, which is trained to produce better probability estimates. It also applies text cleaning, so that the text it detects is unaffected by punctuation, digits, or emoji.

Example:

>>> from lumi_language_id.tuned import TunedLanguageIdentifier
>>> lid = TunedLanguageIdentifier.load()
>>> lang, _prob = lid.detect_language("these are words")
>>> lang
'en'

>>> lang, _prob = lid.detect_language("aquí hay algunas palabras")
>>> lang
'es'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lumi_language_id_2-2.0.0.tar.gz (850.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lumi_language_id_2-2.0.0-py3-none-any.whl (788.8 kB view details)

Uploaded Python 3

File details

Details for the file lumi_language_id_2-2.0.0.tar.gz.

File metadata

  • Download URL: lumi_language_id_2-2.0.0.tar.gz
  • Upload date:
  • Size: 850.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for lumi_language_id_2-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8c12ef1d9d1f81e813fe3021de55d4c58870228dc20d3608159bb12675306efa
MD5 a22f60869a93f77568b6f9218eeb5894
BLAKE2b-256 1bec094a5b183efdf5c4c7997b890721ce820250a2a8e1d44e06c3c2c28f43fa

See more details on using hashes here.

File details

Details for the file lumi_language_id_2-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lumi_language_id_2-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 964e610aa49eff1316af95fee1652a5e0284d4e9f171850a22139fe73da3b8c9
MD5 6f09137785c6988b1197850dc673c8cf
BLAKE2b-256 a18c50ad428d5a097878d03a527bf00c774181c6931c4a3fc404c048497123c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page