Skip to content

Conversation

@2mawi2
Copy link

@2mawi2 2mawi2 commented Jul 16, 2025

Summary

This PR adds a keyword enhancement feature that improves Whisper transcription accuracy by injecting custom vocabulary into API prompts.

Key Features

  • Custom vocabulary injection: Users can define keywords that get added to Whisper prompts as "Expected vocabulary"
  • Settings integration: Toggle switch to enable/disable feature + text input for comma-separated keywords
  • API compatibility: Works with both OpenAI and Groq Whisper endpoints
  • Default keywords: Includes common technical terms (JavaScript, Python, Android, API, OpenAI, Whisper)

Technical Implementation

  • Implements buildEnhancedPrompt() method in DictateInputMethodService.java
  • Follows OpenAI Whisper documentation for vocabulary guidance
  • Enhances existing prompt injection mechanism without breaking changes
  • Uses SharedPreferences for simple, lightweight storage

Use Cases

  • Improved transcription of technical terms (PostgreSQL, Kubernetes, TypeScript)
  • Better recognition of proper names and domain-specific vocabulary
  • Enhanced accuracy for professional/specialized content

Settings

  • Toggle: "Keyword enhancement 🔤" (enabled by default)
  • Input: "Custom keywords" text field for comma-separated list
  • Dependencies: Keyword input only enabled when toggle is on

🤖 Generated with Claude Code

- Implement buildEnhancedPrompt() method to inject custom vocabulary into Whisper API prompts
- Add keyword enhancement toggle switch in settings (enabled by default)
- Add custom keywords text input field for comma-separated vocabulary list
- Default keywords: JavaScript, Python, Android, API, OpenAI, Whisper
- Works with both OpenAI and Groq Whisper API endpoints
- Follows OpenAI Whisper documentation for vocabulary guidance
- Improves transcription accuracy for technical terms and proper names

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@2mawi2
Copy link
Author

2mawi2 commented Jul 16, 2025

I tested this locally and it works quite fine. I find this very useful in other speech-detect tools on macOS. So I think it would be a great addition for your app here. The default keywords Claude added are probably debatable.

@Hyroniem
Copy link

Hyroniem commented Dec 8, 2025

This would be a very useful feature indeed

@pjmuller
Copy link

Plus one, all major speech to text apps have this feature

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.

4 participants