Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

This is a library for reading ARPA n-gram models.

Project Description

This is a library for reading ARPA n-gram models.
Python 3.2+ and Wheels are supported.
It was initiated by Stefan Fischer and is developed and maintained by many others.

Install

The package is available on PyPI:

$ pip install arpa

Use

The package may be imported directly:

import arpa
models = arpa.loadf("foo.arpa")
lm = models[0]  # 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)

Contribute

Write a bug report or send a pull request.
Other contributors have done so before.

License

Copyright (c) 2015 Stefan Fischer
The source code is available under the MIT License.
See LICENSE for further details.
Release History

Release History

This version
History Node

0.1.0b1

History Node

0.1.0a6

History Node

0.1.0a5

History Node

0.1.0a4

History Node

0.1.0a3

History Node

0.1.0a2

History Node

0.1.0a1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
arpa-0.1.0b1-py3-none-any.whl (10.3 kB) Copy SHA256 Checksum SHA256 py3 Wheel Sep 13, 2015
arpa-0.1.0b1.tar.gz (7.3 kB) Copy SHA256 Checksum SHA256 Source Sep 13, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting