Feat: transcription confidence filter#1148
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the transcription module by introducing a confidence-based filtering mechanism. It allows users to automatically discard transcription segments that fall below a specified confidence threshold, aiming to reduce inaccuracies and "hallucinations" often associated with AI-powered speech-to-text models like Whisper, especially when dealing with background noise. The feature is exposed through a new setting in the user interface, providing greater control over transcription quality. Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to filter out low-confidence transcription segments, which is a great addition to improve transcription quality. A new UI slider allows users to configure the confidence threshold. The implementation is mostly solid, with new tests for the filtering logic. I've identified a bug in the logic that determines when to apply the filter, causing it to be inactive for a portion of the slider's range, and have provided a suggestion to fix this issue.
Description
Filter out low-confidence transcription segments based on
avg_logprobto reduce Whisper hallucinations caused by background noise passing through VAD.A new Confidence Threshold slider is added to Settings → Modules → Hearing.
Only effective for providers supporting the Whisper API (e.g., OpenAI, Groq). Streaming transcription (Aliyun NLS, Web Speech API) is not affected.
Also fixes FieldRange, || to ??
Linked Issues
Fixes #871
Additional Context
Filtering is segment-level, not result-level