Registry / ai-ml / g2p-id-py

g2p-id-py

JSON →
library0.4.2pypypiunverified

A library for converting Indonesian text to phoneme sequences using a hybrid approach: rule-based conversion enhanced with an ONNX-based neural model. Current version 0.4.2, with active development on GitHub.

pip install g2p-id-py
INSTALL
IMPORT
SIG · G2P-ID-PY
G
g2p-id-py
ai-mlpythonv0.4.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IndonesianG2P
from g2p_id import IndonesianG2P
Main class for G2P conversion.

Instantiate IndonesianG2P and call g2p on a string to get phoneme list.

from g2p_id import IndonesianG2P g2p = IndonesianG2P() text = "Halo, apa kabar?" phonemes = g2p.g2p(text) print(phonemes) # Output: ['h', 'a', 'l', 'o', 'ʔ', 'a', 'p', 'a', 'k', 'a', 'b', 'a', 'r']
g2p-id --version
Debug
Known issues
breakingIn v0.4.2, glottal stop is inserted between consecutive vowels (e.g., 'hai' -> ['h', 'a', 'ʔ', 'i']). This changes output compared to earlier versions.
fix
If you rely on old behavior, pin to <0.4.2 or adjust your phoneme post-processing.
affects: >=0.4.2
breakingIn v0.4.2, all 'k' graphemes map to 'k' phoneme. Previously, some 'k's were mapped to 'ʔ'. This may affect downstream tasks like ASR.
fix
Check your phoneme expectations; update any mappings that assumed 'ʔ' for 'k'.
affects: >=0.4.2
gotchaThe package depends on NLTK's TweetTokenizer. As of v0.3.5, NLTK version is pinned due to backward incompatibility with >=3.8.1. If you have conflicting NLTK versions, it may break.
fix
Use the pinned version: pip install 'nltk==3.8' or see issue #16.
affects: >=0.3.5
gotchaThe ONNX model file is loaded with ONNX Runtime. If you need to serialize the IndonesianG2P object (e.g., with pickle), you must use v0.3.7+ where ONNX InferenceSession is wrapped.
fix
Upgrade to >=0.3.7, or handle serialization manually.
affects: <0.3.7
Upgrade
Version history
0.4.2latest on PyPI · released Dec 9, 2024
Audit
Dependencies
onnxruntimerequiredRequired for neural G2P model inference
nltkrequiredRequired for tokenization (TweetTokenizer)
Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
2
Resources
g2p-id-py — pip install g2p-id-py · libregistry