Skip to content

v5.4.0

Latest

Choose a tag to compare

@bact bact released this 09 Oct 00:57
· 37 commits to main since this release
7f26adf

PyThaiNLP 5.4.0 adds new Thai pronunciation functions and a revision option for Hugging Face models. It also brings many bug fixes and safer corpus downloads and extraction. It is the first release to ship a software bill of materials (SBOM).

Highlights

  • New transliterate.pronunciate_pali() and transliterate_wiktionary().
  • tokenize.deepcut now runs on a built-in ONNX model, so it no longer needs TensorFlow.
  • download() is safer: a failed download keeps the installed corpus, db.json is written atomically, and tar and zip extraction rejects escaping links.
  • Many functions no longer crash on valid input (sound_syllable(), tone_detector(), puan(), check_klon(), thaiword_to_time()), and nighit() is more accurate.

Supply chain

  • Each wheel embeds an SPDX 3 SBOM in .dist-info/sboms/, as defined by PEP 770. The same file is attached to this release as pythainlp-5.4.0.spdx3.json.
  • The wheel, the source distribution, and the SBOM each have a Sigstore bundle and a GitHub artifact attestation (build provenance). To verify them, see Verify release files.

Behavior changes to note

  • tokenize.deepcut no longer applies custom_dict.
  • bleu_score() raises ValueError when the reference and hypothesis counts differ.
  • nighit() requires w1 to end with "ํ".

Requires Python 3.9 or later. Upgrade with:

pip install --upgrade pythainlp

See the change log for details.

New Contributors

Full Changelog: v5.3.8...v5.4.0