Namo Turn Detector v1 Korean

提供商videosdk-live
分类voice-activity-detection
许可证apache-2.0
下载量294.4K
星标0

简介

Namo Turn Detector v1 是一款专门针对韩语优化的语音端点检测(VAD)模型。对于开发实时语音交互、AI 助手或会议系统的开发者来说,它解决了对话中最棘手的“抢话”或“响应延迟”问题,能精准识别韩语说话者的停顿与结束点。该模型上手难度低,可无缝集成到基于 VideoSDK 的实时音视频流中,替代传统的基于静音时长判断的简单方案,让 AI 的接话时机更像真人,提升韩语场景下的交互自然度。

核心亮点

  • 专为韩语优化,精准识别对话停顿与结束
  • 降低 AI 响应延迟,避免尴尬的抢话现象
  • 适配实时音视频流,适合构建韩语 AI 助手
  • Apache-2.0 开源协议,集成部署灵活便捷

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer

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

Hugging Face 下载

我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 huggingface_hub:

操作指引
pip install -U huggingface_hub

命令行下载

下载完整模型库

下载完整模型库
huggingface-cli download videosdk-live/Namo-Turn-Detector-v1-Korean

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download videosdk-live/Namo-Turn-Detector-v1-Korean config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

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

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/videosdk-live/Namo-Turn-Detector-v1-Korean

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/videosdk-live/Namo-Turn-Detector-v1-Korean

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 Transformers

安装 Transformers
pip install -U transformers torch

模型加载和推理

模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer

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

完整文档

来源: HuggingFace

---
language: ko
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

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

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

results:
- task:
type: text-classification
name: Turn Detection
dataset:
name: Namo Turn Detector v1 Test - Korean
type: videosdk-live/Namo-Turn-Detector-v1-Test
split: train
metrics:
- type: accuracy
value: 0.973034
name: Accuracy
- type: f1
value: 0.973214
name: F1 Score
- type: precision
value: 0.964602
name: Precision
- type: recall
value: 0.981982
name: Recall
---

🎯 Namo Turn Detector v1 - Korean

<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-Korean)
![Inference Speed]()

🚀 Namo Turn Detection Model for Korean

</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 Korean-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 Korean speech transcripts.
  • Low Latency: Optimized with quantized ONNX for <14ms inference.
  • Robust Performance: 97.3% accuracy on diverse Korean 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 | 97.30% |
| 📈 F1-Score | 97.32% |
| 🎪 Precision | 96.46% |
| 🎭 Recall | 98.19% |
| ⚡ Latency | <14ms |
| 💾 Model Size | ~135MB |

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

> 📊 *Evaluated on 800+ Korean utterances from diverse conversational contexts*

⚡️ Speed Analysis

<img src="./performance_analysis.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-Korean"):
"""
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 = [ "교남동은 종로구 내에서 상대적으로 보수세가 강한 지역으로 분류된다.", # Expected: End of Turn "1937년 중화민국과 소련이 중소불가침조약을 체결하다 그래서", # 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="ko")

Initialize Korean turn detector for VideoSDK Agents

turn_detector = NamoTurnDetectorV1(language="ko")

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

📖 Citation

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

📄 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>