Tutorials3 min read
說話人分離標註
構建一個帶有音訊波形、時間戳標記和說話人標籤分配的說話人識別任務。
Potato Team
說話人分離回答了"誰在什麼時候說話?"這個問題。本教程涵蓋構建標註說話人輪次的介面、糾正自動分離結果以及處理多說話人對話。
什麼是說話人分離?
說話人分離將音訊分割為說話人同質的區域。應用場景包括:
- 會議轉錄
- 客服中心分析
- 播客製作
- 訪談處理
- 法庭/法律錄音
基本分離設定
yaml
annotation_task_name: "Speaker Diarization"
data_files:
- "data/conversations.json"
annotation_schemes:
- annotation_type: audio_annotation
name: speakers
description: "Mark when each speaker talks"
labels:
- name: Speaker 1
color: "#FF6B6B"
keyboard_shortcut: "1"
- name: Speaker 2
color: "#4ECDC4"
keyboard_shortcut: "2"
- name: Speaker 3
color: "#45B7D1"
keyboard_shortcut: "3"
- name: Overlap
color: "#FFEAA7"
keyboard_shortcut: "o"
- name: Silence
color: "#9CA3AF"
keyboard_shortcut: "s"建立說話人片段
工作流
- 播放音訊或點選波形進行導航
- 在波形上點選並拖動以選擇時間範圍
- 按數字鍵或點選說話人標籤
- 該片段將被著色和標記
- 通過拖動邊緣調整邊界
- 繼續直到整個音訊都被分段
鍵盤控制
Potato 為音訊播放控制提供內建鍵盤快捷鍵,包括播放/暫停和導航。
預標註分離糾正
通常您需要糾正自動分離的結果:
yaml
data_files:
- "data/auto_diarized.json"資料格式:
json
{
"id": "meeting_001",
"audio_path": "/audio/meeting_001.wav",
"auto_segments": [
{"start": 0.0, "end": 3.5, "speaker": "Speaker 1"},
{"start": 3.5, "end": 8.2, "speaker": "Speaker 2"},
{"start": 8.2, "end": 12.0, "speaker": "Speaker 1"}
]
}詳細說話人資訊
捕獲額外的說話人後設資料:
yaml
annotation_schemes:
- annotation_type: audio_annotation
name: speakers
labels:
- name: Speaker A
color: "#FF6B6B"
- name: Speaker B
color: "#4ECDC4"
- name: Speaker C
color: "#45B7D1"
- name: Unknown
color: "#9CA3AF"
# Speaker characteristics
- annotation_type: radio
name: speaker_a_gender
description: "Speaker A Gender"
labels:
- Male
- Female
- Unknown
- annotation_type: text
name: speaker_a_role
description: "Speaker A Role (if identifiable)"
- annotation_type: radio
name: speaker_b_gender
description: "Speaker B Gender"
labels:
- Male
- Female
- Unknown處理重疊語音
yaml
annotation_schemes:
- annotation_type: audio_annotation
name: speakers
labels:
- name: Speaker 1
color: "#FF6B6B"
- name: Speaker 2
color: "#4ECDC4"
- name: Overlap
color: "#FFEAA7"會議/訪談分離
yaml
annotation_task_name: "Meeting Diarization"
data_files:
- "data/meetings.json"
annotation_schemes:
# Speaker turns
- annotation_type: audio_annotation
name: turns
description: "Mark each speaker turn"
labels:
- name: Moderator
color: "#EF4444"
keyboard_shortcut: "m"
- name: Participant 1
color: "#3B82F6"
keyboard_shortcut: "1"
- name: Participant 2
color: "#10B981"
keyboard_shortcut: "2"
- name: Participant 3
color: "#F59E0B"
keyboard_shortcut: "3"
- name: Participant 4
color: "#8B5CF6"
keyboard_shortcut: "4"
- name: Unknown
color: "#6B7280"
keyboard_shortcut: "u"
- name: Overlap
color: "#FCD34D"
keyboard_shortcut: "o"
- name: Silence/Noise
color: "#D1D5DB"
keyboard_shortcut: "s"
# Speech type annotation
- annotation_type: radio
name: speech_type
description: "Type of speech"
labels:
- Statement
- Question
- Response
- Interruption
- Backchannel
# Overall quality
- annotation_type: radio
name: recording_quality
description: "Overall recording quality"
labels:
- Excellent - All speakers clear
- Good - Most speech understandable
- Fair - Some difficulty
- Poor - Significant issues輸出格式
json
{
"id": "meeting_001",
"audio_path": "/audio/meeting_001.wav",
"annotations": {
"turns": [
{
"start": 0.0,
"end": 5.2,
"label": "Moderator",
"attributes": {
"speech_type": "Statement"
}
},
{
"start": 5.2,
"end": 12.8,
"label": "Participant 1",
"attributes": {
"speech_type": "Response"
}
},
{
"start": 11.5,
"end": 12.8,
"label": "Overlap"
}
],
"recording_quality": "Good - Most speech understandable"
}
}分離標註技巧
- 先聽一遍:在標註前先熟悉說話人
- 記錄說話人特徵:音高、口音、說話風格
- 一致地處理重疊:預先確定處理策略
- 使用速度控制:對困難片段放慢速度
- 標記不確定性:需要時可以使用"未知"
下一步
完整音訊文件請見 音訊標註。