Namo Turn Detector v1 English

Providervideosdk-live
Categoryvoice-activity-detection
Licenseapache-2.0
Downloads2.6K
Stars0

Overview

Namo Turn Detector v1 is a specialized Voice Activity Detection (VAD) model designed to solve the 'interruption problem' in real-time conversational AI. Unlike general speech-to-text engines, this model focuses specifically on turn-taking logic—identifying the precise moment a user has finished speaking versus a natural pause. For developers building voice bots or live streaming applications, this means significantly lower perceived latency and fewer awkward overlaps. It integrates easily into audio pipelines via the videosdk-live provider and is released under the permissive Apache-2.0 license, making it suitable for both rapid prototyping and commercial production environments.

Highlights

  • Optimized for real-time conversational turn-taking detection
  • Reduces latency in voice-interactive AI applications
  • Permissive Apache-2.0 license for commercial deployment
  • Specialized VAD focused on natural speech cadence

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("videosdk-live/Namo-Turn-Detector-v1-English")
tokenizer = AutoTokenizer.from_pretrained("videosdk-live/Namo-Turn-Detector-v1-English")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download videosdk-live/Namo-Turn-Detector-v1-English

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download videosdk-live/Namo-Turn-Detector-v1-English config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('videosdk-live/Namo-Turn-Detector-v1-English')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/videosdk-live/Namo-Turn-Detector-v1-English

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/videosdk-live/Namo-Turn-Detector-v1-English

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('videosdk-live/Namo-Turn-Detector-v1-English')
tokenizer = AutoTokenizer.from_pretrained('videosdk-live/Namo-Turn-Detector-v1-English')

Full Documentation

来源: HuggingFace

---
language: en
license: apache-2.0
library_name: onnxruntime
pipeline_tag: voice-activity-detection
tags:

  • turn-detection

  • end-of-utterance

  • distilbert

  • onnx

  • quantized

  • conversational-ai

  • voice-assistant

  • real-time

  • voice-activity-detection

base_model: distilbert-base-multilingual-cased
datasets:
  • videosdk-live/Namo-Turn-Detector-v1-Train

model-index:
  • name: Namo Turn Detector v1 - English

results:
- task:
type: text-classification
name: Turn Detection
dataset:
name: Namo Turn Detector v1 Test - English
type: videosdk-live/Namo-Turn-Detector-v1-Test
split: train
metrics:
- type: accuracy
value: 0.91494
name: Accuracy
- type: f1
value: 0.91473
name: F1 Score
- type: precision
value: 0.87525
name: Precision
- type: recall
value: 0.95793
name: Recall
---

🎯 Namo Turn Detector v1 - English

<div align="center">

