{"id":27764,"library":"g2p-id-py","title":"Indonesian G2P (Grapheme-to-Phoneme)","description":"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.","status":"active","version":"0.4.2","language":"python","source_language":"en","source_url":"https://github.com/bookbot-kids/g2p_id","tags":["g2p","indonesian","phoneme","text-to-speech","onnx"],"install":[{"cmd":"pip install g2p-id-py","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for neural G2P model inference","package":"onnxruntime","optional":false},{"reason":"Required for tokenization (TweetTokenizer)","package":"nltk","optional":false}],"imports":[{"note":"Main class for G2P conversion.","wrong":"","symbol":"IndonesianG2P","correct":"from g2p_id import IndonesianG2P"}],"quickstart":{"code":"from g2p_id import IndonesianG2P\n\ng2p = IndonesianG2P()\ntext = \"Halo, apa kabar?\"\nphonemes = g2p.g2p(text)\nprint(phonemes)\n# Output: ['h', 'a', 'l', 'o', 'ʔ', 'a', 'p', 'a', 'k', 'a', 'b', 'a', 'r']","lang":"python","description":"Instantiate IndonesianG2P and call g2p on a string to get phoneme list."},"warnings":[{"fix":"If you rely on old behavior, pin to <0.4.2 or adjust your phoneme post-processing.","message":"In v0.4.2, glottal stop is inserted between consecutive vowels (e.g., 'hai' -> ['h', 'a', 'ʔ', 'i']). This changes output compared to earlier versions.","severity":"breaking","affected_versions":">=0.4.2"},{"fix":"Check your phoneme expectations; update any mappings that assumed 'ʔ' for 'k'.","message":"In v0.4.2, all 'k' graphemes map to 'k' phoneme. Previously, some 'k's were mapped to 'ʔ'. This may affect downstream tasks like ASR.","severity":"breaking","affected_versions":">=0.4.2"},{"fix":"Use the pinned version: pip install 'nltk==3.8' or see issue #16.","message":"The 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.","severity":"gotcha","affected_versions":">=0.3.5"},{"fix":"Upgrade to >=0.3.7, or handle serialization manually.","message":"The 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.","severity":"gotcha","affected_versions":"<0.3.7"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install: pip install g2p-id-py. Then import: from g2p_id import IndonesianG2P","cause":"Package not installed or wrong import path (e.g., using 'from g2p_id import g2p_id' or similar).","error":"ImportError: cannot import name 'IndonesianG2P' from 'g2p_id'"},{"fix":"Run: import nltk; nltk.download('punkt')","cause":"NLTK data (punkt tokenizer) is missing, required by TweetTokenizer.","error":"LookupError: \n  Resource punkt not found.\n  Please use the NLTK Downloader to obtain the resource:"},{"fix":"Check version: pip show g2p-id-py. Use default initialization: IndonesianG2P() or see docs for current constructor.","cause":"Older versions of IndonesianG2P accepted 'model_path' parameter; it was removed/renamed in later versions.","error":"TypeError: __init__() got an unexpected keyword argument 'model_path'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}