🚀 "Powerset"說話人分割模型
本開源模型可對16kHz採樣的10秒單聲道音頻進行處理,輸出說話人分割結果。它以(num_frames, num_classes)矩陣的形式呈現,其中包含7個類別,分別為_非語音_、說話人 #1、說話人 #2、說話人 #3、說話人 #1 和 #2、說話人 #1 和 #3 以及 說話人 #2 和 #3。這一模型能在語音處理領域,如會議記錄、音頻內容分析等場景中發揮重要作用,幫助用戶準確識別音頻中的說話人信息。
如果在生產環境中使用此開源模型,建議考慮切換到 pyannoteAI,以獲取更優質、更高效的解決方案。

🚀 快速開始
安裝要求
- 使用
pip install pyannote.audio
安裝 pyannote.audio
3.0
版本。
- 接受
pyannote/segmentation-3.0
的用戶使用條件。
- 在
hf.co/settings/tokens
創建訪問令牌。
模型使用
from pyannote.audio import Model
model = Model.from_pretrained(
"pyannote/segmentation-3.0",
use_auth_token="HUGGINGFACE_ACCESS_TOKEN_GOES_HERE")
💻 使用示例
基礎用法
duration, sample_rate, num_channels = 10, 16000, 1
waveform = torch.randn(batch_size, num_channels, duration * sample_rate)
powerset_encoding = model(waveform)
from pyannote.audio.utils.powerset import Powerset
max_speakers_per_chunk, max_speakers_per_frame = 3, 2
to_multilabel = Powerset(
max_speakers_per_chunk,
max_speakers_per_frame).to_multilabel
multilabel_encoding = to_multilabel(powerset_encoding)
高級用法
說話人分割
此模型本身無法對完整錄音進行說話人分割(它僅處理10秒的音頻片段)。
可參考 pyannote/speaker-diarization-3.0 管道,該管道使用額外的說話人嵌入模型來對完整錄音進行說話人分割。
語音活動檢測
from pyannote.audio.pipelines import VoiceActivityDetection
pipeline = VoiceActivityDetection(segmentation=model)
HYPER_PARAMETERS = {
"min_duration_on": 0.0,
"min_duration_off": 0.0
}
pipeline.instantiate(HYPER_PARAMETERS)
vad = pipeline("audio.wav")
重疊語音檢測
from pyannote.audio.pipelines import OverlappedSpeechDetection
pipeline = OverlappedSpeechDetection(segmentation=model)
HYPER_PARAMETERS = {
"min_duration_on": 0.0,
"min_duration_off": 0.0
}
pipeline.instantiate(HYPER_PARAMETERS)
osd = pipeline("audio.wav")
📚 詳細文檔
該模型背後的各種概念在這篇 論文 中有詳細描述。它由Séverin Baroudi使用 pyannote.audio 3.0.0
版本,結合AISHELL、AliMeeting、AMI、AVA - AVD、DIHARD、Ego4D、MSDWild、REPERE和VoxConverse的訓練集進行訓練。
由 Alexis Plaquet 維護的 配套倉庫 還提供瞭如何在自己的數據上訓練或微調此類模型的說明。
📄 許可證
本項目採用MIT許可證。
📚 引用
@inproceedings{Plaquet23,
author={Alexis Plaquet and Hervé Bredin},
title={{Powerset multi-class cross entropy loss for neural speaker diarization}},
year=2023,
booktitle={Proc. INTERSPEECH 2023},
}
@inproceedings{Bredin23,
author={Hervé Bredin},
title={{pyannote.audio 2.1 speaker diarization pipeline: principle, benchmark, and recipe}},
year=2023,
booktitle={Proc. INTERSPEECH 2023},
}
📋 信息表格
屬性 |
詳情 |
模型類型 |
“Powerset”說話人分割模型 |
訓練數據 |
AISHELL、AliMeeting、AMI、AVA - AVD、DIHARD、Ego4D、MSDWild、REPERE和VoxConverse的訓練集 |
⚠️ 重要提示
收集的信息將有助於更好地瞭解pyannote.audio的用戶群體,並幫助其維護者進一步改進它。儘管此模型使用MIT許可證,並且將始終保持開源,但我們偶爾會通過電子郵件向您介紹pyannote相關的高級模型和付費服務。
💡 使用建議
在生產環境中使用此開源模型時,考慮切換到 pyannoteAI 以獲取更優質、更高效的解決方案。