🚀 Wav2vec2 Large 100k Voxpopuli をCommon Voice 7.0、TTS-ポルトガル語コーパスとデータ拡張を用いてポルトガル語でファインチューニング
Wav2vec2 Large 100k Voxpopuli は、Common Voice 7.0、TTS-ポルトガル語コーパスと、TTSと音声変換に基づくデータ拡張手法を用いて、ポルトガル語でファインチューニングされたモデルです。
🚀 クイックスタート
このモデルを使用するには、以下のコードを実行します。
from transformers import AutoTokenizer, Wav2Vec2ForCTC
tokenizer = AutoTokenizer.from_pretrained("Edresson/wav2vec2-large-100k-voxpopuli-ft-Common_Voice_plus_TTS-Dataset_plus_Data_Augmentation-portuguese")
model = Wav2Vec2ForCTC.from_pretrained("Edresson/wav2vec2-large-100k-voxpopuli-ft-Common_Voice_plus_TTS-Dataset_plus_Data_Augmentation-portuguese")
💻 使用例
基本的な使用法
from transformers import AutoTokenizer, Wav2Vec2ForCTC
tokenizer = AutoTokenizer.from_pretrained("Edresson/wav2vec2-large-100k-voxpopuli-ft-Common_Voice_plus_TTS-Dataset_plus_Data_Augmentation-portuguese")
model = Wav2Vec2ForCTC.from_pretrained("Edresson/wav2vec2-large-100k-voxpopuli-ft-Common_Voice_plus_TTS-Dataset_plus_Data_Augmentation-portuguese")
高度な使用法
dataset = load_dataset("common_voice", "ru", split="test", data_dir="./cv-corpus-7.0-2021-07-21")
resampler = torchaudio.transforms.Resample(orig_freq=48_000, new_freq=16_000)
def map_to_array(batch):
speech, _ = torchaudio.load(batch["path"])
batch["speech"] = resampler.forward(speech.squeeze(0)).numpy()
batch["sampling_rate"] = resampler.new_freq
batch["sentence"] = re.sub(chars_to_ignore_regex, '', batch["sentence"]).lower().replace("’", "'")
return batch
ds = dataset.map(map_to_array)
result = ds.map(map_to_pred, batched=True, batch_size=1, remove_columns=list(ds.features.keys()))
print(wer.compute(predictions=result["predicted"], references=result["target"]))
📚 ドキュメント
結果については、論文を参照してください。
📄 ライセンス
このモデルは、Apache 2.0ライセンスの下で提供されています。
📋 モデル情報
属性 |
详情 |
モデルタイプ |
Wav2vec2 Large 100k Voxpopuliをポルトガル語でファインチューニングしたモデル |
訓練データ |
Common Voice 7.0、TTS-ポルトガル語コーパス、データ拡張 |
評価指標 |
WER (Word Error Rate) |
タグ |
audio、speech、wav2vec2、pt、Portuguese-speech-corpus、automatic-speech-recognition、speech、PyTorch |