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 thefar
,pdt
,mpdt
, andscript
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 |
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 |
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 |
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 |
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 |