Skip to main content

Finite-state grammar compilation library

Reason this release was yanked:

post release

Project description

Pynini is a Python extension module which allows the user to compile, optimize, and apply grammar rules. Rules can be compiled into weighted finite state transducers, pushdown transducers, or multi-pushdown transducers. For general information and a detailed tutorial, see pynini.opengrm.org.

Pynini is primarily developed by Kyle Gorman with the help of contributors. If you use Pynini in your research, we would appreciate if you cite the following paper:

K. Gorman. 2016. Pynini: A Python library for weighted finite-state grammar compilation. In Proc. ACL Workshop on Statistical NLP and Weighted Automata, 75-80.

(Note that some of the code samples in the paper are now out of date and not expected to work.)

Dependencies

Pynini depends on:

  • A standards-compliant C++ 11 compiler (GCC >= 4.8 or Clang >= 700)
  • The most recent version of OpenFst (at the time of writing, 1.7.4) built with the far, pdt, mpdt, and script extensions (i.e., built with ./configure --enable-grm) and headers
  • Python 2.7 or 3.6+ and headers

It is tested with: Debian Linux 4.19.37 on x86_64, GCC 7.3.0, Cython 0.29.13 and Python 3.7.2.

Installation instructions

Execute python setup.py install. Depending on your environment, you may need to be superuser while running this command for installation to complete. To confirm successful installation, execute python setup.py test.

Pynini will be available from PyPi eventually. In the meantime, we do maintain a periodically updated read-only GitHub mirror which can be used to install the current version of the library by executing pip install -e git+git@github.com:kylebgorman/pynini.git#egg=pynini.

Python 3 support

Python 3 support is available as of Pynini 2.0.0.

License

Pynini is released under the Apache license. See LICENSE for more information.

Interested in contributing?

See CONTRIBUTING for more information.

Mandatory disclaimer

This is not an official Google product.

Project details


Download files

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

Source Distribution

pynini-2.0.9.post2.tar.gz (536.6 kB view hashes)

Uploaded Source

Supported by

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