Skip to main content

Library for reading ARPA n-gram models.

Project description

Python ARPA Package

PyPI Version Documentation Status Travis Coverage Status

Python library for reading ARPA n-gram models.
It was initiated by Stefan Fischer and is developed and maintained by many others.

Setup

PyPI Python Versions

The package is available on PyPI:

$ pip install arpa

Usage

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-2018 Stefan Fischer
The source code is available under the MIT License.
See LICENSE for further details.

History

All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
You should Keep a CHANGELOG, too!

Next Release

Added

Changed

Deprecated

Fixed

Removed

Security

0.1.0b3 - 2018-12-06

0.1.0b2 - 2018-04-28

0.1.0b1 - 2015-09-13

0.1.0a6 - 2015-07-24

0.1.0a5 - 2015-07-19

0.1.0a4 - 2015-07-14

0.1.0a3 - 2015-07-10

0.1.0a2 - 2015-07-05

0.1.0a1 - 2015-07-05

First release on PyPI.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page