hama on-device NLP

Quickstart

Minimal examples for G2P and waveform phoneme ASR.

G2P

from hama import G2PModel

model = G2PModel()
result = model.predict(
  "Really? What's the orbital velocity of the moon?",
  preserve_literals="punct",
)
print(result.ipa)
print(result.display_ipa)

ASR

from hama import ASRModel

model = ASRModel()
result = model.transcribe_file("sample.wav")
print(result.phoneme_text)
print(result.word_phoneme_text)

For full signatures, options, and return shapes, see APIs.