🚀 Wav2vec2 Large 100k Voxpopuli 在葡萄牙語上微調模型
該項目基於 Common Voice 7.0、TTS - 葡萄牙語語料庫並結合數據增強方法,對 Wav2vec2 Large 100k Voxpopuli 模型進行微調,用於葡萄牙語的自動語音識別,有效提升了語音識別效果。
🚀 快速開始
本模型是 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")
高級用法
使用 Common Voice 數據集進行測試示例
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) |
標籤 |
音頻、語音、wav2vec2、葡萄牙語、葡萄牙語語音語料庫、自動語音識別、PyTorch |