smart-turn-uz: end-of-turn detection for Uzbek and Russian phone calls

The caller has paused. Did they finish, or will they go on? Silence alone can't tell: on calls handled by live operators, a third of the pauses longer than 0.55 s belong to callers who keep talking. This model listens to how the phrase ended and returns the probability that the turn is over.

It is Smart Turn v3.2 (Whisper tiny encoder plus a classifier, 8M parameters) fine-tuned on telephone conversations in Uzbek and Russian, including mixed speech. It runs in production in a voice agent on a single CPU thread.

Files

file what it is
smart-turn-uz.onnx the whole pipeline in one graph: log-mel features are computed inside. Input audio, float32 [batch, 128000] (8 s at 16 kHz). Output probability, [batch]
smart-turn-uz.pt PyTorch state_dict for SmartTurn in smart_turn.py, for further fine-tuning. Outputs a logit
smart_turn.py the model definition and the Whisper feature extraction it expects

Usage

import numpy as np
import onnxruntime

session = onnxruntime.InferenceSession("smart-turn-uz.onnx", providers=["CPUExecutionProvider"])

def end_of_turn(audio: np.ndarray) -> float:
    """audio: mono float32 in [-1, 1] at 16 kHz, the caller's speech up to the pause."""
    size = 8 * 16000
    audio = audio[-size:] if len(audio) >= size else np.pad(audio, (size - len(audio), 0))
    return float(session.run(None, {"audio": audio[None, :].astype(np.float32)})[0][0])

Feed only the caller's channel, the last 8 seconds, padded with zeros on the left. Phone audio at 8 kHz should be resampled to 16 kHz. The model was trained on narrowband telephone speech, so audio from a browser or a wideband microphone is best low-passed to the telephone band first.

The PyTorch weights:

import torch
from smart_turn import SmartTurn, features, to_features

model = SmartTurn()
model.load_state_dict(torch.load("smart-turn-uz.pt", map_location="cpu"))
model.eval()
with torch.no_grad():
    probability = torch.sigmoid(model(torch.from_numpy(to_features(features(), [audio]))))

How it is used in the agent

A prediction is made after 200 ms of caller silence. If the probability is at least 0.7, the agent answers after a short delay. Otherwise it waits for a longer silence. The audio buffer starts at the previous committed end of turn, so while the agent speaks the caller's track holds quiet line noise. The model was trained on clips cut the same way, and they almost always fill the full 8 seconds.

Training

Labels come from what a live operator did at every caller pause of at least 0.2 s:

  • end: the operator took the floor;
  • continue: the caller went on and the operator kept silent.

Pauses where the operator said something short and the caller went on (backchannels) were left out. So were continuations after pauses longer than 1.5 s, where the caller was probably waiting for an answer that didn't come. Calls are split into train, validation and test by a hash of the call, so clips from one call never land in different splits.

Fine-tuning: about 38k clean decision points, 3 epochs, lr 3e-5, best checkpoint by validation AUC.

Results

On held-out test calls (about 5k decision points):

model AUC
Smart Turn v3.2, as released 0.637
smart-turn-uz 0.822

In conversation terms, with 1.0 s of pipeline latency (recognition, LLM, synthesis), how often the agent talks over a caller who hasn't finished, per minute of caller speech, and how fast it answers one who has (numbers from v1, which has the same AUC on its own clips):

rule answer to a finished caller collisions per minute
silence 0.55 s 1.55 s 1.41
silence 0.90 s 1.90 s 0.92
model, threshold 0.7, otherwise 0.9 s median 1.20 s, mean 1.53 s 1.14
model, threshold 0.7, otherwise 1.5 s median 1.20 s, mean 1.82 s 0.82

A live operator answers a finished caller with a median of 1.02 s.

The ONNX export matches PyTorch to within 2e-6 in probability and takes about 100 ms on one CPU thread. An int8 version is about twice as fast with almost the same AUC (0.819), but it flips the decision on 6–8% of points at thresholds 0.5–0.7, so it isn't published.

Limitations

  • Trained on telephone calls only. Expect weaker results on wideband audio or other domains.
  • Labels come from operator behavior, which is noisy for long pauses: a caller may have been waiting for an answer the operator didn't give.
  • Backchannels ("ha", "ΡƒΠ³Ρƒ") aren't modeled. The model answers only "finished or not".

License

BSD 2-Clause, like the base model. See LICENSE.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for gurinbaev/smart-turn-uz

Quantized
(12)
this model
Quantizations
1 model