GetmanY1's picture
Update README.md
4bbcf3d verified
metadata
license: apache-2.0
tags:
  - automatic-speech-recognition
  - sami
model-index:
  - name: wav2vec2-base-fi-voxpopuli-v2-sami-parl-ext-ft
    results:
      - task:
          name: Automatic Speech Recognition
          type: automatic-speech-recognition
        dataset:
          name: UIT-SME
          type: uit-sme
          args: sami
        metrics:
          - name: WER
            type: wer
            value: 33.67
          - name: CER
            type: cer
            value: 8.61

Northern Sámi Wav2vec2-Base ASR

facebook/wav2vec2-base-fi-voxpopuli-v2 with two-step, extended fine-tuning. The model was originally adapted to Finnish ASR with 1500 hours of speech from the Lahjoita puhetta (Donate Speech) corpus, followed by adding randomly initialized weights and bias terms in the final linear layer (language modeling head) for the 12 new characters introduced by the target Sámi data and fine-tuning on 20 hours of Sámi Parliament speech data on 16kHz sampled speech audio. When using the model make sure that your speech input is also sampled at 16Khz.

Model description

The Sámi Wav2Vec2 Base has the same architecture and uses the same training objective as the English and multilingual one described in Paper.

You can read more about the pre-trained model from this paper. The training scripts are available on GitHub

Intended uses & limitations

You can use this model for Sámi ASR (speech-to-text).

How to use

To transcribe audio files the model can be used as a standalone acoustic model as follows:

from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
from datasets import load_dataset
import torch

# load model and processor
processor = Wav2Vec2Processor.from_pretrained("GetmanY1/wav2vec2-base-fi-voxpopuli-v2-sami-parl-ext-ft")
model = Wav2Vec2ForCTC.from_pretrained("GetmanY1/wav2vec2-base-fi-voxpopuli-v2-sami-parl-ext-ft")

# load dummy dataset and read soundfiles
ds = load_dataset("mozilla-foundation/common_voice_16_1", "fi", split='test')

# tokenize
input_values = processor(ds[0]["audio"]["array"], return_tensors="pt", padding="longest").input_values  # Batch size 1

# retrieve logits
logits = model(input_values).logits

# take argmax and decode
predicted_ids = torch.argmax(logits, dim=-1)
transcription = processor.batch_decode(predicted_ids)

Limitations and bias

This model was fine-tuned with audio samples whose maximum length was 30 seconds so this model most likely works the best for short audios of similar length. However, you can try this model with a lot longer audios too and see how it works. If you encounter out of memory errors with very long audio files you can use the audio chunking method introduced in this blog post.

The model was fine-tuned on the data from the Sámi Parliament speech data so this model might have biases towards formal Sámi.

Citation

If you use our models or scripts, please cite our article as:

@inproceedings{getman24b_interspeech,
  author={Yaroslav Getman and Tamas Grosz and Katri Hiovain-Asikainen and Mikko Kurimo},
  title={{Exploring adaptation techniques of large speech foundation models for low-resource ASR: a case study on Northern Sámi}},
  year=2024,
  booktitle={Proc. INTERSPEECH 2024},
  pages={XX--XX},
  doi={XXXX},
  issn={XXXX-XXXX}
}