veden.

Dakar → Paris, on the whiteboard · episode 6 of 10

Home

6Dakar → Paris, on the whiteboard · episode 6 of 10

Who is speaking, and what is said?

To write “Nico suggests setting off again at dawn, Flamby refuses”, you need to know who is speaking. But the audio of a livestreamed trip is a cheerful mess: several voices talking over each other, strangers, a driver, music, wind.

A wrong name is worse than no name: the travel log would put words in someone's mouth. So our machine has to write what is said, know who says it, and dare to answer “I don't know”.

A transcription model returns text, not people. To get “who said what”, you need three specialised models and a calculation step that compares each voice with reference voices, with the right to answer “unknown”.

This episode details the audio chain: diarisation, word-level timestamped transcription, voice embeddings, attribution by cosine similarity, and the adjustments we had to add in production.

Independent Veden project, not affiliated with Nico, Ascend or their partners.

Dennys Salioski · 9 min

Move forward with the arrow → or the Next button. “Discovery / Technical”, at the top, changes the level of the text; “Listen” reads it aloud.

6Three models

Three questions, three models

No single model can do everything. The first listens and spots when each voice speaks, without knowing who it belongs to: it says “voice 0”, “voice 1”. The second writes down what is said, word by word, without knowing who is speaking.

The third boils a voice down to a kind of voiceprint, which makes it possible to recognise it. By combining the three, we finally get: who said what, and when.

Diarisation (Nemotron 3 Diarization): for every 10 ms frame, the probability that each voice is speaking, numbered in order of arrival. Transcription (Parakeet TDT 0.6B v3, via NeMo): words with their start and end times. Voice embedding (TitaNet Large): one vector per voice, close together for the same person.

The rest is numpy arithmetic: each word is attached to the most probable local voice over its duration, then each local voice to a name. A word with no sufficiently probable voice is left without a speaker rather than being given one at random.

6The numbers

“Voice 0” changes every ten minutes

The model that spots the voices numbers them in the order they arrive. In one ten-minute piece, voice 0 is Nico; in the next, it may be Flamby.

So the numbers are useless from one piece to the next. It is each voice's voiceprint, compared with known voices, that lets us attach the right name.

The diarisation labels are local: the model numbers voices in order of arrival, segment by segment. “Voice 0” in one segment has no reason to be the same person as in the next.

The voice embedding provides the link: for each local voice that speaks for at least 3 seconds, we compute a vector from its passages, and that vector is what we compare with the reference voices. The name comes from that comparison, never from the number.

6Known voices

Five reference voices, checked by ear

To recognise a voice, you must have heard it before. So we built a small library of voices: extracts where each person speaks alone, listened to one by one and filed in the right person's folder.

Nico, Byilhan, Flamby, a camera operator and the team's supervisor. This is the main point where a human steps in, and it sets the quality of everything else. The machine then fills out each voice with passages it is almost certain about.

A script extracts, for each detected voice, the passages where it speaks alone: at least 2 seconds with no overlap, about 40 seconds per voice. They are listened to, filed by person, or thrown away.

For each person, the normalised mean of their embeddings gives a centroid. A single embedding would be fragile: people don't sound the same when tired, shouting or in a car. Five centroids: Nico, Byilhan, Flamby, a camera operator and the supervisor. They are then enriched automatically, up to 40 passages per person, with voices recognised without ambiguity (a similarity of at least 0.72 and a lead of 0.12); those passages are not listened to.

6A name or nothing

A name, or “unknown”

For each voice heard, we measure how closely it resembles each of the known voices. If it clearly resembles one of them, more than all the others, we give it that name.

Otherwise, it stays “unknown”. That is deliberate: a passer-by, a driver or a local met along the way has no sample, and it is better not to guess.

The resemblance is the cosine similarity between the voice's embedding and each centroid; since the vectors are normalised, it is a simple dot product. Two conditions to assign a name: a similarity of at least 0.45, and a lead of 0.05 over the second-closest person. Otherwise: “unknown”, numbered within the segment, which the language model treats as someone unidentified.

