khmer-g2p-ipa / app.py
seanghay's picture
Update app.py
6634815
raw
history blame
481 Bytes
import gradio as gr
from khmerphonemizer import phonemize
def merge(x):
if isinstance(x, str):
return x
return "".join(x)
def processor(text: str):
_, phones = phonemize(text)
return " ".join(map(merge, phones))
iface = gr.Interface(
title="Khmer Phonemizer",
description="Convert Khmer & English into Phonetic Symbols",
fn=processor, inputs="text",
outputs=["text"],
allow_flagging="never",
)
iface.launch(show_api=False)