patrickvonplaten
commited on
Commit
·
75efdd5
1
Parent(s):
aade66c
Update README.md
Browse files
README.md
CHANGED
@@ -23,7 +23,7 @@ model-index:
|
|
23 |
metrics:
|
24 |
- name: Test WER
|
25 |
type: wer
|
26 |
-
value:
|
27 |
---
|
28 |
# Wav2Vec2-Large-XLSR-53-Assamese
|
29 |
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) on Assamese using the [Common Voice](https://huggingface.co/datasets/common_voice).
|
@@ -66,14 +66,14 @@ wer = load_metric("wer")
|
|
66 |
processor = Wav2Vec2Processor.from_pretrained("anuragshas/wav2vec2-large-xlsr-as")
|
67 |
model = Wav2Vec2ForCTC.from_pretrained("anuragshas/wav2vec2-large-xlsr-as")
|
68 |
model.to("cuda")
|
69 |
-
chars_to_ignore_regex = '[
|
70 |
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
71 |
# Preprocessing the datasets.
|
72 |
# We need to read the aduio files as arrays
|
73 |
def speech_file_to_array_fn(batch):
|
74 |
batch["sentence"] = re.sub('’ ',' ',batch["sentence"])
|
75 |
batch["sentence"] = re.sub(' ‘',' ',batch["sentence"])
|
76 |
-
batch["sentence"] = re.sub('’|‘','
|
77 |
batch["sentence"] = re.sub(chars_to_ignore_regex, '', batch["sentence"]).lower()
|
78 |
speech_array, sampling_rate = torchaudio.load(batch["path"])
|
79 |
batch["speech"] = resampler(speech_array).squeeze().numpy()
|
@@ -91,6 +91,6 @@ def evaluate(batch):
|
|
91 |
result = test_dataset.map(evaluate, batched=True, batch_size=8)
|
92 |
print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["sentence"])))
|
93 |
```
|
94 |
-
**Test Result**:
|
95 |
## Training
|
96 |
The Common Voice `train` and `validation` datasets were used for training.
|
|
|
23 |
metrics:
|
24 |
- name: Test WER
|
25 |
type: wer
|
26 |
+
value: 69.63
|
27 |
---
|
28 |
# Wav2Vec2-Large-XLSR-53-Assamese
|
29 |
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) on Assamese using the [Common Voice](https://huggingface.co/datasets/common_voice).
|
|
|
66 |
processor = Wav2Vec2Processor.from_pretrained("anuragshas/wav2vec2-large-xlsr-as")
|
67 |
model = Wav2Vec2ForCTC.from_pretrained("anuragshas/wav2vec2-large-xlsr-as")
|
68 |
model.to("cuda")
|
69 |
+
chars_to_ignore_regex = '[\\,\\?\\.\\!\\-\\;\\:\\"\\“\\%\\”\\়\\।]'
|
70 |
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
71 |
# Preprocessing the datasets.
|
72 |
# We need to read the aduio files as arrays
|
73 |
def speech_file_to_array_fn(batch):
|
74 |
batch["sentence"] = re.sub('’ ',' ',batch["sentence"])
|
75 |
batch["sentence"] = re.sub(' ‘',' ',batch["sentence"])
|
76 |
+
batch["sentence"] = re.sub('’|‘','\\'',batch["sentence"])
|
77 |
batch["sentence"] = re.sub(chars_to_ignore_regex, '', batch["sentence"]).lower()
|
78 |
speech_array, sampling_rate = torchaudio.load(batch["path"])
|
79 |
batch["speech"] = resampler(speech_array).squeeze().numpy()
|
|
|
91 |
result = test_dataset.map(evaluate, batched=True, batch_size=8)
|
92 |
print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["sentence"])))
|
93 |
```
|
94 |
+
**Test Result**: 69.63 %
|
95 |
## Training
|
96 |
The Common Voice `train` and `validation` datasets were used for training.
|