Skip to main content

Fast multilingual text-to-phoneme converter for South East Asian languages.

Project description

🦭 SEA-G2P

image

Fast multilingual text-to-phoneme converter for South East Asian languages.

Author: Pham Nguyen Ngoc Bao

Installation

pip install sea-g2p

Requires espeak-ng only for fallback (built-in dictionary already covers ~99.9% of words).

Usage

Simple Pipeline

from sea_g2p import SEAPipeline

pipeline = SEAPipeline(lang="vi")
result = pipeline.run("Giá SP500 hôm nay là 4.200,5 điểm.")
print(result)
#zˈaːɜ ˈɛɜt̪ pˈe nˈam tʃˈam hˈom nˈaj lˌaː2 bˈoɜn ŋˈi2n hˈaːj tʃˈam fˈəɪ4 nˈam ɗˈiɛ4m.

Individual Modules

from sea_g2p import Normalizer, G2P

normalizer = Normalizer(lang="vi")
g2p = G2P(lang="vi")

text = "Giá SP500 hôm nay là 4.200,5 điểm"
normalized = normalizer.normalize(text)
print(normalized)
phonemes = g2p.convert(normalized)
print(phonemes)
#giá ét pê năm trăm hôm nay là bốn nghìn hai trăm phẩy năm điểm.
#zˈaːɜ ˈɛɜt̪ pˈe nˈam tʃˈam hˈom nˈaj lˌaː2 bˈoɜn ŋˈi2n hˈaːj tʃˈam fˈəɪ4 nˈam ɗˈiɛ4m.

Features

  • Fast dictionary-based lookup using SQLite.
  • Vietnamese text normalization (numbers, dates, units).
  • Bilingual support (Vietnamese/English).
  • Batch processing for efficiency.
  • eSpeak-NG fallback for unknown words.

Development

To install for development purposes:

  1. Clone the repository:

    git clone https://github.com/pnnbao97/sea-g2p
    cd sea-g2p
    
  2. Install in editable mode:

    pip install -e .
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sea_g2p-0.4.2.tar.gz (28.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sea_g2p-0.4.2-py3-none-any.whl (28.4 MB view details)

Uploaded Python 3

File details

Details for the file sea_g2p-0.4.2.tar.gz.

File metadata

  • Download URL: sea_g2p-0.4.2.tar.gz
  • Upload date:
  • Size: 28.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for sea_g2p-0.4.2.tar.gz
Algorithm Hash digest
SHA256 7aa5fbf8e90e187dbad1efca4d3f080691e797244051331995aab1d479c22da9
MD5 25d9fd94fd054770e24eba793585d189
BLAKE2b-256 2e4c567339a408236ab7c9bc4785b0c799e6f74695d2839ddfdb515d18bcbff6

See more details on using hashes here.

File details

Details for the file sea_g2p-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: sea_g2p-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 28.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for sea_g2p-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 195b960ccd4db9a8e8c1b3442ef592f28d220875c83a91194a8e4c076c0a6af8
MD5 cd98089f1417192eede2c1c71a2ad1c6
BLAKE2b-256 22693aab41d210a1c5509a7e9359043aa91a5f4edd71226a6878df89d42f64f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page