![License](https://opensource.org/licenses/Apache-2.0)
![ONNX](https://onnx.ai/)
![Model Size](https://huggingface.co/videosdk-live/Namo-Turn-Detector-v1-English)
![Inference Speed]()

🚀 Namo Turn Detection Model for ENGLISH

</div>

---

📋 Overview

The Namo Turn Detector is a specialized AI model designed to solve one of the most challenging problems in conversational AI: knowing when a user has finished speaking.

This English-specialist model uses advanced natural language understanding to distinguish between:

  • Complete utterances (user is done speaking)

  • 🔄 Incomplete utterances (user will continue speaking)

Built on DistilBERT architecture and optimized with quantized ONNX format, it delivers enterprise-grade performance with minimal latency.

🔑 Key Features

  • Turn Detection Specialist: Detects end-of-turn vs. continuation in English speech transcripts.
  • Low Latency: Optimized with quantized ONNX for <11ms inference.
  • Robust Performance: 91.5% accuracy on diverse English utterances.
  • Easy Integration: Compatible with Python, ONNX Runtime, and VideoSDK Agents SDK.
  • Enterprise Ready: Supports real-time conversational AI and voice assistants.

📊 Performance Metrics

<div>

| Metric | Score |
|--------|-------|
| 🎯 Accuracy | 91.49% |
| 📈 F1-Score | 91.47% |
| 🎪 Precision | 87.52% |
| 🎭 Recall | 95.79% |
| ⚡ Latency | <11ms |
| 💾 Model Size | ~135MB |

</div>
<img src="./confusion_matrices_en.png" alt="Alt text" width="600" height="400"/>

> 📊 *Evaluated on 10,000+ English utterances from diverse conversational contexts*

⚡️ Speed Analysis

<img src="./performance_analysis_en.png" alt="Alt text" width="600" height="400"/>

🔧 Train & Test Scripts

<div align="center">

![Train Script](https://colab.research.google.com/drive/1DqSUYfcya0r2iAEZB9fS4mfrennubduV) ![Test Script](https://colab.research.google.com/drive/19ZOlNoHS2WLX2V4r5r492tsCUnYLXnQR)

</div>

🛠️ Installation

To use this model, you will need to install the following libraries.

bash
pip install onnxruntime transformers huggingface_hub

🚀 Quick Start

You can run inference directly from Hugging Face repository.

python
import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer
from huggingface_hub import hf_hub_download

class TurnDetector:
def __init__(self, repo_id="videosdk-live/Namo-Turn-Detector-v1-English"):
"""
Initializes the detector by downloading the model and tokenizer
from the Hugging Face Hub.
"""
print(f"Loading model from repo: {repo_id}")

# Download the model and tokenizer from the Hub
# Authentication is handled automatically if you are logged in
model_path = hf_hub_download(repo_id=repo_id, filename="model_quant.onnx")
self.tokenizer = AutoTokenizer.from_pretrained(repo_id)

# Set up the ONNX Runtime inference session
self.session = ort.InferenceSession(model_path)
self.max_length = 512
print("✅ Model and tokenizer loaded successfully.")

def predict(self, text: str) -> tuple:
"""
Predicts if a given text utterance is the end of a turn.
Returns (predicted_label, confidence) where:
- predicted_label: 0 for "Not End of Turn", 1 for "End of Turn"
- confidence: confidence score between 0 and 1
"""
# Tokenize the input text
inputs = self.tokenizer(
text,
truncation=True,
max_length=self.max_length,
return_tensors="np"
)

# Prepare the feed dictionary for the ONNX model
feed_dict = {
"input_ids": inputs["input_ids"],
"attention_mask": inputs["attention_mask"]
}

# Run inference
outputs = self.session.run(None, feed_dict)
logits = outputs[0]

probabilities = self._softmax(logits[0])
predicted_label = np.argmax(probabilities)
confidence = float(np.max(probabilities))

return predicted_label, confidence

def _softmax(self, x, axis=None):
if axis is None:
axis = -1
exp_x = np.exp(x - np.max(x, axis=axis, keepdims=True))
return exp_x / np.sum(exp_x, axis=axis, keepdims=True)

--- Example Usage ---

if __name__ == "__main__": detector = TurnDetector() sentences = [ "so that's all I have for today", # Expected: End of Turn "I think the next logical step is to", # Expected: Not End of Turn "and that's my final point.", # Expected: End of Turn "what do you think about the", # Expected: Not End of Turn ] for sentence in sentences: predicted_label, confidence = detector.predict(sentence) result = "End of Turn" if predicted_label == 1 else "Not End of Turn" print(f"'{sentence}' -> {result} (confidence: {confidence:.3f})") print("-" * 50)

🤖 VideoSDK Agents Integration

Integrate this turn detector directly with VideoSDK Agents for production-ready conversational AI applications.

python
from videosdk_agents import NamoTurnDetectorV1, pre_download_namo_turn_v1_model

#download model
pre_download_namo_turn_v1_model(language="en")

Initialize English turn detector for VideoSDK Agents

turn_detector = NamoTurnDetectorV1(language="en")

> 📚 Complete Integration Guide - Learn how to use NamoTurnDetectorV1 with VideoSDK Agents

📖 Citation

bibtex
@model{namo_turn_detector_en_2025,
  title={Namo Turn Detector v1: English},
  author={VideoSDK Team},
  year={2025},
  publisher={Hugging Face},
  url={https://huggingface.co/videosdk-live/Namo-Turn-Detector-v1-English},
  note={ONNX-optimized DistilBERT for turn detection in English}
}

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

<div align="center">

Made with ❤️ by the VideoSDK Team

![VideoSDK](https://videosdk.live)

</div>

Join our Telegram