Skip to main content

Python tool to extract sentences from po files and create language datasets for NLP machine learning

Project description

PO2Dataset

PyPI version PyPI Supported Python Versions check

po2dataset is a python tool to extract sentences from po files and create language datasets for machine translation.

This command line tool is intended to create dataset packages suitable for Argos Train.

How to install

From pip

pip install po2dataset

Manual installation

Create a virtual environment using virtualenv

git clone https://github.com/itzune/po2dataset.git
virtualenv po2dataset
cd po2dataset
source ./bin/activate

Quick start guide

Create Argos Train suitable dataset

po2dataset path/to/yourfile.po --name "MyProject" --source_code en --target_code eu --ref "Some reference information of the project"

Where:

  • name: The name of the project
  • source_code: Source language code (ISO 639)
  • target_code: Target language code (ISO 639)
  • ref: Some reference information of the project

Optional arguments:

  • format: Extension name of the zip file (default argosdata)
  • license: License to add into the package (default CC0). Options are: CC0, CC-BY, CC-BY-SA

Usage Examples

Basic Dataset Creation

To create a dataset from a .po file for an English-Basque translation project, run:

po2dataset path/to/yourfile.po --name "MyProject" --source_code en --target_code eu --ref "Translation dataset for project X"

Specifying Format and License

For different file format and license, use:

po2dataset path/to/yourfile.po --name "MyProject" --source_code en --target_code eu --format "zip" --license "CC-BY"

These commands create language dataset packages, with zip file format and CC-BY licensing options.

Support

Should you experience any issues do not hesistate to post an issue or contribute in this project pulling requests.

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

po2dataset-0.4.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

po2dataset-0.4.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file po2dataset-0.4.0.tar.gz.

File metadata

  • Download URL: po2dataset-0.4.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for po2dataset-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a5a8372257a30408b473eb959854404c0e3385b8243f1ccfeb0f3e4d3f96596c
MD5 39232d9c75b09ca9dbad28ce7c6343fa
BLAKE2b-256 fe8ded1bf7f41b0d57bd0bfbea127964f3c587206fa349afa198761d04ffabdd

See more details on using hashes here.

File details

Details for the file po2dataset-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: po2dataset-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for po2dataset-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5f3162be247c5d05f56dd860f1c2d41bc499bab4e3cc4cc03b139235e70b47c
MD5 9e498ee47793bdb2a4d968a28169d006
BLAKE2b-256 ba319f5e18342d9e7b5dd6f429382e459ede802f6a234788f4850d38138f461a

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