🚀 S2T2-Wav2Vec2-CoVoST2-EN-TR-ST
s2t-wav2vec2-large-en-tr
は、エンドツーエンドの音声翻訳(ST)用にトレーニングされた音声からテキストへのTransformerモデルです。
S2T2モデルは、Large-Scale Self- and Semi-Supervised Learning for Speech Translation で提案され、
Fairseq で公式に公開されました。
✨ 主な機能
モデルの説明
S2T2は、エンドツーエンドの自動音声認識(ASR)と音声翻訳(ST)を目的として設計された、Transformerベースのseq2seq(音声エンコーダ - デコーダ)モデルです。
エンコーダとして事前学習済みの Wav2Vec2 を使用し、Transformerベースのデコーダを備えています。
このモデルは、標準的な自己回帰型の交差エントロピー損失でトレーニングされ、自己回帰的に翻訳を生成します。
想定される用途と制限
このモデルは、エンドツーエンドの英語の音声からトルコ語のテキストへの翻訳に使用できます。
他のS2T2チェックポイントを探すには、モデルハブ を参照してください。
📦 インストール
本READMEにはインストールに関する具体的なコマンドが記載されていないため、このセクションは省略されます。
💻 使用例
基本的な使用法
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-tr", feature_extractor="facebook/s2t-wav2vec2-large-en-tr")
translation = 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-tr")
processor = Speech2Text2Processor.from_pretrained("facebook/s2t-wav2vec2-large-en-tr")
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)
📚 ドキュメント
評価結果
CoVoST-V2の英語からトルコ語へのテスト結果(BLEUスコア):17.5
詳細については、公式論文、特に表2の10行目を参照してください。
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}
}
📄 ライセンス
このプロジェクトはMITライセンスの下で提供されています。
```markdown
| プロパティ | 詳細 |
|------|------|
| 言語 | en、tr |
| データセット | covost2、librispeech_asr |
| タグ | audio、speech-translation、automatic-speech-recognition、speech2text2 |
| パイプラインタグ | automatic-speech-recognition |