All Projects → FGRibreau → Node Language Detect

FGRibreau / Node Language Detect

Licence: mit
🇫🇷 NodeJS language detection library using n-gram

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Language Detect

pycld3
Python3 bindings for the Compact Language Detector v3 (CLD3)
Stars: ✭ 122 (-60.52%)
Mutual labels:  language-detection
tongue
Elixir port of Nakatani Shuyo's natural language detector
Stars: ✭ 17 (-94.5%)
Mutual labels:  language-detection
Command-line-translator
Command-line access to google translate and some other features
Stars: ✭ 26 (-91.59%)
Mutual labels:  language-detection
php-google-translate-for-free
Library for free use Google Translator. With attempts connecting on failure and array support.
Stars: ✭ 124 (-59.87%)
Mutual labels:  language-detection
jstarcraft-nlp
专注于解决自然语言处理领域的几个核心问题:词法分析,句法分析,语义分析,语种检测,信息抽取,文本聚类和文本分类. 为相关领域的研发人员提供完整的通用设计与参考实现. 涵盖了多种自然语言处理算法,适配了多个自然语言处理框架. 兼容Lucene/Solr/ElasticSearch插件.
Stars: ✭ 92 (-70.23%)
Mutual labels:  language-detection
nlpserver
NLP Web Service
Stars: ✭ 76 (-75.4%)
Mutual labels:  language-detection
Malaya
Natural Language Toolkit for bahasa Malaysia, https://malaya.readthedocs.io/
Stars: ✭ 239 (-22.65%)
Mutual labels:  language-detection
laravel-nlp
Laravel wrapper for common NLP tasks
Stars: ✭ 41 (-86.73%)
Mutual labels:  language-detection
lingua-go
👄 The most accurate natural language detection library for Go, suitable for long and short text alike
Stars: ✭ 684 (+121.36%)
Mutual labels:  language-detection
language-identification-template
Detect the languages from short pieces of text
Stars: ✭ 20 (-93.53%)
Mutual labels:  language-detection
detectlanguage-python
Detect Language API Python Client
Stars: ✭ 49 (-84.14%)
Mutual labels:  language-detection
SwiftUIMLKitTranslator
SwiftUI MLKit Language Identification & Translator
Stars: ✭ 23 (-92.56%)
Mutual labels:  language-detection
UniLang
Translate text from one language to another using Google Translate
Stars: ✭ 33 (-89.32%)
Mutual labels:  language-detection
spacy-langdetect
A fully customisable language detection pipeline for spaCy
Stars: ✭ 86 (-72.17%)
Mutual labels:  language-detection
get-user-locale
A function that returns user's locale as an IETF language tag, based on all available sources.
Stars: ✭ 44 (-85.76%)
Mutual labels:  language-detection
cnn-ld-tf
Convolutional Neural Network for Language Detection in Tensorflow
Stars: ✭ 12 (-96.12%)
Mutual labels:  language-detection
spacy-fastlang
Language detection using Spacy and Fasttext
Stars: ✭ 34 (-89%)
Mutual labels:  language-detection
Lingua Rs
👄 The most accurate natural language detection library in the Rust ecosystem, suitable for long and short text alike
Stars: ✭ 260 (-15.86%)
Mutual labels:  language-detection
cld2-cffi
Python bindings to the Compact Language Detector
Stars: ✭ 32 (-89.64%)
Mutual labels:  language-detection
pastey
A lightweight, self-hosted paste platform
Stars: ✭ 65 (-78.96%)
Mutual labels:  language-detection

Node Language Detect

Travis (.org) David npm npm node npm bundle size Get help on Codementor Twitter Follow Slack

npm

LanguageDetect is a port of the PEAR::Text_LanguageDetect for node.js.

LanguageDetect can identify 52 human languages from text samples and return confidence scores for each.

Installation

This package can be installed via npm as follows

npm install languagedetect --save

Example

const LanguageDetect = require('languagedetect');
const lngDetector = new LanguageDetect();

// OR
// const lngDetector = new (require('languagedetect'));

console.log(lngDetector.detect('This is a test.'));

/*
  [ [ 'english', 0.5969230769230769 ],
  [ 'hungarian', 0.407948717948718 ],
  [ 'latin', 0.39205128205128204 ],
  [ 'french', 0.367948717948718 ],
  [ 'portuguese', 0.3669230769230769 ],
  [ 'estonian', 0.3507692307692307 ],
  [ 'latvian', 0.2615384615384615 ],
  [ 'spanish', 0.2597435897435898 ],
  [ 'slovak', 0.25051282051282053 ],
  [ 'dutch', 0.2482051282051282 ],
  [ 'lithuanian', 0.2466666666666667 ],
  ... ]
*/

// Only get the first 2 results
console.log(lngDetector.detect('This is a test.', 2));

/*
  [ [ 'english', 0.5969230769230769 ], [ 'hungarian', 0.407948717948718 ] ]
*/

API

  • detect(sample, limit) Detects the closeness of a sample of text to the known languages
  • getLanguages() Returns the list of detectable languages
  • getLanguageCount() Returns the number of languages that the lib can detect
  • setLanguageType(format) Sets the language format to be used. Suported values:
    • iso2, resulting in two letter language format
    • iso3, resulting in three letter language format
    • Any other value results in the full language name

Benchmark

  • node.js 1000 items processed in 1.277 secs (482 with a score > 0.2)
  • PHP 1000 items processed in 4.835 secs (535 with a score > 0.2)

Credits

Nicholas Pisarro for his work on PEAR::Text_LanguageDetect

License

Copyright (c) 2013, Francois-Guillaume Ribreau [email protected], Ruslan Zavackiy [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].