Thanks to visit codestin.com
Credit goes to lib.rs

#nlp #language-detection #py3langid

langid-rs

A fast and lightweight language identification library in Rust, inspired by py3langid

4 stable releases

Uses new Rust 2024

1.1.0 Sep 19, 2025
1.0.2 Jul 18, 2025

#173 in Internationalization (i18n)

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

388 downloads per month

MIT license

1.5MB
283 lines

LangId

This is a rust conversion of the py3langid library.

This is only a deployment of the library. For training use the original library.

use langid_rs::Model;

fn main() {
    let model = Model::load(false).unwrap();
    //model.set_langs(Some(vec![...])).unwrap();

    let text = "This text is in English.";

    let classification = model.classify(text).unwrap();
    println!("{:?}", classification);
}

No runtime deps