jmtl/hk-cantonese-jyutping-classifier
Cantonese Dialect Recognition
2 min read
This model analyzes Hong Kong Cantonese speech and transcribes it syllable by syllable into the Jyutping phonetic system. It outputs initial consonants, final vowels, tones from 1 to 6, and syllable timestamps. Built on a frozen SenseVoiceSmall encoder with an additional adapter, the model runs locally without requiring a GPU. It stands out for its detailed phonetic analysis and is useful for voice assistant developers, linguists, and speech technology researchers.
Key features
- Cantonese speech recognition broken down by syllables, tones, and timecodes.
- Two operating modes: audio-only or with preliminary text alignment (forced alignment).
- Use of a frozen SenseVoiceSmall base encoder and a specialized IPA adapter.
- Confidence scores provided for each syllable, consonant, and tone.
- Fully operational on a standard CPU with no GPU requirements.
What you can do
- Transcribe a Cantonese audio recording with precise identification of tones and syllables in JSON format.
- Compare the recognized Jyutping with the source text to identify phonetic differences and accents.
- Use the built-in text analysis tool based on SenseVoiceSmall to get a second opinion on the transcription.
- Integrate the classifier into Python and PyTorch-based speech processing pipelines.
Example
import sys
sys.path.insert(0, "jyutping")
from audio_only import JyutpingTranscriber, load_audio
model = JyutpingTranscriber("SenseVoiceSmall", "cantonese.pt", "src", root="jyutping")
syllables = model.transcribe(load_audio("sentence.flac"))
print(" ".join(s["jyutping"] for s in syllables))
Read more
DetailsTested on Linux with Python 3.10, PyTorch 2.4.1, and FunASR 1.4.4 on a CPU with three threads.
Weights are distributed under the CC BY-NC-SA 4.0 license, and the code is under the Apache-2.0 license.
Operation requires the SenseVoiceSmall encoder weights and the Cantonese IPA adapter with SHA-256 checksum verification.










Comments