Skip to content

feat: add py3langid to the benchmark - #19

Merged
malteos merged 2 commits into
commoncrawl:mainfrom
adbar:feat/py3langid_submission
Sep 23, 2026
Merged

malteos merged 2 commits into
commoncrawl:mainfrom
adbar:feat/py3langid_submission

Conversation

@adbar

@adbar adbar commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Add py3langid

Wrapper for py3langid 0.4.0
(pure Python + numpy, byte n-gram naive Bayes with a word table, 139 labels).

  • requires_preprocessing = False: the model normalizes and tokenizes raw text itself.
  • Returns LIDPrediction(label, posterior); the score is the normalized
    probability of the top label. Predictions below 0.25 abstain but keep
    their score.
  • zxx (not a language) and und abstain.
  • Output map for codes the generic 639-1 → 639-3 conformation would not
    reach: ar→arb, sw→swh, az→azj, or→ory (the registers the model is trained
    on, as in FLORES/OpenLID) and bcl→bik (macrolanguage).

Training-data disclosure

  • The training corpus was decontaminated against CommonLID by exact line
    match; residual overlap is zero.
  • No UDHR text is in the corpus. google/smol was never used for training.
  • commonlid and flores_dev were used for evaluation purposes only.
  • Training sources: CC-100, Wikipedia, Tatoeba, Leipzig corpora, plus
    Glot500, GlotCC and GlotSparse for thin classes.

See also https://huggingface.co/datasets/commoncrawl/commonlid-results/discussions/6

@malteos malteos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adbar

thanks for your contribution. Just a few minor comments that should be quickly to fix. Please also resolve the merge conflict so we can run the CI.

Best,
Malte

Comment thread src/commonlid/models/py3langid.py Outdated
Comment thread src/commonlid/models/py3langid.py Outdated
@adbar

adbar commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

@malteos Thanks for the review, the PR should now be OK.

@malteos
malteos merged commit 52726a6 into commoncrawl:main Sep 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants