-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from OpenVoiceOS/release-0.1.0a1
Release 0.1.0a1
- Loading branch information
Showing
10 changed files
with
365 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/requirements" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Run UnitTests | ||
on: | ||
pull_request: | ||
branches: | ||
- dev | ||
paths-ignore: | ||
- "ovos_utterance_corrections_transformer/version.py" | ||
- "examples/**" | ||
- ".github/**" | ||
- ".gitignore" | ||
- "LICENSE" | ||
- "CHANGELOG.md" | ||
- "MANIFEST.in" | ||
- "README.md" | ||
- "scripts/**" | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- "ovos_utterance_corrections_transformer/version.py" | ||
- "requirements/**" | ||
- "examples/**" | ||
- ".github/**" | ||
- ".gitignore" | ||
- "LICENSE" | ||
- "CHANGELOG.md" | ||
- "MANIFEST.in" | ||
- "README.md" | ||
- "scripts/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
unit_tests: | ||
strategy: | ||
max-parallel: 2 | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
- name: Install System Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt install python3-dev swig libssl-dev | ||
python -m pip install build wheel | ||
- name: Install core repo | ||
run: | | ||
pip install . | ||
- name: Install test dependencies | ||
run: | | ||
pip install -r tests/requirements.txt | ||
- name: Run unittests | ||
run: | | ||
pytest --cov=ovos_utterance_corrections_transformer --cov-report xml tests | ||
# NOTE: additional pytest invocations should also add the --cov-append flag | ||
# or they will overwrite previous invocations' coverage reports | ||
# (for an example, see OVOS Skill Manager's workflow) | ||
- name: Upload coverage | ||
env: | ||
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} | ||
uses: codecov/codecov-action@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,106 @@ | ||
# Utterance Corrections plugin | ||
|
||
- "secret speech", map some random utterance to something else so you can furtively give orders to your assistant | ||
- shortcuts, map shorter utterances or slang to utterances you know trigger the correct intent | ||
- manually correct bad STT transcriptions you experimentally determined to be common for you | ||
This plugin provides tools to correct or adjust speech-to-text (STT) outputs for better intent matching or improved user experience. | ||
|
||
This plugin checks a user defined json for utterance fixes `~/.local/share/mycroft/corrections.json` | ||
### Key Features: | ||
1. **"Secret Speech"**: Map random utterances to something else so you can furtively give orders to your assistant. | ||
2. **Shortcuts**: Map shorter utterances or slang to known utterances that trigger the correct intent. | ||
3. **Manual STT Fixes**: Correct common STT transcription errors you experimentally determined. | ||
|
||
fuzzy matching is used to determine if a utterance matches the transcription | ||
if >=0.85% similarity then the replacement is returned instead of the original transcription | ||
--- | ||
|
||
## 1. Full Utterance Corrections | ||
|
||
This plugin checks a user-defined JSON file for **utterance fixes** at `~/.local/share/mycroft/corrections.json`. | ||
|
||
**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. | ||
|
||
### Example: `corrections.json` | ||
```json | ||
{ | ||
"I hate open source": "I love open source", | ||
"do the thing": "trigger protocol 404" | ||
} | ||
``` | ||
|
||
you can also define unconditional replacements at word level `~/.local/share/mycroft/word_corrections.json` | ||
**Input**: | ||
`"I hat open source"` | ||
|
||
**Output**: | ||
`"I love open source"` | ||
|
||
--- | ||
|
||
## 2. Word-Level Corrections | ||
|
||
You can also define unconditional word-level replacements in `~/.local/share/mycroft/word_corrections.json`. | ||
|
||
This is particularly useful when STT models repeatedly transcribe specific names or words incorrectly. | ||
|
||
for example whisper STT often gets artist names wrong, this allows you to correct them | ||
### Example: `word_corrections.json` | ||
```json | ||
{ | ||
"Jimmy Hendricks": "Jimi Hendrix", | ||
"Eric Klapptern": "Eric Clapton", | ||
"Eric Klappton": "Eric Clapton" | ||
} | ||
``` | ||
``` | ||
|
||
**Input**: | ||
`"I love Jimmy Hendricks"` | ||
|
||
**Output**: | ||
`"I love Jimi Hendrix"` | ||
|
||
|
||
> **use case**: whisper STT often does this mistake in it's transcriptions | ||
--- | ||
|
||
## 3. Regex-Based Corrections | ||
|
||
For more complex corrections, you can use **regular expressions** in `~/.local/share/mycroft/regex_corrections.json`. | ||
|
||
This is useful for fixing consistent patterns in STT errors, such as replacing incorrect trigraphs. | ||
|
||
### Example: `regex_corrections.json` | ||
```json | ||
{ | ||
"\\bsh(\\w*)": "sch\\1" | ||
} | ||
``` | ||
|
||
### Explanation: | ||
- **`\\bsh(\\w*)`**: Matches words starting with `sh` at a word boundary. | ||
- **`sch\\1`**: Replaces `sh` with `sch` and appends the rest of the word. | ||
|
||
### Example Usage: | ||
**Input**: | ||
`"shalter is a switch"` | ||
|
||
**Output**: | ||
`"schalter is a switch"` | ||
|
||
> **use case**: citrinet german model often does this mistake in it's transcriptions | ||
--- | ||
|
||
## Configuration Paths | ||
|
||
| File | Purpose | | ||
|---------------------------|---------------------------------------| | ||
| `corrections.json` | Full utterance replacements. | | ||
| `word_corrections.json` | Word-level replacements. | | ||
| `regex_corrections.json` | Regex-based pattern replacements. | | ||
|
||
All correction files are stored under: | ||
`~/.local/share/mycroft/` | ||
|
||
--- | ||
|
||
### Usage Scenarios | ||
- **Improve Intent Matching**: Ensure consistent STT output for accurate intent triggers. | ||
- **Fix Model-Specific Errors**: Handle recurring transcription mistakes in certain STT engines. | ||
- **Shortcut Commands**: Simplify complex commands with shorter phrases or slang. | ||
|
||
Let us know how you're using this plugin, and feel free to contribute regex examples to this README or new use cases! 🚀 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# START_VERSION_BLOCK | ||
VERSION_MAJOR = 0 | ||
VERSION_MINOR = 0 | ||
VERSION_BUILD = 2 | ||
VERSION_ALPHA = 0 | ||
VERSION_MINOR = 1 | ||
VERSION_BUILD = 0 | ||
VERSION_ALPHA = 1 | ||
# END_VERSION_BLOCK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ovos-plugin-manager>=0.0.1,<1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
coveralls==1.8.2 | ||
flake8==3.7.9 | ||
pytest==8.2.2 | ||
pytest-cov==2.8.1 | ||
cov-core==1.15.0 | ||
ovos-plugin-manager |
Oops, something went wrong.