Update README.md
Browse files
README.md
CHANGED
@@ -21,7 +21,7 @@ model-index:
|
|
21 |
metrics:
|
22 |
- name: Test WER
|
23 |
type: wer
|
24 |
-
value: 41.
|
25 |
---
|
26 |
# Wav2Vec2-Large-XLSR-53-Mongolian
|
27 |
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) in Mongolian using the [Common Voice](https://huggingface.co/datasets/common_voice)
|
@@ -43,7 +43,7 @@ import sys
|
|
43 |
|
44 |
model_name = "sammy786/wav2vec2-large-xlsr-mongolian"
|
45 |
device = "cuda"
|
46 |
-
chars_to_ignore_regex = '[
|
47 |
|
48 |
model = Wav2Vec2ForCTC.from_pretrained(model_name).to(device)
|
49 |
processor = Wav2Vec2Processor.from_pretrained(model_name)
|
@@ -72,10 +72,10 @@ def map_to_pred(batch):
|
|
72 |
batch["target"] = batch["sentence"]
|
73 |
return batch
|
74 |
|
75 |
-
result = ds.map(map_to_pred, batched=True, batch_size=
|
76 |
|
77 |
wer = load_metric("wer")
|
78 |
print(wer.compute(predictions=result["predicted"], references=result["target"]))
|
79 |
|
80 |
```
|
81 |
-
**Test Result**: 41.
|
|
|
21 |
metrics:
|
22 |
- name: Test WER
|
23 |
type: wer
|
24 |
+
value: 41.98
|
25 |
---
|
26 |
# Wav2Vec2-Large-XLSR-53-Mongolian
|
27 |
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) in Mongolian using the [Common Voice](https://huggingface.co/datasets/common_voice)
|
|
|
43 |
|
44 |
model_name = "sammy786/wav2vec2-large-xlsr-mongolian"
|
45 |
device = "cuda"
|
46 |
+
chars_to_ignore_regex = '[\\,\\?\\.\\!\\-\\;\\:\\"\\“\\%\\‘\\”\\�]'
|
47 |
|
48 |
model = Wav2Vec2ForCTC.from_pretrained(model_name).to(device)
|
49 |
processor = Wav2Vec2Processor.from_pretrained(model_name)
|
|
|
72 |
batch["target"] = batch["sentence"]
|
73 |
return batch
|
74 |
|
75 |
+
result = ds.map(map_to_pred, batched=True, batch_size=16, remove_columns=list(ds.features.keys()))
|
76 |
|
77 |
wer = load_metric("wer")
|
78 |
print(wer.compute(predictions=result["predicted"], references=result["target"]))
|
79 |
|
80 |
```
|
81 |
+
**Test Result**: 41.98 %
|