Install KenLM Binaries on Ubuntu(Language Model Inference Tool)

Balvinder Singh
Tekraze
Published in
2 min readJan 17, 2020

Hi, before starting let me tell about what is KenLM. Basically it is a set of binaries providing language model inference tools. It helps in creating language model for deep speech training. We can create Language models by vocabulary.txt and trie file required in Deep Speech. Check Deep Speech below, for more info.

Installation Steps

Step 1. Clone the KenLm Repo from Github.

git clone https://github.com/kpu/kenlm

Step 2. Change to cloned Directory and create a build Directory.

cd kenlm
mkdir build
cd build

Step 3. Now run compilation with CMake in Build Directory.

cmake ..
make -j 4

Note: If you get compile error related to Eigen or Boost Libraries, then install following packages via command

sudo apt-get install libboost-all-dev libeigen3-dev
or if more dependencies missing, run
sudo apt-get install build-essential libboost-all-dev cmake zlib1g-dev libbz2-dev liblzma-dev

Step 4. Install In ubuntu with CMake.

make install

So, now you can use the KenLM binaries in Ubuntu for process text or compiling language model.

Bonus (Python Package)

If you want to install and use with Python, there is a pip package also

Run in terminal

pip install https://github.com/kpu/kenlm/archive/master.zip

Also checkout my other blog for more tech related posts.

https://tekraze.com

Feel free to clap, for showing your support.

--

--

Balvinder Singh
Tekraze

Open Source FullStack Developer | Blogger | Crypto Enthusiast | Gamer