webmaster-kazu.com

テクノロジー・データ分析・実践ログ・その他

言語識別のPythonライブラリ「langid」のインストール

カテゴリ: Python【初歩から現場実務的なもの】

言語識別のPythonライブラリ「langid」のインストールについて解説しています。

「langid」(URL:https://github.com/saffsd/langid.py)は、スタンドアロンの言語識別ツール。

■Python

今回のPythonのバージョンは、「3.8.5」を使用しています。(Windows10)(pythonランチャーでの確認)

■langidをインストールする

langidをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install langid

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、バージョンの切り替えを行います。

py -3.8 -m pip install langid

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable

Collecting langid

Downloading langid-1.1.6.tar.gz (1.9 MB)

|████████████████████████████████| 1.9 MB 2.2 MB/s

Preparing metadata (setup.py) ... done

Requirement already satisfied: numpy in c:\users\user_\appdata\roaming\python\python38\site-packages (from langid) (1.21.5)

Building wheels for collected packages: langid

Building wheel for langid (setup.py) ... done

Created wheel for langid: filename=langid-1.1.6-py3-none-any.whl size=1941187 sha256=8fb320fea6dc90d0d8fb0beabaadd832f444590474ff437fc5a8b2bc0b90237e

Stored in directory: c:\users\user_\appdata\local\pip\cache\wheels\c5\01\a4\0160c55074707b535a6757a541842817d530d8080ca943a107

Successfully built langid

Installing collected packages: langid

Successfully installed langid-1.1.6

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、langidが正常にインストールされたことになります。

今回は、langidのバージョン1.1.6をインストールしました。