# OpenGrm Pynini
This is a a Python extension module for compiling, optimizing and applying
grammar rules. Rules can be compiled into weighted finite state transducers,
pushdown transducers, or multi-pushdown transducers. It uses OpenFst
finite-state transducers (FSTs) and FST archives (FArs) as inputs and outputs.
This library is primarily developed by [Kyle Gorman](mailto:kbg@google.com).
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](http://openfst.cs.nyu.edu/twiki/pub/GRM/Pynini/pynini-paper.pdf).
> 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
- A standards-compliant C++17 compiler (GCC \>= 7 or Clang \>= 700)
- The compatible recent version of [OpenFst](http://openfst.org) (see
[`NEWS`](NEWS) for this) built with the `grm` extensions (i.e., built with
`./configure --enable-grm`) and headers
- [Python 3.6+](https://www.python.org) and headers
## Installation instructions
There are various ways to install Pynini depending on your platform.
### Windows
While Pynini is neither designed for nor tested on Windows, it can be installed
using the
[Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
(WSL). Simply enter the WSL environment and follow the Linux instructions below.
### MacOS
The pre-compiled library can be installed from
[`conda-forge`](https://conda-forge.org/) by running `conda install -c
conda-forge pynini`.
Alternatively, one can build from source from [PyPI](https://pypi.org/) by
running `pip install pynini`.
Finally, one can use [Bazel](https://bazel.build) to build from source by
running `bazel build //:all` anywhere in the source tree.
### Linux
The pre-compiled library can be installed from
[`conda-forge`](https://conda-forge.org/) by running `conda install -c
conda-forge pynini`.
Alternatively, one can install a pre-compiled
[`manylinux`](https://github.com/pypa/manylinux) wheel from
[PyPI](https://pypi.org/) by running `pip install pynini`. This will install the
pre-compiled `manylinux` wheel (if available for the release and compatible with
your platform), and build and install from source if not. Unlike the
`conda-forge` option above, which also installs [OpenFst](http://openfst.org/)
and [Graphviz](https://graphviz.org/), this does not install the OpenFst or
Graphviz command-line tools. See the enclosed
[`Dockerfile`](third_party/Dockerfile) for instructions for building and
deploying `manylinux` wheels.
Finally, one can use [Bazel](https://bazel.build) to build from source by
running `bazel build //:all` anywhere in the source tree.
## Testing
To confirm successful installation, run `pip install -r requirements`, then
`python tests/pynini_test.py`. If all tests pass, the final line will read `OK`;
a successful run will log some errors to STDERR (this is working as expected).
## Python version support
Pynini 2.0.0 and onward support Python 3. Pynini 2.1 versions (onward) drop
Python 2 support. The current release supports Python 3.8--3.13.
# License
Pynini is released under the Apache license. See [`LICENSE`](LICENSE) for more
information.
# Interested in contributing?
See [`CONTRIBUTING`](CONTRIBUTING) for more information.
# Mandatory disclaimer
This is not an official Google product.
Raw data
{
"_id": null,
"home_page": "http://pynini.opengrm.org",
"name": "pynini",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "computational linguistics, morphology, natural language processing, language",
"author": "Kyle Gorman <kbg@google.com>",
"author_email": "kbg@google.com",
"download_url": "https://files.pythonhosted.org/packages/b8/79/06049a733359a2da244c21a88df90828cf27eb0f7947ebb8b00653c7e93c/pynini-2.1.6.post1.tar.gz",
"platform": null,
"description": "# OpenGrm Pynini\n\nThis is a a Python extension module for compiling, optimizing and applying\ngrammar rules. Rules can be compiled into weighted finite state transducers,\npushdown transducers, or multi-pushdown transducers. It uses OpenFst\nfinite-state transducers (FSTs) and FST archives (FArs) as inputs and outputs.\n\nThis library is primarily developed by [Kyle Gorman](mailto:kbg@google.com).\n\nIf you use Pynini in your research, we would appreciate if you cite the\nfollowing paper:\n\n> K. Gorman. 2016.\n> [Pynini: A Python library for weighted finite-state grammar compilation](http://openfst.cs.nyu.edu/twiki/pub/GRM/Pynini/pynini-paper.pdf).\n> In *Proc. ACL Workshop on Statistical NLP and Weighted Automata*, 75-80.\n\n(Note that some of the code samples in the paper are now out of date and not\nexpected to work.)\n\n## Dependencies\n\n- A standards-compliant C++17 compiler (GCC \\>= 7 or Clang \\>= 700)\n- The compatible recent version of [OpenFst](http://openfst.org) (see\n [`NEWS`](NEWS) for this) built with the `grm` extensions (i.e., built with\n `./configure --enable-grm`) and headers\n- [Python 3.6+](https://www.python.org) and headers\n\n## Installation instructions\n\nThere are various ways to install Pynini depending on your platform.\n\n### Windows\n\nWhile Pynini is neither designed for nor tested on Windows, it can be installed\nusing the\n[Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\n(WSL). Simply enter the WSL environment and follow the Linux instructions below.\n\n### MacOS\n\nThe pre-compiled library can be installed from\n[`conda-forge`](https://conda-forge.org/) by running `conda install -c\nconda-forge pynini`.\n\nAlternatively, one can build from source from [PyPI](https://pypi.org/) by\nrunning `pip install pynini`.\n\nFinally, one can use [Bazel](https://bazel.build) to build from source by\nrunning `bazel build //:all` anywhere in the source tree.\n\n### Linux\n\nThe pre-compiled library can be installed from\n[`conda-forge`](https://conda-forge.org/) by running `conda install -c\nconda-forge pynini`.\n\nAlternatively, one can install a pre-compiled\n[`manylinux`](https://github.com/pypa/manylinux) wheel from\n[PyPI](https://pypi.org/) by running `pip install pynini`. This will install the\npre-compiled `manylinux` wheel (if available for the release and compatible with\nyour platform), and build and install from source if not. Unlike the\n`conda-forge` option above, which also installs [OpenFst](http://openfst.org/)\nand [Graphviz](https://graphviz.org/), this does not install the OpenFst or\nGraphviz command-line tools. See the enclosed\n[`Dockerfile`](third_party/Dockerfile) for instructions for building and\ndeploying `manylinux` wheels.\n\nFinally, one can use [Bazel](https://bazel.build) to build from source by\nrunning `bazel build //:all` anywhere in the source tree.\n\n## Testing\n\nTo confirm successful installation, run `pip install -r requirements`, then\n`python tests/pynini_test.py`. If all tests pass, the final line will read `OK`;\na successful run will log some errors to STDERR (this is working as expected).\n\n## Python version support\n\nPynini 2.0.0 and onward support Python 3. Pynini 2.1 versions (onward) drop\nPython 2 support. The current release supports Python 3.8--3.13.\n\n# License\n\nPynini is released under the Apache license. See [`LICENSE`](LICENSE) for more\ninformation.\n\n# Interested in contributing?\n\nSee [`CONTRIBUTING`](CONTRIBUTING) for more information.\n\n# Mandatory disclaimer\n\nThis is not an official Google product.\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Finite-state grammar compilation",
"version": "2.1.6.post1",
"project_urls": {
"Homepage": "http://pynini.opengrm.org",
"homepage": "https://pynini.opengrm.org"
},
"split_keywords": [
"computational linguistics",
" morphology",
" natural language processing",
" language"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ad3abf7d70e896d3099999c0350c5deb4c7d404738f34b422ddb1481321009b2",
"md5": "46a2e22b4b0576ec9b783fc56b2b6111",
"sha256": "10f0717fc6bf09330c41978e4d958a000b790b9b344cbc1117d33b008edf4fde"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1-cp310-cp310-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "46a2e22b4b0576ec9b783fc56b2b6111",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 154542089,
"upload_time": "2024-07-18T22:05:38",
"upload_time_iso_8601": "2024-07-18T22:05:38.811676Z",
"url": "https://files.pythonhosted.org/packages/ad/3a/bf7d70e896d3099999c0350c5deb4c7d404738f34b422ddb1481321009b2/pynini-2.1.6.post1-cp310-cp310-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b2595c2499971384041aa9a2ad16c02c5d70f6802d49cac08e234f265cd1bc67",
"md5": "69693b7e4faa70a0b9594ec8b0fe8bb3",
"sha256": "957a8b0d7b27a6c7ac15aae1e0e384d92e3ea2ef4e673188a8ccb92a3224e895"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1-cp311-cp311-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "69693b7e4faa70a0b9594ec8b0fe8bb3",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 154760801,
"upload_time": "2024-07-18T22:05:47",
"upload_time_iso_8601": "2024-07-18T22:05:47.569227Z",
"url": "https://files.pythonhosted.org/packages/b2/59/5c2499971384041aa9a2ad16c02c5d70f6802d49cac08e234f265cd1bc67/pynini-2.1.6.post1-cp311-cp311-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "62cf67f560932cbb12a0d7d69e14ed08e83e0ee1ca0ea1c019e486b21048e9b7",
"md5": "32164462045dea980aa9a52a6c33071b",
"sha256": "ca567a454fefa7c9bf5180d4d9b4cb5d62f9f99fa326554076fe2a945dc2f776"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1-cp312-cp312-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "32164462045dea980aa9a52a6c33071b",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 154687038,
"upload_time": "2024-07-18T22:05:56",
"upload_time_iso_8601": "2024-07-18T22:05:56.311484Z",
"url": "https://files.pythonhosted.org/packages/62/cf/67f560932cbb12a0d7d69e14ed08e83e0ee1ca0ea1c019e486b21048e9b7/pynini-2.1.6.post1-cp312-cp312-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1e057b2fd6fcaa33362e1bc99cf371273d1500e4b105c9f26ad0c65a43c68551",
"md5": "9265b142ea413d7ee713a6b26d3ba840",
"sha256": "afcbcd23eaed541c5619c47b20031055af7ded44980fe96c7e6d939fac81b91f"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1-cp313-cp313-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "9265b142ea413d7ee713a6b26d3ba840",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.8",
"size": 154685970,
"upload_time": "2024-07-18T22:06:04",
"upload_time_iso_8601": "2024-07-18T22:06:04.730823Z",
"url": "https://files.pythonhosted.org/packages/1e/05/7b2fd6fcaa33362e1bc99cf371273d1500e4b105c9f26ad0c65a43c68551/pynini-2.1.6.post1-cp313-cp313-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6be4294de71581e44d350df42a22d1f4225ebfbab8f10942485df52a74fbc2fc",
"md5": "5a722f9104e03f0ca0ad8af178047e48",
"sha256": "89c282fc6d6e61781f1ab1ebd614b3db95f0d39cdbf662bdb2a78853d04dbdb0"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1-cp38-cp38-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "5a722f9104e03f0ca0ad8af178047e48",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 154669971,
"upload_time": "2024-07-18T22:06:12",
"upload_time_iso_8601": "2024-07-18T22:06:12.585975Z",
"url": "https://files.pythonhosted.org/packages/6b/e4/294de71581e44d350df42a22d1f4225ebfbab8f10942485df52a74fbc2fc/pynini-2.1.6.post1-cp38-cp38-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "995c71df7fd882bfe38be0c74a52ba6748d91f49a30ccf155e0b3ea9203b1a84",
"md5": "e8d7fc697d9c523508537bc456f9bc57",
"sha256": "3c77d24d2111b7aeabfbdac69fbd52d512eb67481fa348b3e8e1e688cb63f792"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1-cp39-cp39-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "e8d7fc697d9c523508537bc456f9bc57",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 154545776,
"upload_time": "2024-07-18T22:06:19",
"upload_time_iso_8601": "2024-07-18T22:06:19.769981Z",
"url": "https://files.pythonhosted.org/packages/99/5c/71df7fd882bfe38be0c74a52ba6748d91f49a30ccf155e0b3ea9203b1a84/pynini-2.1.6.post1-cp39-cp39-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e2236a487e8de16b151f5b9bfbd15d5b7969976d8bc5e79eaba8a33513dda6d8",
"md5": "fe69cfb142df9398ce366884455bfafa",
"sha256": "a5a38e074b9eaf7aa08c1cd286d5b7990ef9ccc28f4e5e8d31f09ba10729431d"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "fe69cfb142df9398ce366884455bfafa",
"packagetype": "bdist_wheel",
"python_version": "pp310",
"requires_python": ">=3.8",
"size": 98750903,
"upload_time": "2024-07-18T22:06:25",
"upload_time_iso_8601": "2024-07-18T22:06:25.975837Z",
"url": "https://files.pythonhosted.org/packages/e2/23/6a487e8de16b151f5b9bfbd15d5b7969976d8bc5e79eaba8a33513dda6d8/pynini-2.1.6.post1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "82227d3c5fc5ea2aabe87ce09cb14415cbf822c97bda283065f29da6de9aa23a",
"md5": "bbedfa2fb6e5e8bf8e2d0e9bb4440525",
"sha256": "8bb8b57896df3ae01bc3a7e4018b90847d16b7a1f0430c1c0bc8a73d1e23baf6"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "bbedfa2fb6e5e8bf8e2d0e9bb4440525",
"packagetype": "bdist_wheel",
"python_version": "pp39",
"requires_python": ">=3.8",
"size": 98752437,
"upload_time": "2024-07-18T22:06:31",
"upload_time_iso_8601": "2024-07-18T22:06:31.863011Z",
"url": "https://files.pythonhosted.org/packages/82/22/7d3c5fc5ea2aabe87ce09cb14415cbf822c97bda283065f29da6de9aa23a/pynini-2.1.6.post1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b87906049a733359a2da244c21a88df90828cf27eb0f7947ebb8b00653c7e93c",
"md5": "4980c77c4c392ee178c8551a27202007",
"sha256": "d831ab53abb22c862fb56471b12edf26e77d2b02d1956f45f0259e6402493084"
},
"downloads": -1,
"filename": "pynini-2.1.6.post1.tar.gz",
"has_sig": false,
"md5_digest": "4980c77c4c392ee178c8551a27202007",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 790361,
"upload_time": "2024-07-18T22:05:13",
"upload_time_iso_8601": "2024-07-18T22:05:13.037675Z",
"url": "https://files.pythonhosted.org/packages/b8/79/06049a733359a2da244c21a88df90828cf27eb0f7947ebb8b00653c7e93c/pynini-2.1.6.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-18 22:05:13",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pynini"
}