kensho-technologies / pyctcdecode

A fast and lightweight python-based CTC beam search decoder for speech recognition.
Apache License 2.0
416 stars 89 forks source link

How do I install kenlm on windows? #49

Closed burgil closed 2 years ago

burgil commented 2 years ago

Hey I installed pyctcdecode using pip install pyctcdecode and it worked and now I'm reading the quickstart and the first line is failing at import kenlm with the error: ModuleNotFoundError: No module named 'kenlm' and when I run from pyctcdecode import build_ctcdecoder I get a hint: kenlm python bindings are not installed. Most likely you want to install it using: pip install https://github.com/kpu/kenlm/archive/master.zip

but when I try to execute pip install https://github.com/kpu/kenlm/archive/master.zip it fails

any help on that matter will be super useful, thanks

shchadilova commented 2 years ago

Hi, it looks like you won't be able to install kenlm on windows directly, but you can try using docker. I have seen a couple of suggestions here: https://stackoverflow.com/questions/66400723/set-up-kenlm-for-windows

burgil commented 2 years ago

Thank you ! That helped a lot and gave me some methods to try

I'm reading kenlm docs and it says you can install it on windows, trying now using v100 toolset https://kheafield.com/code/kenlm/ Supported PlatformsBest on Linux. Also supports Mac OS X, Cygwin, and Windows. Tested on x86, x86_64, ppc64, and ARM. The ARM port was contributed by NICT.Windows Users

I do not actively maintain the Visual Studio build files or test on Windows. A version that works on Windows is tagged on github https://github.com/kpu/kenlm/archive/windows.zip. See the windows directory for Visual Studio project files based on a contribution by Cong Duy Vu Hoang. Compile the kenlm project before the build_binary and ngram_query projects, preferably in x64 release mode.

Cygwin works too. However, please note that Cygwin is 32-bit even on 64-bit Windows, so you should not expect Cygwin to work with model sizes over 2 GB.

On Mon, Jan 24, 2022 at 3:49 PM Yulia Shchadilova @.***> wrote:

Hi, it looks like you won't be able to install kenlm on windows directly, but you can try using docker. I have seen a couple of suggestions here: https://stackoverflow.com/questions/66400723/set-up-kenlm-for-windows

— Reply to this email directly, view it on GitHub https://github.com/kensho-technologies/pyctcdecode/issues/49#issuecomment-1020120212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ5MJFOPW2HKEDMC5GDH4MDUXVKGXANCNFSM5MVKXTVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

burgil commented 2 years ago

I can report that downgrading my virtual environment to python 3.7 and installing kenlm with the following command worked: pip install kenlm-cygwin following by pip install pyctcdecode

burgil commented 2 years ago

how can I compile an exe file for production with docker? does pyctcdecode doesn't support windows?