Skip to main content

Finite-state grammar compilation

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.)

Installation instructions

Users can either install using conda-forge, or can compile the extensions and their dependencies from scratch.

Conda installation

Linux (x86) and Mac OS X users who already have conda can install Pynini and all dependencies with the following command

conda install -c conda-forge pynini

Source installation

Pynini depends on:

  • A standards-compliant C++17 compiler (GCC >= 7 or Clang >= 700)
  • The compatible recent version of OpenFst (see NEWS for this) built with the far, pdt, mpdt, and script extensions (i.e., built with ./configure --enable-grm) and headers
  • Python 3.6+ and headers

Once these are installed, issue the following command:

python setup.py install

To confirm successful installation, run python test/pynini_test.py; if all tests pass, the final line will read OK.

Pynini source installation for the current version has been tested on Debian Linux 5.7.17-1 on x86_64, GCC 10.2.0, and Python 3.8.5.

Python version support

Pynini 2.0.0 and onward support Python 3. The Pynini 2.1 versions (onward) drop Python 2 support.

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.1.4.tar.gz (621.9 kB view details)

Uploaded Source

Built Distributions

pynini-2.1.4-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (107.7 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pynini-2.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (165.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pynini-2.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (165.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pynini-2.1.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (165.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pynini-2.1.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (165.5 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

File details

Details for the file pynini-2.1.4.tar.gz.

File metadata

  • Download URL: pynini-2.1.4.tar.gz
  • Upload date:
  • Size: 621.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for pynini-2.1.4.tar.gz
Algorithm Hash digest
SHA256 e276e082dcdb37432bf6721e9af28d86d35d7131ca7821b3dea496f4e89110d8
MD5 c104511a97b0d025b497211d0995e5d1
BLAKE2b-256 8d24a98a6c0ef2e85c9ce4f39c618f140e1a8cc44e5117034b427203dc0ef950

See more details on using hashes here.

File details

Details for the file pynini-2.1.4-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pynini-2.1.4-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd68af88cf3bac31a70cfd18bb6fd464942a6b2b858e401322762f5b3a64f669
MD5 492bc1d44a4f764bfc2f8c330091fcb5
BLAKE2b-256 7c0fd63d455d1c52bcd27fdda3045bcf084a99fa7c6fb68d6d165539731a7273

See more details on using hashes here.

File details

Details for the file pynini-2.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pynini-2.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 13a6357a037fd37f8146282658ec298e755211c5f6f2d1f94ffb919430b9fd2b
MD5 814b1f5bde92d11a333815c699e15d35
BLAKE2b-256 393bb6f9d3bdca63677e7da17f89ec996dbd86a1ab718f3ec628006d8b5c19f2

See more details on using hashes here.

File details

Details for the file pynini-2.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pynini-2.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 24ff798539da1d7543de121a414bf37e6747cc88e4464369c0ff2a2566849e84
MD5 dd9dd6e0886448b05c833fc216502be6
BLAKE2b-256 2c8fb331479663f83a8b72302a1b187620b110bf97b4377d84b41b604ed048ab

See more details on using hashes here.

File details

Details for the file pynini-2.1.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pynini-2.1.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b71d878f78246827c00d20e7936f43c4482f72d92e5c3813b1bf9093b36a8a2a
MD5 c8162fb713557ca3141996966e70a991
BLAKE2b-256 8ede5710166575493dec18a86d31795f550fa4c9cc5bc23c07515f063061fdf7

See more details on using hashes here.

File details

Details for the file pynini-2.1.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pynini-2.1.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 22d36f601194e5230f700d4f3e7a3a47c5d1bf1661b297d1cc565203694b6a56
MD5 70716f5acb834d955f457ed9e0f18059
BLAKE2b-256 3185a06790567cdad7605367e12506c06b23c8a70ccbeca0b68ffbfcddfdd127

See more details on using hashes here.

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