# RXN package for OpenNMT-related utilities
[](https://github.com/rxn4chemistry/rxn-onmt-utils/actions)
This repository contains OpenNMT-related utilities used in the RXN universe.
For general utilities not related to OpenNMT, see our other repository [`rxn-utilities`](https://github.com/rxn4chemistry/rxn-utilities).
Links:
* [GitHub repository](https://github.com/rxn4chemistry/rxn-onmt-utils)
* [Documentation](https://rxn4chemistry.github.io/rxn-onmt-utils/)
* [PyPI package](https://pypi.org/project/rxn-onmt-utils/)
## System Requirements
This package is supported on all operating systems.
It has been tested on the following systems:
+ macOS: Big Sur (11.1)
+ Linux: Ubuntu 18.04.4
A Python version of 3.6, 3.7, or 3.8 is recommended.
Python versions 3.9 and above are not expected to work due to compatibility with the selected version of OpenNMT.
## Installation guide
The package can be installed from Pypi:
```bash
pip install rxn-onmt-utils
```
For local development, the package can be installed with:
```bash
pip install -e ".[dev]"
```
## Package highlights
### Translate with OpenNMT from Python code
By importing the following,
```python
from rxn.onmt_utils import Translator, translate
```
you can do OpenNMT translations directly in Python.
The `translate` function acts on input/output files, while the `Translator` class gives you flexibility for getting translation results on strings directly.
### Stripping models
The script `rxn-strip-opennmt-model` installed the package allows you to strip ~2/3 of the size of model checkpoints by removing the state of the optimizer.
You can do this safely if you don't need to continue training on these checkpoints.
### Extending the model vocabulary
If you finetune a model on a dataset with additional tokens compared to the base model, you will need to extend the model weights.
The script `rxn-extend-model-with-vocab` does that for you.
Raw data
{
"_id": null,
"home_page": "https://github.com/rxn4chemistry/rxn-onmt-utils",
"name": "rxn-onmt-utils",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "IBM RXN team",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/24/16/aadae28f8295329cea999557b58ae6d7d7d24d90de21304b0ea2c86a3a4f/rxn-onmt-utils-1.1.0.tar.gz",
"platform": null,
"description": "# RXN package for OpenNMT-related utilities\n\n[](https://github.com/rxn4chemistry/rxn-onmt-utils/actions)\n\nThis repository contains OpenNMT-related utilities used in the RXN universe.\nFor general utilities not related to OpenNMT, see our other repository [`rxn-utilities`](https://github.com/rxn4chemistry/rxn-utilities).\n\nLinks:\n* [GitHub repository](https://github.com/rxn4chemistry/rxn-onmt-utils)\n* [Documentation](https://rxn4chemistry.github.io/rxn-onmt-utils/)\n* [PyPI package](https://pypi.org/project/rxn-onmt-utils/)\n\n## System Requirements\n\nThis package is supported on all operating systems. \nIt has been tested on the following systems:\n+ macOS: Big Sur (11.1)\n+ Linux: Ubuntu 18.04.4\n\nA Python version of 3.6, 3.7, or 3.8 is recommended.\nPython versions 3.9 and above are not expected to work due to compatibility with the selected version of OpenNMT.\n\n## Installation guide\n\nThe package can be installed from Pypi:\n```bash\npip install rxn-onmt-utils\n```\n\nFor local development, the package can be installed with:\n```bash\npip install -e \".[dev]\"\n```\n\n## Package highlights\n\n### Translate with OpenNMT from Python code\n\nBy importing the following,\n```python\nfrom rxn.onmt_utils import Translator, translate\n```\nyou can do OpenNMT translations directly in Python. \nThe `translate` function acts on input/output files, while the `Translator` class gives you flexibility for getting translation results on strings directly.\n\n\n### Stripping models\n\nThe script `rxn-strip-opennmt-model` installed the package allows you to strip ~2/3 of the size of model checkpoints by removing the state of the optimizer.\nYou can do this safely if you don't need to continue training on these checkpoints.\n\n\n### Extending the model vocabulary\n\nIf you finetune a model on a dataset with additional tokens compared to the base model, you will need to extend the model weights.\nThe script `rxn-extend-model-with-vocab` does that for you.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Utilities related to the use of OpenNMT",
"version": "1.1.0",
"project_urls": {
"Documentation": "https://rxn4chemistry.github.io/rxn-onmt-utils/",
"Homepage": "https://github.com/rxn4chemistry/rxn-onmt-utils",
"Repository": "https://github.com/rxn4chemistry/rxn-onmt-utils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "81f0891fbf009ec737cb6088e4e11b574bae69a14cbf9c46dd1d7af64dae3ed1",
"md5": "7b61ca054bea0f152c001409b7b29af8",
"sha256": "08243dc198c6e2693882c6a2c31f5dfc4f537e4eb7a8978f6f90c09cf800cf22"
},
"downloads": -1,
"filename": "rxn_onmt_utils-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7b61ca054bea0f152c001409b7b29af8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 17406,
"upload_time": "2023-10-05T08:56:54",
"upload_time_iso_8601": "2023-10-05T08:56:54.688887Z",
"url": "https://files.pythonhosted.org/packages/81/f0/891fbf009ec737cb6088e4e11b574bae69a14cbf9c46dd1d7af64dae3ed1/rxn_onmt_utils-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2416aadae28f8295329cea999557b58ae6d7d7d24d90de21304b0ea2c86a3a4f",
"md5": "08bf69f88155d8235b857d65ddc75937",
"sha256": "76f8d4a94e521ff7d04a2a0b8055da32fdd39f33ff210cb62792669a755e2ba3"
},
"downloads": -1,
"filename": "rxn-onmt-utils-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "08bf69f88155d8235b857d65ddc75937",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14955,
"upload_time": "2023-10-05T08:56:56",
"upload_time_iso_8601": "2023-10-05T08:56:56.289117Z",
"url": "https://files.pythonhosted.org/packages/24/16/aadae28f8295329cea999557b58ae6d7d7d24d90de21304b0ea2c86a3a4f/rxn-onmt-utils-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-05 08:56:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rxn4chemistry",
"github_project": "rxn-onmt-utils",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rxn-onmt-utils"
}