Skip to content

Feat: transcription confidence filter#1148

Open
Reisenbug wants to merge 7 commits intomoeru-ai:mainfrom
Reisenbug:feat/transcription-confidence-filter
Open

Feat: transcription confidence filter#1148
Reisenbug wants to merge 7 commits intomoeru-ai:mainfrom
Reisenbug:feat/transcription-confidence-filter

Conversation

@Reisenbug
Copy link

@Reisenbug Reisenbug commented Mar 5, 2026

Description

Filter out low-confidence transcription segments based on avg_logprob to 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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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

  • New Confidence Threshold Setting: Introduced a new user-configurable confidenceThreshold setting to filter out low-confidence transcription segments.
  • Transcription Filtering Logic: Implemented a filterTranscriptionByConfidence utility function to process and clean transcription results based on the configured threshold.
  • Whisper API Integration: Integrated the confidence filtering logic into the transcription process for Whisper API-compatible providers, utilizing verbose_json response format when filtering is active.
  • User Interface Update: Added a dedicated UI slider in the Hearing settings page for users to adjust the transcription confidence threshold.
  • Unit Tests: Included unit tests for the new filterTranscriptionByConfidence utility to ensure its correctness.
Changelog
  • packages/stage-pages/src/pages/settings/modules/hearing.vue
    • Added confidenceThreshold to the store references.
    • Introduced a new UI section with a FieldRange component for adjusting the confidence threshold.
  • packages/stage-ui/src/stores/modules/hearing.test.ts
    • Added a new test file containing unit tests for the filterTranscriptionByConfidence function.
  • packages/stage-ui/src/stores/modules/hearing.ts
    • Defined and exported the filterTranscriptionByConfidence utility function.
    • Added confidenceThreshold as a useLocalStorageManualReset variable with a default value.
    • Included confidenceThreshold in the reset function.
    • Modified the transcription action to conditionally request verbose_json format and apply filterTranscriptionByConfidence to the results based on the confidenceThreshold.
    • Exported confidenceThreshold in the store's return object.
Ignored Files
  • Ignored by pattern: packages/i18n/src/** (3)
    • packages/i18n/src/locales/en/settings.yaml
    • packages/i18n/src/locales/zh-Hans/settings.yaml
    • packages/i18n/src/locales/zh-Hant/settings.yaml
Activity
  • No human activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Reisenbug Reisenbug changed the title Feat/transcription confidence filter Feat: transcription confidence filter Mar 6, 2026
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.

feature request: Disregard transcription with low confidence

1 participant