Library for reading ARPA n-gram models.
Python ARPA Package
This is a library for reading ARPA n-gram models.
Python 3.3+ and Wheels are supported.
It was initiated by Stefan Fischer and is developed and maintained by many others.
- Questions can be asked via e-mail.
- Source code is tracked on GitHub.
- Changes between releases are documented.
- Bugs can be reported on the issue tracker.
The package is available on PyPI:
$ pip install arpa
The package may be imported directly:
import arpa models = arpa.loadf("foo.arpa") lm = models # ARPA files may contain several models. # probability p(end|in, the) lm.p("in the end") lm.log_p("in the end") # sentence score w/ sentence markers lm.s("This is the end .") lm.log_s("This is the end .") # sentence score w/o sentence markers lm.s("This is the end .", sos=False, eos=False) lm.log_s("This is the end .", sos=False, eos=False)
Write a bug report or send a pull request.
Other contributors have done so before.
Copyright (c) 2015-2018 Stefan Fischer
The source code is available under the MIT License.
See LICENSE for further details.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash SHA256 hash help||File type||Python version||Upload date|
|arpa-0.1.0b2-py3-none-any.whl (10.3 kB) Copy SHA256 hash SHA256||Wheel||py3||Apr 28, 2018|
|arpa-0.1.0b2.tar.gz (13.5 kB) Copy SHA256 hash SHA256||Source||None||Apr 28, 2018|