All Projects → wooorm → Franc

wooorm / Franc

Licence: mit
Natural language detection

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Franc

Paddle2onnx
PaddlePaddle to ONNX model converter
Stars: ✭ 185 (-94.87%)
Mutual labels:  classification, detection
classy
Super simple text classifier using Naive Bayes. Plug-and-play, no dependencies
Stars: ✭ 12 (-99.67%)
Mutual labels:  classification, classify
Asl
Official Pytorch Implementation of: "Asymmetric Loss For Multi-Label Classification"(2020) paper
Stars: ✭ 195 (-94.59%)
Mutual labels:  classification, detection
Mstar deeplearning project
Radar target classification, detection and recognition using deeplearning methods on MSTAR dataset
Stars: ✭ 163 (-95.48%)
Mutual labels:  classification, detection
connection checker
Android library for checking the internet connectivity of a device.
Stars: ✭ 26 (-99.28%)
Mutual labels:  detect, detection
3d Pointcloud
Papers and Datasets about Point Cloud.
Stars: ✭ 179 (-95.03%)
Mutual labels:  classification, detection
detect-browser-language
Detect browser language
Stars: ✭ 35 (-99.03%)
Mutual labels:  detect, detection
Pytorch Imagenet Cifar Coco Voc Training
Training examples and results for ImageNet(ILSVRC2012)/CIFAR100/COCO2017/VOC2007+VOC2012 datasets.Image Classification/Object Detection.Include ResNet/EfficientNet/VovNet/DarkNet/RegNet/RetinaNet/FCOS/CenterNet/YOLOv3.
Stars: ✭ 130 (-96.39%)
Mutual labels:  classification, detection
mri-deep-learning-tools
Resurces for MRI images processing and deep learning in 3D
Stars: ✭ 56 (-98.45%)
Mutual labels:  detection, classification
volkscv
A Python toolbox for computer vision research and project
Stars: ✭ 58 (-98.39%)
Mutual labels:  detection, classification
Paddlex
PaddlePaddle End-to-End Development Toolkit(『飞桨』深度学习全流程开发工具)
Stars: ✭ 3,399 (-5.71%)
Mutual labels:  classification, detection
Cvpods
All-in-one Toolbox for Computer Vision Research.
Stars: ✭ 277 (-92.32%)
Mutual labels:  classification, detection
Luna16 Lung Nodule Analysis 2016 Challenge
LUNA16-Lung-Nodule-Analysis-2016-Challenge
Stars: ✭ 133 (-96.31%)
Mutual labels:  classification, detection
Hms Ml Demo
HMS ML Demo provides an example of integrating Huawei ML Kit service into applications. This example demonstrates how to integrate services provided by ML Kit, such as face detection, text recognition, image segmentation, asr, and tts.
Stars: ✭ 187 (-94.81%)
Mutual labels:  classification, language-detection
Simpsonrecognition
Detect and recognize The Simpsons characters using Keras and Faster R-CNN
Stars: ✭ 131 (-96.37%)
Mutual labels:  classification, detection
Bonnetal
Bonnet and then some! Deep Learning Framework for various Image Recognition Tasks. Photogrammetry and Robotics Lab, University of Bonn
Stars: ✭ 202 (-94.4%)
Mutual labels:  classification, detection
Tabi
BGP Hijack Detection
Stars: ✭ 90 (-97.5%)
Mutual labels:  classification, detection
Model Quantization
Collections of model quantization algorithms
Stars: ✭ 118 (-96.73%)
Mutual labels:  classification, detection
mmrazor
OpenMMLab Model Compression Toolbox and Benchmark.
Stars: ✭ 644 (-82.14%)
Mutual labels:  detection, classification
covid-mask-detector
Detect whether a person is wearing a mask or not
Stars: ✭ 102 (-97.17%)
Mutual labels:  detection, classification

franc

Build Status Coverage Status

Detect the language of text.

