Skip to main content

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

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

Uploaded Source

Built Distribution

po2dataset-0.5.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for po2dataset-0.5.1.tar.gz
Algorithm Hash digest
SHA256 abfed5cd15eb49d46527f81121a1e8d64f818607e54d573685a87b57c5aed360
MD5 b7c0df0ba8fbceca79d1cebfabe82b18
BLAKE2b-256 1b871901272a74408270a47bd452fe8336c359d3b1daab89ce2ceaa767093944

See more details on using hashes here.

Provenance

The following attestation bundles were made for po2dataset-0.5.1.tar.gz:

Publisher: semantic-release.yml on itzune/po2dataset

Attestations:

File details

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

File metadata

  • Download URL: po2dataset-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a1c9bd7a7570305e5a084f62b226a7470fd7d5dab80055e1a710783ea754545
MD5 68f8f3db9c2a3e673a0785116f071c67
BLAKE2b-256 d224ddd6a21e5dda4c81942658d7a28e4bea208340912df153fad69ce06b99f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for po2dataset-0.5.1-py3-none-any.whl:

Publisher: semantic-release.yml on itzune/po2dataset

Attestations:

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