Skip to main content

WFST for Ukrainian ITN

Simple WFST for Ukrainian ITN based on NVIDIA NeMo and Pynini

Installation

pip install ukr-itn

Usage

from ukr.wfst import normalize

normalize("це трапилося дві тисячі дев'ятнадцятого числа")  # це трапилося 2019 числа
normalize("мінус пять цілих одна десята відсотка")  # -5.1 %
normalize("двадцять дві тисячі сто один")  # 22101

From command line

echo "це трапилося дві тисячі дев'ятнадцятого числа" | python -m ukr
Options:
  -h, --help     Show this help message and exit
  -j, --json     Return result as JSON
  -v, --verbose  Print original input and normalized to compare

Will return це трапилося 2019-го числа

JSON output

For more advanced usage you can get json output

from ukr.wfst import normalize

normalize("це трапилося дві тисячі дев'ятнадцятого числа", json=True)
# >>> '[{"word": "це"}, {"word": "трапилося"}, {"ordinal": "2019"}, {"word": "числа"}]' 

How it works

We have two king of FST: taggers and verbalizers

This is a tagger:

from ukr.wfst import classifyFst, apply_fst_text

apply_fst_text("мінус пять цілих одна десята відсотка", classifyFst.fst)  

will return "measure { decimal { negative: "true" integer_part: "5" fractional_part: "1" } units: "%" }"

And this is a verbalizers

from ukr.wfst import verbalizeFinalFst, apply_fst_text

apply_fst_text('measure { decimal { negative: "true" integer_part: "5" fractional_part: "1" } units: "%" }', verbalizeFinalFst.fst)  

will return -5.1 %

Metadata

Release files for ukr-itn 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ukr-itn 0.1.8
File Size Uploaded Provenance Actions
ukr_itn-0.1.8.tar.gz 25.3 kB Without provenance Details for ukr_itn-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ukr-itn 0.1.8
File Interpreter ABI Platform Actions
ukr_itn-0.1.8-py3-none-any.whl Python 3 none any Details for ukr_itn-0.1.8-py3-none-any.whl

Total release size: 65.6 kB

Release files / ukr_itn-0.1.8.tar.gz

Download URL ukr_itn-0.1.8.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ed73f2b0743df89df868f31ab49b9db46815d7ebd57eeccd114c5ade5745acb0
BLAKE2b-256 checksum
How to use checksums
a7c4385bd35cadd6f869ad56c7c8f61b9cf8eafa5efbb385906ad545cff44995
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.13

Release files / ukr_itn-0.1.8-py3-none-any.whl

Download URL ukr_itn-0.1.8-py3-none-any.whl
Size 40.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2d2fe65acbb9e337f3e514e70f2ec43831ecfdd070c01757fe7fb798718207f
BLAKE2b-256 checksum
How to use checksums
92e6acf76ecca6b4b5b80dbb083777e6fd2582c34e5ae34c5c8ce9328ae5df92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.13

Security for ukr-itn 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page