LoginSignup
2
5

More than 5 years have passed since last update.

LangIDとは Language Identification(言語特定) を行うライブラリ。
文字列を入力として与えると、その文字列がどの言語のものかを示してくれる。

シンプルな使い方は以下の通り。

# -*- coding: utf-8 -*-
import langid

result = langid.classify('これは日本語です')
print(result)  #=> ('ja', -197.7628321647644)

このライブラリのアルゴリズムは公知の研究から作られていて、こちらから参考文献が得られる。

気になる点としては、速度に難がある。
上記のシンプルなテストで3秒近く要するため、リアルタイム性が重要なWebの世界ではあまり使えない印象。

2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5