See the code: one voice, a name or nothing (simplified version, without the adjustments of step 6)
import numpy as np

SEUIL, MARGE = 0.45, 0.05

def attribuer(empreinte: np.ndarray, noms: list[str], centroides: np.ndarray) -> str:
    """centroides: one normalised row per person; empreinte: normalised vector."""
    scores = centroides @ empreinte                  # cosine similarity with each person
    ordre = np.argsort(scores)[::-1]
    premier, second = scores[ordre[0]], scores[ordre[1]]
    if premier >= SEUIL and premier - second >= MARGE:
        return noms[ordre[0]]
    return "inconnu"                                  # in production: inconnu_N, N = local voice

6The start of segments

Thirty seconds to settle in

The mistakes were concentrated at the very start of each ten-minute piece: the model had not yet heard enough to separate the voices properly.

The fix: before each piece, we let it listen to the last thirty seconds of the previous one. It arrives “warmed up” at the start of the piece that counts, and the words from those thirty seconds are dropped from the result.

The diarisation errors were not spread at random: they were concentrated at the start of segments. The fix: a pre-roll of the last 30 seconds of the previous segment, pasted in before diarisation.

It is added only if the previous segment is contiguous, its actual duration is stored with the output, and all the words that fall within it are dropped at transcription; the times of the others are shifted by the same amount. It stabilises diarisation without producing a single duplicate word.

6The adjustments

What the simple version could not handle

In practice, three adjustments were needed. We name the voices of one piece together, not one by one: if Nico is already recognised with certainty, the hesitant voice is probably someone else. This gave back about 50 minutes of speech to the first three days.

We accept that the same person is sometimes split into two voices. And we smooth out the changes of voice, which produced a lot of one-word replies.

Assign a segment's voices together, in decreasing order of confidence: a voice tied between two people, one of whom is already clearly recognised in the segment, goes to the other. Deciding voice by voice had lost about 50 minutes of attributed speech over days 1 to 3.

Split voice: a second local voice may receive a name that is already taken, if its similarity reaches 0.65. Smoothing: about 40% of turns were a single word. A word with no speaker takes its neighbour's if it is within 0.8 s; an island of at most two words, lasting under a second, between two passages by the same person, is attached to that person.

6The measurement

99.3% of quotes found word for word

How do we check that the transcription is faithful? Every quote published in the travel log must be found, word for word, in what the machine transcribed. That is true of 99.3% of them. The accuracy of the names is checked by ear, on extracts.

And because we keep everything the machine heard, we can correct a name or a setting without listening to it all again.

For each segment, we keep the raw words (text, times, local voice) and the embedding of each local voice. The names are recomputed from there, in numpy, without a GPU: adding a sample or changing a threshold no longer requires re-transcribing. The attribution rule was able to change several times during the livestream.

End-to-end measurement: 4,856 published quotes out of 4,892 are found word for word in the attributed transcript.

published quotes found word for word

99.3%

that is 4,856 out of 4,892.

6In summary

What to remember

  • Three audio models each answer one question: when, what, and whose voice it resembles.
  • Voices are recognised thanks to extracts that were listened to and validated by hand.
  • When in doubt, the machine answers “unknown” rather than guessing.
  • 99.3% of the travel log's quotes are found word for word in the transcript.
  • Diarisation, transcription and embeddings, then a numpy calculation: each building block answers a single question.
  • Local labels linked by cosine similarity to centroids validated by ear, with a threshold and a margin.
  • 30 s pre-roll, per-segment attribution, split voices and smoothing: the errors come from the boundaries.
  • Keep the intermediate outputs so you can reassign without a GPU.
Episode 7 of 10 The chat minute by minute, without artificial intelligence

More than 2.3 million messages, and simple statistics to spot the highlights.

Meetings or calls to transcribe, with names?

The same chain knows who said what in your recordings, locally if your data must not leave your premises. Write to me: we will look together at what is feasible.

Let's talk about your project