tinyld: 언어 탐지 라이브러리(js)

GitHub - komodojp/tinyld: Simple and Performant Language detection library for NodeJS
Simple and Performant Language detection library for NodeJS - komodojp/tinyld

일본 게임 유통사 코모도(Komodo)에서 만든 언어 탐지 오픈소스 라이브러리, tinyLD(Tiny Language Detector)

import { detect, detectAll } from 'tinyld'

// Detect
detect('これは日本語です.') // ja
detect('and this is english.') // en

// DetectAll
detectAll('ceci est un text en francais.')
// [ { lang: 'fr', accuracy: 0.5238 }, { lang: 'ro', accuracy: 0.3802 }, ... ]

사용법은 위와 같다

기존 언어 탐지 라이브러리와 비교했을 때, 스페인어-포르투갈어처럼 구분 힘든 언어도 tinyld는 잘 구분한다고 한다. 용량도 더 작고, 성능도 좋다고 한다.

Tinyld Playground

Playground에서 light, normal, heavy 모델별로 테스트 해볼 수 있다.