8000 feat(transcribe): keep how sure transcription was of each word, and mark the unsure ones by adeelahmad · Pull Request #681 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(transcribe): keep how sure transcription was of each word, and mark the unsure ones - #681

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: Whisper, Deepgram, AssemblyAI and ElevenLabs said how sure they were of each word, but Lens dropped it, so nothing pointed at the words worth checking.

After: Lens keeps each word's confidence with its timing. In the transcript, a word below the threshold gets a dotted gold underline and a tooltip ("Transcription wasn't sure of this word (42%)"), and correcting it takes the mark away. Settings → Transcription → "Mark words it was less sure of than" sets the threshold (transcribe.confidence_highlight, 0.6 by default; 0 marks none). GET …/player gives each word's confidence as a fifth item in w and the threshold as unsure_below, and the MCP tool get_transcript lists each line's unsure words. Transcripts made before, and those from SenseVoice and OpenAI's own API, which don't give a confidence, have no marks and work as before.

How: speech.py reads each provider's word confidence, transcript.py and ingest.py store it as the word's fifth field, and audio_cleanup.remap keeps it when times are remapped. The web app's model.ts and turn.tsx mark the unsure words.

Motivation and Context

Item from the personal feature plan sheet (show low-confidence words).

Screenshots (if appropriate):

n/a

Steps to reproduce (if appropriate):

Transcribe a recording with Deepgram, then open its transcript: words it was less than 60% sure of are underlined, with the percentage on hover.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (tests/domain/test_speech.py, tests/api/test_split_merge.py, tests/domain/test_audio_cleanup.py, tests/api/test_mcp.py, __tests__/recording-unsure-words.test.tsx, __tests__/recording-split-words.test.ts).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/processing.md, Words transcription wasn't sure of; docs/api.md; docs/mcp.md).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/word-confidence.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. unsure words in get_transcript, confidences in /player.
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. The marks show on their own; correcting a word in place clears its mark.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. transcribe.confidence_highlight in Settings → Transcription, default 0.6, not in the wizard.
  • Light: default install still runs on a Raspberry Pi with cloud models.
  • Private and secure: data local and encrypted, passkeys, threat model updated. n/a: no new surface; the confidence comes with words already stored.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. n/a: no new model calls; the providers already send it.
  • User decides: consequential or new actions wait for the user; defaults unchanged. Only adds marks; nothing is changed for the user.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). Words stored before have four fields and still load, with no marks.
  • Honest: sources cited; labelled built, in progress or planned. README built list and docs/requirements.md name the checks.
  • Tests, docs and generated files updated (make openapi).
  • Open standards; dependencies keep Lens MIT. n/a: no dependencies.
  • Result reported with evidence; "refine later" items written down.
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented.

Local CI (ci/local-ci.sh): FastAPI embedded, FastAPI server, Next.js, pre-commit and PR title all passed.


Generated by Claude Code

…ark the unsure ones

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
@adeelahmad adeelahmad self-assigned this Oct 19, 2026
@adeelahmad
adeelahmad merged commit 0505423 into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 19, 2026 09:29
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.

2 participants

0