英文

wav2vec2-xls-r-300m-lm-hebrew

该模型是在“数据集未知”上通过添加ngram模型对 facebook/wav2vec2-xls-r-300m 进行微调的版本,根据 Boosting Wav2Vec2 with n-grams in ? Transformers 进行了调整。

使用方法

请检查软件包: https://github.com/imvladikon/wav2vec2-hebrew

或使用transformers pipeline:

import torch
from datasets import load_dataset
from transformers import AutoModelForCTC, AutoProcessor
import torchaudio.functional as F


model_id = "imvladikon/wav2vec2-xls-r-300m-lm-hebrew"

sample_iter = iter(load_dataset("google/fleurs", "he_il", split="test", streaming=True))

sample = next(sample_iter)
resampled_audio = F.resample(torch.tensor(sample["audio"]["array"]), sample["audio"]["sampling_rate"], 16_000).numpy()

model = AutoModelForCTC.from_pretrained(model_id)
processor = AutoProcessor.from_pretrained(model_id)

input_values = processor(resampled_audio, return_tensors="pt").input_values

with torch.no_grad():
    logits = model(input_values).logits

transcription = processor.batch_decode(logits.numpy()).text
print(transcription)

预期用途和限制

需要更多信息。

训练和评估数据

需要更多信息。

训练过程

训练超参数

训练时使用了以下超参数:

  • learning_rate:0.0003
  • train_batch_size:64
  • eval_batch_size:16
  • seed:42
  • gradient_accumulation_steps:2
  • total_train_batch_size:128
  • optimizer:Adam,betas=(0.9,0.999),epsilon=1e-08
  • lr_scheduler_type:linear
  • lr_scheduler_warmup_steps:500
  • num_epochs:100
  • mixed_precision_training:Native AMP

训练结果

框架版本

  • Transformers 4.16.0.dev0
  • Pytorch 1.10.1+cu102
  • Datasets 1.17.1.dev0
  • Tokenizers 0.11.0