Set up kenlm for Windows - language-model

The official website makes it pretty clear that there is no support for kenlm in Windows. There is a Windows tag at the github repository but it seems to be maintained by few random contributors then and there.
How to set up kenlm for Windows then?

The new DeepSpeech PlayBook also includes instructions for setting up a Docker image and running training from within a Docker container. If you have Docker on Windows, this might be another solution.
The information for building a new Scorer is still in a PR, but may also be useful.

The solution is to use Ubuntu in Windows through Windows Subsystem for Linux
Get WSL for Windows
From your ubuntu bash navigate to the folder where you want to do the setup. You can access the Windows file system from the /mnt/c/ folder, which you can find at the root directory.
From there simply follow the official instructions, that is clone the git repo, and run cmake .. & make -j2 in order to build the project (after first making the necessary installations in your Ubuntu system).
Obviously, you must train the models or scorers using the Linux bash. You can also use these models from Windows using the kenlm python library.
E.g.
The two steps to build a scorer for the deepspeech-model as described here should be executed from your Ubuntu system. But after you have the scorer you should be able to run the command
deepspeech --model deepspeech-0.9.3-models.pbmm --scorer kenlm.scorer --audio audio.wav
from Windows. However, once you have WSL there's no need to do this work from Windows. Things will work nicely #your Ubuntu system.

I've faced the same problem and solved it by building kenlm wheel from Cygwin terminal as home page advices (pip wheel pypi-kenlm).
I've also uploaded wheel to pypi called kenlm-cygwin, but it's only python3.7.

Related

Where does sdkman install packages?

I used sdkman to install groovy which went fine. Where is the installed package now? I need the path for it. I am on Ubuntu 14.04.
I've checked it on my system. It should be located in $HOME/.sdkman/candidates/.
I think the best way would be to use SDKMan's home command:
https://sdkman.io/usage#home
Something like this (taken from the above page):
$ sdk home java 11.0.7.hs-adpt
/home/somedude/.sdkman/candidates/java/11.0.7.hs-adpt
Upon installation, SDKMAN creates an environment variable $SDKMAN_DIR which points to the installation directory.
Usuall it's ~/.sdkman
After you have run source $HOME/.sdkman/bin/sdkman-init.sh.
You can see the sdkman "installation" by running:
declare -f
$HOME on mac is /Users/<users>
Where's SDKMan installed:
echo #SDKMAN_DIR
Where did it just install gradle? (or some other package)
which gradle
SDKMAN stores file in $HOME/.sdkman/candidates/ as Tom mentioned and this answer goes into more detail.
To find where SBT 1.3.13 is installed, type sdk home sbt 1.3.13. It'll return something like /Users/powers/.sdkman/candidates/sbt/1.3.13.
The arguments to the sdk install command align with where the files are stored in $HOME/.sdkman/candidates.
sdk install java 8.0.272.hs-adpt stores files in $HOME/.sdkman/candidates/java/8.0.272.hs-adpt.
sdk install sbt 1.3.13 stores files in $HOME/.sdkman/candidates/sbt/1.3.13.
When you run sdk install, the downloaded binaries get saved in $HOME/.sdkman/archives. For example, $HOME/.sdkman/archives/java-8.0.272.hs-adpt.zip and $HOME/.sdkman/archives/sbt-1.3.13.zip.
Some of the binaries are pretty big and can end up taking a lot of space on your computer. You should periodically delete them with the sdk flush archives command. Once you install the software, you don't need the binaries anymore. See here for more details.

MAVProxy installed by Python can't find required modules

I installed droneapi in the same manner given in the tutorial. However, it's missing all of the important modules that come with MAVProxy, such as console, wx, etc.
Was it supposed to install these modules, or should I move them over from MAVProxy itself instead?
Note: Windows 8 64-bit platform
I apologize that you had to investigate the issue without guidance. Publishing our Windows installer was not well prioritized, and it looks like that choice cost you several hours.
Here is what we will soon to address DroneKit Python installation on Windows:
A dedicated Windows installer generator lives at windows/droneapiWinBuild.bat. This generates a program Output\DroneKitsetup-1.x.x.exe which can be used to install all dependencies.
Yesterday we began testing the installer on Windows on every commit. https://github.com/dronekit/dronekit-python/pull/236
We will now publish the binaries generated by that test and document them in the Windows installation process. https://github.com/dronekit/dronekit-python/issues/164
Thanks for publishing your solution publicly. Hopefully we can address issues like these before they come up in the future.
Tim, DroneKit Engineer
So in a rare spark of intuition I discovered the answer. The modules required by Dronekit Python can be installed in the following ways:
Console- type "pip install console" into the WinPython cmd prompt
WX- http://wiki.wxpython.org/How%20to%20install%20wxPython
OpenCV- Download and install OpenCV version 2.4, then copy/paste the file cv2.pyd from OpenCV\build\python\2.7\x64\ to \python-2.7.6.amd64\Lib\site-packages.
At this point it should load all required modules, although it will throw a few exceptions which aren't important.
As always, 3DR documentation is incomplete. One would think that $800 million dollar profits would mean that they could hire more than 5 programmers for their new platform...

