Jzuluaga commited on
Commit
c507cf0
1 Parent(s): e0def8d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +161 -11
README.md CHANGED
@@ -1,37 +1,187 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
3
  tags:
 
4
  - automatic-speech-recognition
5
- - experiments/data/atcosim_uwb_atcc/train
 
6
  - generated_from_trainer
7
  metrics:
8
  - wer
9
  model-index:
10
- - name: 0.0ld_0.0ad_0.0attd_0.05fpd_0.075mtp_12mtl_0.0mfp_12mfl_1acc
11
- results: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
15
- should probably proofread and complete it, then remove this comment. -->
16
-
17
- # 0.0ld_0.0ad_0.0attd_0.05fpd_0.075mtp_12mtl_0.0mfp_12mfl_1acc
18
 
19
  This model is a fine-tuned version of [facebook/wav2vec2-large-960h-lv60-self](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self) on the EXPERIMENTS/DATA/ATCOSIM_UWB_ATCC/TRAIN - NA dataset.
20
  It achieves the following results on the evaluation set:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  - Loss: 0.4042
22
  - Wer: 0.1049
23
 
24
- ## Model description
25
 
26
- More information needed
 
 
 
 
 
 
 
 
27
 
28
  ## Intended uses & limitations
29
 
30
- More information needed
 
31
 
32
  ## Training and evaluation data
33
 
34
- More information needed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  ## Training procedure
37
 
 
1
  ---
2
  license: apache-2.0
3
+ language: en
4
+ datasets:
5
+ - Jzuluaga/atcosim_corpus
6
+ - Jzuluaga/uwb_atcc
7
  tags:
8
+ - audio
9
  - automatic-speech-recognition
10
+ - en-atc
11
+ - en
12
  - generated_from_trainer
13
  metrics:
14
  - wer
15
  model-index:
16
+ - name: wav2vec2-large-960h-lv60-self-en-atc-uwb-atcc-and-atcosim
17
+ results:
18
+ - task:
19
+ type: automatic-speech-recognition
20
+ name: Speech Recognition
21
+ dataset:
22
+ type: Jzuluaga/uwb_atcc
23
+ name: UWB-ATCC dataset (Air Traffic Control Communications)
24
+ config: test
25
+ split: test
26
+ metrics:
27
+ - type: wer
28
+ value: 17.48
29
+ name: TEST WER
30
+ verified: False
31
+ - type: wer
32
+ value: 14.26
33
+ name: TEST WER (+LM)
34
+ verified: False
35
+ - task:
36
+ type: automatic-speech-recognition
37
+ name: Speech Recognition
38
+ dataset:
39
+ type: Jzuluaga/atcosim_corpus
40
+ name: ATCOSIM corpus (Air Traffic Control Communications)
41
+ config: test
42
+ split: test
43
+ metrics:
44
+ - type: wer
45
+ value: 1.85
46
+ name: TEST WER
47
+ verified: False
48
+ - type: wer
49
+ value: 1.13
50
+ name: TEST WER (+LM)
51
+ verified: False
52
  ---
53
 
 
 
 
 
54
 
55
  This model is a fine-tuned version of [facebook/wav2vec2-large-960h-lv60-self](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self) on the EXPERIMENTS/DATA/ATCOSIM_UWB_ATCC/TRAIN - NA dataset.
56
  It achieves the following results on the evaluation set:
57
+
58
+ # wav2vec2-large-960h-lv60-self-en-atc-uwb-atcc-and-atcosim
59
+
60
+ This model is a fine-tuned version of [facebook/wav2vec2-large-960h-lv60-self](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self) on two corpus:
61
+ - [UWB-ATCC corpus](https://huggingface.co/datasets/Jzuluaga/uwb_atcc), and
62
+ - [ATCOSIM corpus](https://huggingface.co/datasets/Jzuluaga/atcosim_corpus).
63
+
64
+ <a href="https://colab.research.google.com/github/idiap/w2v2-air-traffic/blob/main/src/eval_xlsr_atc_model.ipynb">
65
+ <img alt="GitHub" src="https://colab.research.google.com/assets/colab-badge.svg\">
66
+ </a>
67
+ <a href="https://github.com/idiap/w2v2-air-traffic">
68
+ <img alt="GitHub" src="https://img.shields.io/badge/GitHub-Open%20source-green\">
69
+ </a>
70
+
71
+
72
+ It achieves the following results on the evaluation set (two tests sets joined together: UWB-ATCC and ATCOSIM):
73
  - Loss: 0.4042
74
  - Wer: 0.1049
75
 
76
+ Paper: [How Does Pre-trained Wav2Vec 2.0 Perform on Domain Shifted ASR? An Extensive Benchmark on Air Traffic Control Communications](https://arxiv.org/abs/2203.16822).
77
 
78
+ Authors: Juan Zuluaga-Gomez, Amrutha Prasad, Iuliia Nigmatulina, Saeed Sarfjoo, Petr Motlicek, Matthias Kleinert, Hartmut Helmke, Oliver Ohneiser, Qingran Zhan
79
+
80
+ Abstract: Recent work on self-supervised pre-training focus</b> on leveraging large-scale unlabeled speech data to build robust end-to-end (E2E)acoustic models (AM) that can be later fine-tuned on downstream tasks e.g., automatic speech recognition (ASR). Yet, few works investigated the impact on performance when the data properties substantially differ between the pre-training and fine-tuning phases, termed domain shift. We target this scenario by analyzing the robustness of Wav2Vec 2.0 and XLS-R models on downstream ASR for a completely unseen domain, air traffic control (ATC) communications. We benchmark these two models on several open-source and challenging ATC databases with signal-to-noise ratio between 5 and 20 dB. Relative word error rate (WER) reductions between 20% to 40% are obtained in comparison to hybrid-based ASR baselines by only fine-tuning E2E acoustic models with a smaller fraction of labeled data. We analyze WERs on the low-resource scenario and gender bias carried by one ATC dataset.
81
+
82
+ Code — GitHub repository: https://github.com/idiap/w2v2-air-traffic
83
+
84
+ ## Usage
85
+
86
+ You can use our Google Colab notebook to run and evaluate our model: https://github.com/idiap/w2v2-air-traffic/blob/master/src/eval_xlsr_atc_model.ipynb
87
 
88
  ## Intended uses & limitations
89
 
90
+ This model was fine-tuned on air traffic control data. We don't expect that it keeps the same performance on some others datasets, e.g., LibriSpeech or CommonVoice.
91
+
92
 
93
  ## Training and evaluation data
94
 
95
+ See Table 1 (page 3) in our paper: [How Does Pre-trained Wav2Vec 2.0 Perform on Domain Shifted ASR? An Extensive Benchmark on Air Traffic Control Communications](https://arxiv.org/abs/2203.16822). We described there the partitions of how to use our model.
96
+
97
+ - We use the UWB-ATCC + ATCOSIM corpus to fine-tune this model. You can download the raw data here:
98
+ - https://lindat.mff.cuni.cz/repository/xmlui/handle/11858/00-097C-0000-0001-CCA1-0 and,
99
+ - https://www.spsc.tugraz.at/databases-and-tools/atcosim-air-traffic-control-simulation-speech-corpus.html
100
+ - However, do not worry, we have prepared the database in `Datasets format`:
101
+ - Here, [UWB-ATCC corpus on HuggingFace](https://huggingface.co/datasets/Jzuluaga/uwb_atcc).
102
+ - Here: [ATCOSIM CORPUS on HuggingFace](https://huggingface.co/datasets/Jzuluaga/atcosim_corpus).
103
+ - If you want to prepare a database in HuggingFace format, you can follow the data loader script in: [data_loader_atc.py](https://huggingface.co/datasets/Jzuluaga/uwb_atcc/blob/main/atc_data_loader.py).
104
+
105
+ ## Writing your own inference script
106
+
107
+ If you use language model, you need to install the KenLM bindings with:
108
+
109
+ ```bash
110
+ conda activate your_environment
111
+ pip install https://github.com/kpu/kenlm/archive/master.zip
112
+ ```
113
+
114
+ The snippet of code:
115
+
116
+ ```python
117
+ from datasets import load_dataset, load_metric, Audio
118
+ import torch
119
+ from transformers import AutoModelForCTC, Wav2Vec2Processor, Wav2Vec2ProcessorWithLM
120
+ import torchaudio.functional as F
121
+
122
+ USE_LM = False
123
+ DATASET_ID = "Jzuluaga/uwb_atcc"
124
+ MODEL_ID = "Jzuluaga/wav2vec2-large-960h-lv60-self-en-atc-uwb-atcc-and-atcosim"
125
+
126
+ # 1. Load the dataset
127
+ # we only load the 'test' partition, however, if you want to load the 'train' partition, you can change it accordingly
128
+ uwb_atcc_corpus_test = load_dataset(DATASET_ID, "test", split="test")
129
+
130
+ # 2. Load the model
131
+ model = AutoModelForCTC.from_pretrained(MODEL_ID)
132
+
133
+ # 3. Load the processors, we offer support with LM, which should yield better resutls
134
+ if USE_LM:
135
+ processor = Wav2Vec2ProcessorWithLM.from_pretrained(MODEL_ID)
136
+ else:
137
+ processor = Wav2Vec2Processor.from_pretrained(MODEL_ID)
138
+ # 4. Format the test sample
139
+ sample = next(iter(uwb_atcc_corpus_test))
140
+ file_sampling_rate = sample['audio']['sampling_rate']
141
+ # resample if neccessary
142
+ if file_sampling_rate != 16000:
143
+ resampled_audio = F.resample(torch.tensor(sample["audio"]["array"]), file_sampling_rate, 16000).numpy()
144
+ else:
145
+ resampled_audio = torch.tensor(sample["audio"]["array"]).numpy()
146
+ input_values = processor(resampled_audio, return_tensors="pt").input_values
147
+
148
+ # 5. Run the forward pass in the model
149
+ with torch.no_grad():
150
+ logits = model(input_values).logits
151
+
152
+ # get the transcription with processor
153
+ if USE_LM:
154
+ transcription = processor.batch_decode(logits.numpy()).text
155
+ else:
156
+ pred_ids = torch.argmax(logits, dim=-1)
157
+ transcription = processor.batch_decode(pred_ids)
158
+ # print the output
159
+ print(transcription)
160
+ ```
161
+
162
+ # Cite us
163
+
164
+ If you use this code for your research, please cite our paper with:
165
+
166
+ ```
167
+ @article{zuluaga2022how,
168
+ title={How Does Pre-trained Wav2Vec2. 0 Perform on Domain Shifted ASR? An Extensive Benchmark on Air Traffic Control Communications},
169
+ author={Zuluaga-Gomez, Juan and Prasad, Amrutha and Nigmatulina, Iuliia and Sarfjoo, Saeed and Motlicek, Petr and Kleinert, Matthias and Helmke, Hartmut and Ohneiser, Oliver and Zhan, Qingran},
170
+ journal={IEEE Spoken Language Technology Workshop (SLT), Doha, Qatar},
171
+ year={2022}
172
+ }
173
+ ```
174
+ and,
175
+
176
+ ```
177
+ @article{zuluaga2022bertraffic,
178
+ title={BERTraffic: BERT-based Joint Speaker Role and Speaker Change Detection for Air Traffic Control Communications},
179
+ author={Zuluaga-Gomez, Juan and Sarfjoo, Seyyed Saeed and Prasad, Amrutha and Nigmatulina, Iuliia and Motlicek, Petr and Ondre, Karel and Ohneiser, Oliver and Helmke, Hartmut},
180
+ journal={IEEE Spoken Language Technology Workshop (SLT), Doha, Qatar},
181
+ year={2022}
182
+ }
183
+ ```
184
+
185
 
186
  ## Training procedure
187