🚀 SpeechT5 (音声変換タスク)
CMU ARCTICデータセットで音声変換(音声から音声)用にファインチューニングされたSpeechT5モデルです。
このモデルは、Junyi Ao、Rui Wang、Long Zhou、Chengyi Wang、Shuo Ren、Yu Wu、Shujie Liu、Tom Ko、Qing Li、Yu Zhang、Zhihua Wei、Yao Qian、Jinyu Li、Furu Weiによる SpeechT5: Unified-Modal Encoder-Decoder Pre-Training for Spoken Language Processing で紹介されました。
SpeechT5は、このリポジトリ で最初に公開され、元の重み が提供されています。使用されているライセンスは MIT です。
免責事項: SpeechT5を公開したチームはこのモデルのモデルカードを作成していないため、このモデルカードはHugging Faceチームによって作成されています。
📚 ドキュメント
モデルの説明
T5 (Text-To-Text Transfer Transformer) が事前学習自然言語処理モデルで成功を収めたことに着想を得て、自己教師付き音声/テキスト表現学習のためのエンコーダ-デコーダ事前学習を探索する統一モーダルのSpeechT5フレームワークを提案します。SpeechT5フレームワークは、共有エンコーダ-デコーダネットワークと6つのモダリティ固有(音声/テキスト)の事前/事後ネットワークで構成されています。入力音声/テキストを事前ネットワークで前処理した後、共有エンコーダ-デコーダネットワークがシーケンス-to-シーケンス変換をモデル化し、事後ネットワークがデコーダの出力に基づいて音声/テキストモダリティの出力を生成します。
大規模なラベルなし音声とテキストデータを活用して、SpeechT5を事前学習させ、統一モーダル表現を学習させることで、音声とテキストの両方のモデル化能力を向上させることを目指しています。テキストと音声情報をこの統一された意味空間に整合させるために、エンコーダとデコーダのインターフェースとして潜在ユニットで音声/テキスト状態をランダムにミックスアップするクロスモーダルベクトル量子化アプローチを提案します。
広範な評価により、提案されたSpeechT5フレームワークが自動音声認識、音声合成、音声翻訳、音声変換、音声強化、話者識別などの様々な音声言語処理タスクで優れていることが示されています。
使用目的と制限
このモデルは音声変換に使用できます。興味のあるタスクでファインチューニングされたバージョンを モデルハブ で確認してください。
現在、特徴抽出器とモデルの両方がPyTorchをサポートしています。
💻 使用例
基本的な使用法
次のコードを使用して、モノラル16kHzの音声波形を別の波形に変換できます。
from transformers import SpeechT5Processor, SpeechT5ForSpeechToSpeech, SpeechT5HifiGan
from datasets import load_dataset
dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate
example_speech = dataset[0]["audio"]["array"]
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_vc")
model = SpeechT5ForSpeechToSpeech.from_pretrained("microsoft/speecht5_vc")
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
inputs = processor(audio=example_speech, sampling_rate=sampling_rate, return_tensors="pt")
import numpy as np
import torch
speaker_embeddings = np.load("xvector_speaker_embedding.npy")
speaker_embeddings = torch.tensor(speaker_embeddings).unsqueeze(0)
speech = model.generate_speech(inputs["input_values"], speaker_embeddings, vocoder=vocoder)
import soundfile as sf
sf.write("speech.wav", speech.numpy(), samplerate=16000)
📄 ライセンス
このモデルは MIT ライセンスの下で提供されています。
引用
@inproceedings{ao-etal-2022-speecht5,
title = {{S}peech{T}5: Unified-Modal Encoder-Decoder Pre-Training for Spoken Language Processing},
author = {Ao, Junyi and Wang, Rui and Zhou, Long and Wang, Chengyi and Ren, Shuo and Wu, Yu and Liu, Shujie and Ko, Tom and Li, Qing and Zhang, Yu and Wei, Zhihua and Qian, Yao and Li, Jinyu and Wei, Furu},
booktitle = {Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
month = {May},
year = {2022},
pages={5723--5738},
}