🚀 S2T2-Wav2Vec2-CoVoST2-EN-DE-ST
s2t-wav2vec2-large-en-de
は、エンドツーエンドの音声翻訳(ST)用に学習された音声からテキストへのTransformerモデルです。S2T2モデルは、Large-Scale Self- and Semi-Supervised Learning for Speech Translation で提案され、Fairseq で公式に公開されました。
🚀 クイックスタート
このモデルは、英語の音声をエンドツーエンドでドイツ語のテキストに翻訳するために使用できます。他のS2T2チェックポイントを探すには、モデルハブ を参照してください。
✨ 主な機能
- エンドツーエンドの音声翻訳(ST)に特化した学習。
- 事前学習された Wav2Vec2 をエンコーダーとして使用。
- 標準的な自己回帰的クロスエントロピー損失で学習され、自己回帰的に翻訳を生成。
📦 インストール
このREADMEには具体的なインストール手順が記載されていないため、このセクションは省略されます。
💻 使用例
基本的な使用法
このモデルは標準的なシーケンスツーシーケンスTransformerモデルであるため、音声特徴をモデルに渡して generate
メソッドを使用してトランスクリプトを生成できます。
from datasets import load_dataset
from transformers import pipeline
librispeech_en = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
asr = pipeline("automatic-speech-recognition", model="facebook/s2t-wav2vec2-large-en-de", feature_extractor="facebook/s2t-wav2vec2-large-en-de")
translation_de = asr(librispeech_en[0]["file"])
高度な使用法
以下は、ステップバイステップでの使用例です。
import torch
from transformers import Speech2Text2Processor, SpeechEncoderDecoder
from datasets import load_dataset
import soundfile as sf
model = SpeechEncoderDecoder.from_pretrained("facebook/s2t-wav2vec2-large-en-de")
processor = Speech2Text2Processor.from_pretrained("facebook/s2t-wav2vec2-large-en-de")
def map_to_array(batch):
speech, _ = sf.read(batch["file"])
batch["speech"] = speech
return batch
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)
inputs = processor(ds["speech"][0], sampling_rate=16_000, return_tensors="pt")
generated_ids = model.generate(input_ids=inputs["input_features"], attention_mask=inputs["attention_mask"])
transcription = processor.batch_decode(generated_ids)
📚 ドキュメント
モデルの説明
S2T2は、エンドツーエンドの自動音声認識(ASR)と音声翻訳(ST)用に設計されたTransformerベースのシーケンスツーシーケンス(音声エンコーダー - デコーダー)モデルです。エンコーダーとして事前学習された Wav2Vec2 を使用し、Transformerベースのデコーダーを備えています。
評価結果
CoVoST-V2の英語からドイツ語へのテスト結果(BLEUスコア):26.5
詳細については、公式論文 、特に表2の10行目を参照してください。
🔧 技術詳細
S2T2モデルは、Large-Scale Self- and Semi-Supervised Learning for Speech Translation で提案されました。この論文では、大規模な自己教師付き学習と半教師付き学習を用いた音声翻訳について詳しく説明されています。
📄 ライセンス
このモデルはMITライセンスの下で公開されています。
BibTeX引用
@article{DBLP:journals/corr/abs-2104-06678,
author = {Changhan Wang and
Anne Wu and
Juan Miguel Pino and
Alexei Baevski and
Michael Auli and
Alexis Conneau},
title = {Large-Scale Self- and Semi-Supervised Learning for Speech Translation},
journal = {CoRR},
volume = {abs/2104.06678},
year = {2021},
url = {https://arxiv.org/abs/2104.06678},
archivePrefix = {arXiv},
eprint = {2104.06678},
timestamp = {Thu, 12 Aug 2021 15:37:06 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-2104-06678.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
その他の情報
属性 |
详情 |
モデルタイプ |
音声からテキストへのTransformerモデル |
学習データ |
covost2、librispeech_asr |
パイプラインタグ |
自動音声認識 |
ウィジェットの例: