🚀 Wav2Vec2-Large for Speaker Identification
このモデルは、話者識別のためのWav2Vec2-Largeモデルです。S3PRLのモデルをポートしたもので、SUPERBの話者識別タスクに特化しています。
🚀 クイックスタート
このモデルを使用するには、入力音声が16kHzでサンプリングされていることを確認してください。以下に使用例を示します。
✨ 主な機能
- 話者識別タスクに特化したモデルです。
- ベースモデルはwav2vec2-large-lv60で、16kHzの音声データで事前学習されています。
📚 ドキュメント
モデルの説明
これは、S3PRLのSUPERB話者識別タスク用のWav2Vec2 をポートしたバージョンです。
ベースモデルは wav2vec2-large-lv60 で、16kHzでサンプリングされた音声データで事前学習されています。モデルを使用する際には、入力音声も16kHzでサンプリングされていることを確認してください。
詳細については、SUPERB: Speech processing Universal PERformance Benchmark を参照してください。
タスクとデータセットの説明
話者識別(SI)は、各発話の話者を多クラス分類として識別するタスクです。訓練とテストでは同じ事前定義された話者セットが使用されます。広く使用されている VoxCeleb1 データセットが採用されています。
元のモデルの訓練と評価の手順については、S3PRLのダウンストリームタスクREADME を参照してください。
💻 使用例
基本的な使用法
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/wav2vec2-large-superb-sid")
labels = classifier(dataset[0]["file"], top_k=5)
高度な使用法
import torch
import librosa
from datasets import load_dataset
from transformers import Wav2Vec2ForSequenceClassification, 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 = Wav2Vec2ForSequenceClassification.from_pretrained("superb/wav2vec2-large-superb-sid")
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("superb/wav2vec2-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()]
🔧 技術詳細
評価指標は精度(accuracy)です。
|
s3prl |
transformers |
test |
0.8614 |
0.8613 |
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ライセンスの下で提供されています。