Fix brand names and technical terms that your speech-to-text tool keeps getting wrong, like 'CapsWriter' being heard as 'Caps Rider'.
Expand voice shortcuts into full text, say a short alias out loud and have it output a full phone number or email address.
Post-process transcripts from any speech recognition system to clean up proper nouns and uncommon words automatically.
Handle mixed Chinese and English voice input and correct recognition errors in both languages with one tool.
Install two packages: pypinyin and rapidfuzz. Clone the repo, add your hotwords to a plain text file (word|alias format), then run the included demo script to test corrections immediately.
Speech recognition software often gets uncommon words wrong. Brand names, technical terms, and proper nouns tend to come out garbled: "CapsWriter" might be transcribed as "Caps Rider", "Claude" as "cloud", and a Chinese brand name might appear as an ordinary word that sounds similar. This library is a post-processing tool you run on the raw text output from any speech recognition system to fix those mistakes. The core idea is phoneme-based matching. Instead of comparing words letter-by-letter, the library converts both your list of target words and the recognized text into sound units (pinyin syllables for Chinese, individual letters for English), then measures how similar the sounds are. If the similarity score passes a threshold you set, the misrecognized fragment is replaced with the correct word. Processing 5,000 hotwords against a single sentence takes about 20 milliseconds. You define your hotwords in a plain text file, one entry per line. Each entry has a target word followed by one or more aliases, separated by pipe characters. The aliases are alternate ways the word might get transcribed. Any alias that sounds similar enough to something in the recognized text will trigger a replacement with the first word in the line. The first word does not have to be a correction target, it can be any text you want to type quickly, like a phone number or email address. Saying the alias out loud then outputs the full expansion. The library is extracted from a larger project called CapsWriter-Offline, which is a voice typing tool for Windows. It supports mixed Chinese and English text. Installation requires two Python packages: pypinyin (for Chinese phoneme conversion) and rapidfuzz (for fuzzy string matching). The repository includes a sample hotword file and a demo script so you can test corrections against example inputs right away.
← haujetzhao on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.