🚀 話者識別用Hubert-Large
このモデルは、話者識別タスクに特化したHubert-Largeモデルです。S3PRLのモデルをポートしたもので、SUPERBベンチマークの話者識別タスクに最適化されています。
🚀 クイックスタート
このモデルは、話者識別タスクに使用できます。以下のセクションでは、モデルの詳細、使用例、評価結果について説明します。
✨ 主な機能
- 話者識別タスクに最適化されたHubert-Largeモデル
- 16kHzの音声入力に対応
- Audio Classificationパイプラインを使用した簡単な推論
📚 ドキュメント
モデルの説明
これは、S3PRLのSUPERB話者識別タスク用Hubert のポート版です。
ベースモデルは hubert-large-ll60k で、16kHzの音声オーディオで事前学習されています。モデルを使用する際は、音声入力も16kHzでサンプリングされていることを確認してください。
詳細については、SUPERB: Speech processing Universal PERformance Benchmark を参照してください。
タスクとデータセットの説明
話者識別 (SI) は、各発話を話者の識別情報に基づいて多クラス分類するタスクです。訓練とテストでは、話者が同じ事前定義されたセットに含まれています。広く使用されている VoxCeleb1 データセットが採用されています。
元のモデルの訓練と評価の手順については、S3PRL下流タスクのREADME を参照してください。
💻 使用例
基本的な使用法
Audio Classificationパイプラインを使用してモデルを利用することができます。
from datasets import load_dataset
from transformers import pipeline
dataset = load_dataset("anton-l/superb_demo", "si", split="test")
classifier = pipeline("audio-classification", model="superb/hubert-large-superb-sid")
labels = classifier(dataset[0]["file"], top_k=5)
高度な使用法
モデルを直接使用することもできます。
import torch
import librosa
from datasets import load_dataset
from transformers import HubertForSequenceClassification, Wav2Vec2FeatureExtractor
def map_to_array(example):
speech, _ = librosa.load(example["file"], sr=16000, mono=True)
example["speech"] = speech
return example
dataset = load_dataset("anton-l/superb_demo", "si", split="test")
dataset = dataset.map(map_to_array)
model = HubertForSequenceClassification.from_pretrained("superb/hubert-large-superb-sid")
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("superb/hubert-large-superb-sid")
inputs = feature_extractor(dataset[:2]["speech"], sampling_rate=16000, padding=True, return_tensors="pt")
logits = model(**inputs).logits
predicted_ids = torch.argmax(logits, dim=-1)
labels = [model.config.id2label[_id] for _id in predicted_ids.tolist()]
📊 評価結果
評価指標は正解率です。
|
s3prl |
transformers |
test |
0.9033 |
0.9035 |
BibTeX引用
@article{yang2021superb,
title={SUPERB: Speech processing Universal PERformance Benchmark},
author={Yang, Shu-wen and Chi, Po-Han and Chuang, Yung-Sung and Lai, Cheng-I Jeff and Lakhotia, Kushal and Lin, Yist Y and Liu, Andy T and Shi, Jiatong and Chang, Xuankai and Lin, Guan-Ting and others},
journal={arXiv preprint arXiv:2105.01051},
year={2021}
}
📄 ライセンス
このモデルは、Apache 2.0ライセンスの下で提供されています。