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:
|
25 |
---
|
26 |
# Wav2Vec2-Large-XLSR-53-Maltese
|
27 |
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) in Maltese using the [Common Voice](https://huggingface.co/datasets/common_voice)
|
@@ -41,7 +41,7 @@ import sys
|
|
41 |
|
42 |
model_name = "Akashpb13/xlsr_maltese_wav2vec2"
|
43 |
device = "cuda"
|
44 |
-
chars_to_ignore_regex = '[
|
45 |
|
46 |
model = Wav2Vec2ForCTC.from_pretrained(model_name).to(device)
|
47 |
processor = Wav2Vec2Processor.from_pretrained(model_name)
|
@@ -70,10 +70,10 @@ def map_to_pred(batch):
|
|
70 |
batch["target"] = batch["sentence"]
|
71 |
return batch
|
72 |
|
73 |
-
result = ds.map(map_to_pred, batched=True, batch_size=
|
74 |
|
75 |
wer = load_metric("wer")
|
76 |
print(wer.compute(predictions=result["predicted"], references=result["target"]))
|
77 |
|
78 |
```
|
79 |
-
**Test Result**:
|
|
|
21 |
metrics:
|
22 |
- name: Test WER
|
23 |
type: wer
|
24 |
+
value: 29.42
|
25 |
---
|
26 |
# Wav2Vec2-Large-XLSR-53-Maltese
|
27 |
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) in Maltese using the [Common Voice](https://huggingface.co/datasets/common_voice)
|
|
|
41 |
|
42 |
model_name = "Akashpb13/xlsr_maltese_wav2vec2"
|
43 |
device = "cuda"
|
44 |
+
chars_to_ignore_regex = '[\\,\\?\\.\\!\\-\\;\\:\\"\\“\\%\\‘\\”\\�\\)\\(\\*)]'
|
45 |
|
46 |
model = Wav2Vec2ForCTC.from_pretrained(model_name).to(device)
|
47 |
processor = Wav2Vec2Processor.from_pretrained(model_name)
|
|
|
70 |
batch["target"] = batch["sentence"]
|
71 |
return batch
|
72 |
|
73 |
+
result = ds.map(map_to_pred, batched=True, batch_size=1, remove_columns=list(ds.features.keys()))
|
74 |
|
75 |
wer = load_metric("wer")
|
76 |
print(wer.compute(predictions=result["predicted"], references=result["target"]))
|
77 |
|
78 |
```
|
79 |
+
**Test Result**: 29.42 %
|