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 |
|
| 29 |
# Wav2Vec2-Large-XLSR-53-Moroccan
|
|
@@ -90,7 +90,8 @@ processor = Wav2Vec2Processor.from_pretrained("othrif/wav2vec2-large-xlsr-morocc
|
|
| 90 |
model = Wav2Vec2ForCTC.from_pretrained("othrif/wav2vec2-large-xlsr-moroccan")
|
| 91 |
model.to("cuda")
|
| 92 |
|
| 93 |
-
chars_to_ignore_regex = '[0
|
|
|
|
| 94 |
#resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
| 95 |
|
| 96 |
# Preprocessing the datasets.
|
|
@@ -100,7 +101,8 @@ def speech_file_to_array_fn(batch):
|
|
| 100 |
batch["text"] = re.sub('[a-zA-z]', '', batch["text"]).lower() + " "
|
| 101 |
batch["text"] = re.sub('[ًٌٍَُِ~]', '', batch["text"]).lower() + " "
|
| 102 |
|
| 103 |
-
# batch["text"] = re.sub('
|
|
|
|
| 104 |
batch["text"] = re.sub("[إأٱآا]", "ا", batch["text"])
|
| 105 |
batch["text"] = re.sub("ڸ", "ل", batch["text"])
|
| 106 |
noise = re.compile(""" ّ | # Tashdid
|
|
@@ -138,7 +140,7 @@ result = test_dataset.map(evaluate, batched=True, batch_size=8)
|
|
| 138 |
print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["text"])))
|
| 139 |
```
|
| 140 |
|
| 141 |
-
**Test Result**:
|
| 142 |
|
| 143 |
|
| 144 |
## Training
|
|
|
|
| 23 |
metrics:
|
| 24 |
- name: Test WER
|
| 25 |
type: wer
|
| 26 |
+
value: 66.45
|
| 27 |
---
|
| 28 |
|
| 29 |
# Wav2Vec2-Large-XLSR-53-Moroccan
|
|
|
|
| 90 |
model = Wav2Vec2ForCTC.from_pretrained("othrif/wav2vec2-large-xlsr-moroccan")
|
| 91 |
model.to("cuda")
|
| 92 |
|
| 93 |
+
chars_to_ignore_regex = '[0\\,\\?\\.\\!\\-\\;\\:\\"\\“\\%\\‘\\”\\�\
|
| 94 |
+
\\@\\ـ\\؟\\*\\ \\#\\'\\ \\…\\\\u2003]'
|
| 95 |
#resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
| 96 |
|
| 97 |
# Preprocessing the datasets.
|
|
|
|
| 101 |
batch["text"] = re.sub('[a-zA-z]', '', batch["text"]).lower() + " "
|
| 102 |
batch["text"] = re.sub('[ًٌٍَُِ~]', '', batch["text"]).lower() + " "
|
| 103 |
|
| 104 |
+
# batch["text"] = re.sub('\\\
|
| 105 |
+
','', batch["text"])
|
| 106 |
batch["text"] = re.sub("[إأٱآا]", "ا", batch["text"])
|
| 107 |
batch["text"] = re.sub("ڸ", "ل", batch["text"])
|
| 108 |
noise = re.compile(""" ّ | # Tashdid
|
|
|
|
| 140 |
print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["text"])))
|
| 141 |
```
|
| 142 |
|
| 143 |
+
**Test Result**: 66.45
|
| 144 |
|
| 145 |
|
| 146 |
## Training
|