Skip to content

Add vocabs.txt, a list of words to spell as listed - #28

Open
nigelgilbert wants to merge 13 commits into
mainfrom
feature/vocab
Open

nigelgilbert wants to merge 13 commits into
mainfrom
feature/vocab

Conversation

@nigelgilbert

Copy link
Copy Markdown
Owner

What this does

A new file, vocabs.txt in the Kiku Flow folder, lists one term per line. The sidecar reads it at load.

  • Spelling: a whole-word match in any case comes out spelled as listed ("claude" becomes "Claude"), before the on_transcribed hooks run. Works with either engine.
  • Whisper hint: with [stt] engine = "whisper", the terms also go to the model as its initial_prompt.
  • Menu: "Open Vocabulary" (⌘V), below "Open Config". It creates the file if missing.
  • Measurement script: sidecar/scripts/word_confidence.py prints each word Parakeet heard with its confidence.
  • Docs: a "Your vocabulary" section in docs/customization.md, and updates to docs/hooks.md, README.md and sidecar/README.md.

The reply's raw field stays what speech recognition heard, before the vocabulary.

What this does not do

It does not yet fix a word Parakeet hears as a different word, such as "Mac" heard as "map". That is step 3 of docs/vocabulary-plan.md, and it waits on step 1's measurements: recordings run through word_confidence.py, to see whether Parakeet's confidence separates a misheard word from a real one.

Open questions

  • Whisper and silence. With a vocabulary, whisper-tiny turned one and three seconds of silence into invented text, which would be pasted. The default whisper-large-v3-turbo is untested. The docs carry a caveat; there is no code guard.
  • ⌘V. The app pastes by posting its own ⌘V. If the menu is open when a dictation's reply arrives, that keystroke may open vocabs.txt. This is reasoned from AppKit behaviour and not run. That paste was already lost in this state before the branch.
  • The script. The plan calls word_confidence.py throwaway. It is committed so step 1 can be run; drop it if it should not live in the repo.

Review

One factory review: 19 candidates, 13 kept, 10 folded in. The full list is in docs/factory-report-feature-vocab-1.md.

Tests

  • uv run pytest -q in sidecar/: 142 passed (117 on main).
  • uv run pyright, uv run ruff check, uv run ruff format --check: clean.
  • app/test.sh: 19 passed (18 on main).

Not tested: the menu item in the running app, and the Whisper hint on the default model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant