GetmanY1 commited on
Commit
3cac4fe
·
verified ·
1 Parent(s): 4ed6f85

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +77 -8
README.md CHANGED
@@ -5,29 +5,98 @@ tags:
5
  - automatic-speech-recognition
6
  - fi
7
  - finnish
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
- # Colloquial Finnish Wav2vec2-Base
10
 
11
- The base model pre-trained on 16kHz sampled speech audio. When using the model make sure that your speech input is also sampled at 16Khz.
12
 
13
- **Note**: This model does not have a tokenizer as it was pre-trained on audio alone. In order to use this model **speech recognition**, a tokenizer should be created and the model should be fine-tuned on labeled text data. Check out [this blog](https://huggingface.co/blog/fine-tune-xlsr-wav2vec2) for more in-detail explanation of how to fine-tune the model.
14
 
15
  ## Model description
16
 
17
  The Finnish Wav2Vec2 Base has the same architecture and uses the same training objective as the English and multilingual one described in [Paper](https://arxiv.org/abs/2006.11477). It is pre-trained on 2600 hours of unlabeled colloquial Finnish speech from [Lahjoita puhetta (Donate Speech)](https://link.springer.com/article/10.1007/s10579-022-09606-3).
18
 
19
- You can read more about the pre-trained model from [this paper](TODO).
20
 
21
  ## Intended uses & limitations
22
 
23
- You can use this model for Finnish ASR (speech-to-text) and SER (Spoken Emotion Recognition) tasks.
24
 
25
  ### How to use
26
 
27
- See [this notebook](https://colab.research.google.com/github/patrickvonplaten/notebooks/blob/master/Fine_Tune_XLS_R_on_Common_Voice.ipynb) for more information on how to fine-tune the model.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  ### Limitations and bias
30
 
31
- This model was pre-trained with audio samples whose maximum length was 60 seconds so this model most likely works the best for quite 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](https://huggingface.co/blog/asr-chunking).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
- A vast majority of the data used for pre-training was from the [Lahjoita puhetta (Donate Speech) corpus](https://link.springer.com/article/10.1007/s10579-022-09606-3) so this model might have biases towards colloquial Finnish.
 
5
  - automatic-speech-recognition
6
  - fi
7
  - finnish
8
+ model-index:
9
+ - name: wav2vec2-base-fi-voxpopuli-v2-100h
10
+ results:
11
+ - task:
12
+ name: Automatic Speech Recognition
13
+ type: automatic-speech-recognition
14
+ dataset:
15
+ name: Lahjoita puhetta (Donate Speech)
16
+ type: lahjoita-puhetta
17
+ args: fi
18
+ metrics:
19
+ - name: Dev WER
20
+ type: wer
21
+ value: 29.35
22
+ - name: Dev CER
23
+ type: cer
24
+ value: 7.94
25
+ - name: Test WER
26
+ type: wer
27
+ value: 31.90
28
+ - name: Test CER
29
+ type: cer
30
+ value: 9.05
31
  ---
32
+ # Colloquial Finnish Wav2vec2-Base ASR
33
 
34
+ [facebook/wav2vec2-base-fi-voxpopuli-v2](https://huggingface.co/facebook/wav2vec2-base-fi-voxpopuli-v2) fine-tuned on 100 hours of [Lahjoita puhetta (Donate Speech)](https://link.springer.com/article/10.1007/s10579-022-09606-3) on 16kHz sampled speech audio. When using the model make sure that your speech input is also sampled at 16Khz.
35
 
 
36
 
37
  ## Model description
38
 
39
  The Finnish Wav2Vec2 Base has the same architecture and uses the same training objective as the English and multilingual one described in [Paper](https://arxiv.org/abs/2006.11477). It is pre-trained on 2600 hours of unlabeled colloquial Finnish speech from [Lahjoita puhetta (Donate Speech)](https://link.springer.com/article/10.1007/s10579-022-09606-3).
40
 
41
+ You can read more about the pre-trained model from [this paper](TODO). The training scripts are available on [GitHub](https://github.com/aalto-speech/colloquial-Finnish-wav2vec2)
42
 
43
  ## Intended uses & limitations
44
 
45
+ You can use this model for Finnish ASR (speech-to-text).
46
 
47
  ### How to use
48
 
49
+ To transcribe audio files the model can be used as a standalone acoustic model as follows:
50
+
51
+ ```
52
+ from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
53
+ from datasets import load_dataset
54
+ import torch
55
+
56
+ # load model and processor
57
+ processor = Wav2Vec2Processor.from_pretrained("wav2vec2-base-fi-voxpopuli-v2-100h")
58
+ model = Wav2Vec2ForCTC.from_pretrained("wav2vec2-base-fi-voxpopuli-v2-100h")
59
+
60
+ # load dummy dataset and read soundfiles
61
+ ds = load_dataset("mozilla-foundation/common_voice_16_1", "fi", split='test')
62
+
63
+ # tokenize
64
+ input_values = processor(ds[0]["audio"]["array"], return_tensors="pt", padding="longest").input_values # Batch size 1
65
+
66
+ # retrieve logits
67
+ logits = model(input_values).logits
68
+
69
+ # take argmax and decode
70
+ predicted_ids = torch.argmax(logits, dim=-1)
71
+ transcription = processor.batch_decode(predicted_ids)
72
+ ```
73
 
74
  ### Limitations and bias
75
 
76
+ This model was fine-tuned with audio samples whose maximum length was 50 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](https://huggingface.co/blog/asr-chunking).
77
+
78
+ The model was fine-tuned on the data from the [Lahjoita puhetta (Donate Speech) corpus](https://link.springer.com/article/10.1007/s10579-022-09606-3) so this model might have biases towards colloquial Finnish.
79
+
80
+ ## Citation
81
+
82
+ If you use our models or scripts, please cite our article as:
83
+
84
+ ```bibtex
85
+ @inproceedings{getman24a_interspeech,
86
+ author={Yaroslav Getman and Tamas Grosz and Mikko Kurimo},
87
+ title={{What happens in continued pre-training? Analysis of self-supervised speech
88
+ models with continued pre-training for colloquial Finnish ASR}},
89
+ year=2024,
90
+ booktitle={Proc. INTERSPEECH 2024},
91
+ pages={XX--XX},
92
+ doi={XXXX},
93
+ issn={XXXX-XXXX}
94
+ }
95
+ ```
96
+
97
+ ## Team Members
98
+
99
+ - Yaroslav Getman, [Hugging Face profile](https://huggingface.co/GetmanY1), [LinkedIn profile](https://www.linkedin.com/in/yaroslav-getman/)
100
+ - Tamas Grosz, [Hugging Face profile](https://huggingface.co/Grosy), [LinkedIn profile](https://www.linkedin.com/in/tam%C3%A1s-gr%C3%B3sz-950a049a/)
101
 
102
+ Feel free to contact us for more details 🤗