Unix text based browser with javascript support

I need to perform smoke-test of my AngularJS application on Unix, from terminal.
I tried accessing application from
links2
links
w3m
elinks
lynx
All above-mentioned browsers show empty screen. In most of them I am able to view source using \ (backslash), so I could do basic verification if application server works properly at least.
Is there any unix text browser with javascript support? I am not looking for complete support (so application would be usable).
It would be great to have ability just to view some elements of the page
Try to install libmozjs (on debian/ubuntu aptitude install libmozjs185-dev), then (don't forget to do a sudo ldconfig first) compile from the source elinks.
wget http://elinks.or.cz/download/elinks-current-0.13.tar.bz2
tar xjvf elinks-current-0.13.tar.bz2
cd elinks-0.13*
./configure
make -j8
sudo make install
Check after ./configure if ECMAScript is flagged SpiderMonkey document scripting.
p.s. Ubuntu 14.04 here.
I guess the best way to do it would be with a headless browser such as PhantomJS http://phantomjs.org/. It has a programmable interface, so you can run a simple JS script to open your webpage, and do a simple check.
Or, you can write a more complete test using Protractor https://github.com/angular/protractor. It will give you a nice API to write tests targeting Selenium Webdriver http://www.seleniumhq.org/projects/webdriver/, that can target many browsers, including PhantomJS.
If you do a lot of AngularJS development you should take a look a Protractor anyway.

In OpenBSD how to upgrade individual system files like (grep, rcs, rlog ) to latest version?

I am attempting to run foswiki on OpenBSD. Things are installed and i am able to open "/bin/Configure" page of foswiki configuration screen. but the page reports few errors, complaining that following files are either not found or outdated and new versions are required.
The Files are : grep, rcs, ci, co,rlog, rcsdiff
I tried commands like "pkg_add -Uu" to upgrade packages installed, but it reports all packages are uptodate.
I also tried "pkg_add rcs" "pkg_add grep" etc but non works.
So my basic question is how to I update above files to their latest version required by foswiki.
Regards
While I’m not familiar with Foswiki, my first thought is your web server is chrooted, as this is the default on OpenBSD, and, as a result, Foswiki cannot find the files it needs. You can copy the files Foswiki needs into the chroot or run the web server without chroot, which is bad from a security perspective.
all programs mentioned are part of a base openbsd install and the above answer is correct. the openbsd documentation on chrooted apache has more info.
if you don't have to stick with foswiki you can try dokuwiki instead which has package support on openbsd and installs easily in very much the same way you tried already:
sudo pkg_add -U dokuwiki
hope the process is pretty much self-descriptive. in addition, the manpage for pkg_add is a good thing to read. good luck!

Golang GAE SDK on XP: Do I have to install it? Are there other ways to use the SDK on XP?

The introduction says:
Follow the instructions on the download page to install the SDK on
your computer.
But the download page has no any instructions about how to install and what to do next. Only links.
All I found is this link to WindowsInstallation:
Download and run the latest Windows installer from our downloads page
Must Windows XP users use the installer? Can they just download the Linux version and unzip it? I'd like to have a portable version rather than one that installs EXEs and registry settings, etc.
Also I do not understand what exactly do I have to choose. There are:
Google App Engine SDK 1.7.7 (.msi file)
Google App Engine SDK for Go 1.7.7 (.zip file)
I've downloaded the second. Do I need to download and install the first too? Just adding the second to the PATH and develop is exactly what I want. Is this enough?
The Linux version will have executables compiled for Linux, so you can't run those on Windows (unless you run linux under a virtual machine with VirtualBox, VMWare or similar).
No, you do not need to install something to run Go GAE on XP.
I just downloaded go_appengine_sdk_windows_386-1.7.7.zip from
here.
Unzipped it in C:\go_appengine-1.7.7
Added the folder in my PATH. The main goal is to have these files
dev_appserver.py and appcfg.py in the PATH. It is written
here. Not a must, though, only for convenience.
Installed Python 2.7.4. Only works with 2.7.4. At first I installed
the latest 3.3.1 but had to change it to 2.7.4 because Go GAE cannot
run, throws an error.
And that's all. Just created a sample script, ran C:\>dev_appserver.py myapp and opened my sample app in localhost:8080.
PROFIT.
But:
Do not know, though, what benefits the installer offer. I didn't test it.
That was just a sample script. Maybe some serious development requires installation.

Resources