Korean speech/NLP tools
Maintained. Last release 5 weeks ago, commits in 1 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install ko-speech-toolsKorean Speech Tools
This package contains a variety of tools for Korean speech and language processing, including:
- Hangul romanization.
- Jamo conversion.
- Grapheme-to-phoneme conversion (G2P).
It is mostly a collection of previously existing libraries that are unmaintained or include unnecessary dependencies that have been removed here. Refer to the Credits section below for details.
Installation
pip install ko-speech-tools
The core part of this package does not have any external dependencies. For G2P, the mecab-ko package is required, which can be installed with:
pip install ko-speech-tools[g2p]
Usage
Romanization:
>>> from ko_speech_tools import hangul_romanize
>>> hangul_romanize("물엿")
'mul-yeos'
Jamo conversion (documentation):
>>> from ko_speech_tools.jamo import h2j, j2hcj, j2h
>>> h2j('한굴')
'한굴'
>>> j2hcj(h2j('한굴'))
'ㅎㅏㄴㄱㅜㄹ'
>>> j2h('ㅇ', 'ㅕ', 'ㅇ')
'영'
G2P:
>>> from ko_speech_tools import G2p
>>> g2p = G2p()
>>> g2p("것입니다")
'거심니다'
Credits
This package combines and adapts the following packages:
g2pkk: https://github.com/harmlessman/g2pkk (Apache-2.0), a fork of https://github.com/Kyubyong/g2pKhangul_romanize: https://github.com/youknowone/hangul-romanize (BSD-2-Clause)jamo: (Apache-2.0)