Repository navigation
Name speakers from what was said, with the notes model. - #98
Open
adavila0703 wants to merge 1 commit into
Open
adavila0703 wants to merge 1 commit into
adavila0703 wants to merge 1 commit into
Conversation
- Before the summary a labeled recording owes, the summaries writer reads the transcript with
unnamed voices as "Speaker A", "Speaker B" and says who is who ("Hi, I'm Maya", or being
spoken to by name), citing the line that shows it. Only with summaries on; never starts the
local model's download; a failure is logged and the summary still follows.
- Each name is a guess: the speaker shows as likely and the picker asks "Is this Maya?", playing
the line that names them. A saved person is matched by name; a new one is saved, with their
voice, only on yes. A named speaker or a sure voice is never renamed.
- The answer is checked against what the model was shown: known labels, real lines that say
the name, one name per speaker. A name the cited line doesn't say is dropped (a small model
filled empty slots with the prompt's example name).
- Local runtimes get the answer schema with at least one entry: under a grammar that allows
[], Qwen 2.5 3B returned [] every time.
- New speaker field `introduced` ({ name, lineId } | null), defaulting to null for older files.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After a recording is labeled, and before its summary is written, the notes model works out who the unnamed speakers are from the transcript itself. It looks for people introducing themselves ("Hi, I'm Maya") or being spoken to by name and answering. This means the summary already has the names.
How it works
NotesWriter.speakers(transcript)call, implemented for the AI SDK, Ollama and on-device writers, plus the fake writer used in tests. Liketitle, it's one short structured call.[n] Label: textlines. Unnamed voices show as "Speaker A", "Speaker B", so a weak voice guess doesn't lead it. Named speakers keep their names. It answers with{ label, name, line }.writeOwed, through a newbeforeSummarydependency, with the writer chosen for summaries. That means:speakerNames.ts(pure, unit-tested) builds what the model sees, checks its answer and applies it:introduced: { name, lineId } | null. It defaults tonull, so older session files read fine. Naming a speaker, or a new labeling pass, resets it.Two things a reviewer should know
minItems: 1(SpeakersGrammar). When the grammar allows[], Qwen 2.5 3B closed the list immediately every time. Unconstrained, it named both speakers correctly. The prompt asks for one entry per label, with an empty name when none is said, and those are dropped. Hosted providers keep the plain schema, because their strict structured output rejectsminItems.Verified
pnpm checksteps all pass: typecheck (node and web), lint, the config-docs check, and 656 unit tests.ui-smoke: ok, with a new case: the adapter parses the answer, andwriteOwednames speakers before the summary without renaming one the user named.smoke:meeting --notes localwith the on-device model:test-audio/meeting.wav, no introductionseval:calls --quickgives WER 1.8%, cpWER 15.2%, DER 10.0%. No eval scenario contains an introduction, and naming never moves lines between speakers, so these scores are unchanged.eval:sessionsdidn't run, because ffmpeg isn't installed on this machine.Not covered
Checks
pnpm typecheck.changeset/speaker-introductions.md)pnpm smoke/pnpm smoke:ui(if this touches native, IPC, or pages):smoke:uipasses