{"id":21081777,"url":"https://github.com/openvoiceos/ovos-utterance-corrections-plugin","last_synced_at":"2025-06-22T06:07:09.302Z","repository":{"id":185325943,"uuid":"656928852","full_name":"OpenVoiceOS/ovos-utterance-corrections-plugin","owner":"OpenVoiceOS","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-10T21:27:02.000Z","size":31,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"dev","last_synced_at":"2025-06-22T06:06:59.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenVoiceOS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["OpenVoiceOS"],"patreon":"openvoiceos","liberapay":"OpenVoiceOS-Foundation","custom":"https://paypal.me/openvoiceos"}},"created_at":"2023-06-22T00:12:25.000Z","updated_at":"2025-06-10T21:27:06.000Z","dependencies_parsed_at":"2024-11-19T20:11:01.801Z","dependency_job_id":"25570838-35c0-4e06-9a7e-82ad8c791360","html_url":"https://github.com/OpenVoiceOS/ovos-utterance-corrections-plugin","commit_stats":null,"previous_names":["openvoiceos/ovos-utterance-corrections-plugin"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/OpenVoiceOS/ovos-utterance-corrections-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-utterance-corrections-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-utterance-corrections-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-utterance-corrections-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-utterance-corrections-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenVoiceOS","download_url":"https://codeload.github.com/OpenVoiceOS/ovos-utterance-corrections-plugin/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-utterance-corrections-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261244056,"owners_count":23129643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T20:10:57.569Z","updated_at":"2025-06-22T06:07:04.260Z","avatar_url":"https://github.com/OpenVoiceOS.png","language":"Python","funding_links":["https://github.com/sponsors/OpenVoiceOS","https://patreon.com/openvoiceos","https://liberapay.com/OpenVoiceOS-Foundation","https://paypal.me/openvoiceos"],"categories":[],"sub_categories":[],"readme":"# Utterance Corrections plugin\n\nThis plugin provides tools to correct or adjust speech-to-text (STT) outputs for better intent matching or improved user experience.\n\n### Key Features:\n1. **\"Secret Speech\"**: Map random utterances to something else so you can furtively give orders to your assistant.\n2. **Shortcuts**: Map shorter utterances or slang to known utterances that trigger the correct intent.\n3. **Manual STT Fixes**: Correct common STT transcription errors you experimentally determined.\n\n---\n\n## 1. Full Utterance Corrections\n\nThis plugin checks a user-defined JSON file for **utterance fixes** at `~/.local/share/mycroft/corrections.json`.\n\n**Fuzzy matching** is used to determine if an utterance matches a transcription. If similarity is greater than or equal to **85%**, the replacement is returned instead of the original transcription.\n\n### Example: `corrections.json`\n```json\n{\n    \"I hate open source\": \"I love open source\",\n    \"do the thing\": \"trigger protocol 404\"\n}\n```\n\n**Input**:  \n`\"I hat open source\"`  \n\n**Output**:  \n`\"I love open source\"`\n\n---\n\n## 2. Word-Level Corrections\n\nYou can also define unconditional word-level replacements in `~/.local/share/mycroft/word_corrections.json`.  \n\nThis is particularly useful when STT models repeatedly transcribe specific names or words incorrectly.\n\n### Example: `word_corrections.json`\n```json\n{\n    \"Jimmy Hendricks\": \"Jimi Hendrix\",\n    \"Eric Klapptern\": \"Eric Clapton\",\n    \"Eric Klappton\": \"Eric Clapton\"\n}\n```\n\n**Input**:  \n`\"I love Jimmy Hendricks\"`  \n\n**Output**:  \n`\"I love Jimi Hendrix\"`\n\n\n\u003e **use case**: whisper STT often does this mistake in it's transcriptions\n\n---\n\n## 3. Regex-Based Corrections\n\nFor more complex corrections, you can use **regular expressions** in `~/.local/share/mycroft/regex_corrections.json`.  \n\nThis is useful for fixing consistent patterns in STT errors, such as replacing incorrect trigraphs.\n\n### Example: `regex_corrections.json`\n```json\n{\n    \"\\\\bsh(\\\\w*)\": \"sch\\\\1\"\n}\n```\n\n### Explanation:\n- **`\\\\bsh(\\\\w*)`**: Matches words starting with `sh` at a word boundary.\n- **`sch\\\\1`**: Replaces `sh` with `sch` and appends the rest of the word.\n\n### Example Usage:\n**Input**:  \n`\"shalter is a switch\"`  \n\n**Output**:  \n`\"schalter is a switch\"`\n\n\u003e **use case**: citrinet german model often does this mistake in it's transcriptions\n\n---\n\n## Configuration Paths\n\n| File                      | Purpose                               |\n|---------------------------|---------------------------------------|\n| `corrections.json`        | Full utterance replacements.          |\n| `word_corrections.json`   | Word-level replacements.              |\n| `regex_corrections.json`  | Regex-based pattern replacements.     |\n\nAll correction files are stored under:  \n`~/.local/share/mycroft/`\n\n---\n\n### Usage Scenarios\n- **Improve Intent Matching**: Ensure consistent STT output for accurate intent triggers.\n- **Fix Model-Specific Errors**: Handle recurring transcription mistakes in certain STT engines.\n- **Shortcut Commands**: Simplify complex commands with shorter phrases or slang.\n\nLet us know how you're using this plugin, and feel free to contribute regex examples to this README or new use cases! 🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvoiceos%2Fovos-utterance-corrections-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenvoiceos%2Fovos-utterance-corrections-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvoiceos%2Fovos-utterance-corrections-plugin/lists"}