#39 · Primary category: NLP Tools & Text Processing

franc

classification classify detect detection javascript language language-detection natural natural-language nlp

Natural language detection

Project last updated:06/12/24

GitHub Stars

4.4K

Forks

182

Contributors

11

License

MIT

Why we included this project

franc answers a simple question that turns out to be harder than it looks: given a block of text, what language is it? It is a small JavaScript library with no dependencies that scores trigram frequencies against precomputed profiles, and it comes in three builds covering 82, 187, or 414 languages, so you can pick the size that fits your bundle budget. For teams routing user-generated content into translation, search, or moderation pipelines, it is a handy first pass before heavier models get involved. The API is small: one function returns the best guess, a companion call gives a ranked list of candidates with confidence scores, and options let you whitelist or ignore specific languages. It runs in Node, Deno, and browsers, ships with a CLI for quick shell checks, and is fully typed. The honest caveat is that it struggles on very short snippets, so treat it as a fast first-pass detector rather than a replacement for learned classifiers.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category