What’s so cool about franc?

  1. franc can support more languages(†) than any other library
  2. franc is packaged with support for 82, 187, or 403 languages
  3. franc has a CLI

† - Based on the UDHR, the most translated document in the world.

What’s not so cool about franc?

franc supports many languages, which means it’s easily confused on small samples. Make sure to pass it big documents to get reliable results.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install franc

This installs the franc package, with support for 187 languages (languages which have 1 million or more speakers). franc-min (82 languages, 8m or more speakers) and franc-all (all 403 possible languages) are also available. Finally, use franc-cli to install the CLI.

Browser builds for franc-min, franc, and franc-all are available on GitHub Releases.

Use

This package exports the following identifiers: franc, francAll. There is no default export.

import {franc, francAll} from 'franc'

franc('Alle menslike wesens word vry') // => 'afr'
franc('এটি একটি ভাষা একক IBM স্ক্রিপ্ট') // => 'ben'
franc('Alle menneske er fødde til fridom') // => 'nno'

franc('') // => 'und' (language code that stands for undetermined)

// You can change what’s too short (default: 10):
franc('the') // => 'und'
franc('the', {minLength: 3}) // => 'sco'
francAll
console.log(francAll('Considerando ser essencial que os direitos humanos'))

Yields:

[
  [ 'por', 1 ],
  [ 'glg', 0.771284519307895 ],
  [ 'spa', 0.6034146900423971 ],
  [ 'cat', 0.5367251059928957 ],
  [ 'src', 0.47461899851037015 ],
  ... 122 more items ]
only
console.log(
  francAll('Considerando ser essencial que os direitos humanos', {
    only: ['por', 'spa']
  })
)

Yields:

[ [ 'por', 1 ], [ 'spa', 0.6034146900423971 ] ]
ignore
console.log(
  francAll('Considerando ser essencial que os direitos humanos', {
    ignore: ['src', 'glg']
  })
)

Yields:

[ [ 'por', 1 ],
  [ 'spa', 0.6034146900423971 ],
  [ 'cat', 0.5367251059928957 ],
  [ 'ita', 0.4740460639394981 ],
  [ 'fra', 0.44757648676521145 ],
  ... 120 more items ]

CLI

Install:

npm install franc-cli --global

Use:

CLI to detect the language of text

Usage: franc [options] <string>

Options:

  -h, --help                    output usage information
  -v, --version                 output version number
  -m, --min-length <number>     minimum length to accept
  -o, --only <string>           allow languages
  -i, --ignore <string>         disallow languages
  -a, --all                     display all guesses

Usage:

# output language
$ franc "Alle menslike wesens word vry"
# afr

# output language from stdin (expects utf8)
$ echo "এটি একটি ভাষা একক IBM স্ক্রিপ্ট" | franc
# ben

# ignore certain languages
$ franc --ignore por,glg "O Brasil caiu 26 posições"
# src

# output language from stdin with only
$ echo "Alle mennesker er født frie og" | franc --only nob,dan
# nob

Supported languages

Package Languages Speakers
franc-min 82 8M or more
franc 187 1M or more
franc-all 403 -

Language code

Note that franc returns ISO 639-3 codes (three letter codes). Not ISO 639-1 or ISO 639-2. See also GH-10 and GH-30.

To get more info about the languages represented by ISO 639-3, use iso-639-3. There is also an index available to map ISO 639-3 to ISO 639-1 codes, iso-639-3/to-1.json, but note that not all 639-3 codes can be represented in 639-1.

Ports

Franc has been ported to several other programming languages.

The works franc is derived from have themselves also been ported to other languages.

Derivation

Franc is a derivative work from guess-language (Python, LGPL), guesslanguage (C++, LGPL), and Language::Guess (Perl, GPL). Their creators granted me the rights to distribute franc under the MIT license: respectively, Kent S. Johnson, Jacob R. Rideout, and Maciej Ceglowski.

License

MIT © Titus Wormer

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].