Fix the final "```"
Browse files
README.md
CHANGED
@@ -39,7 +39,7 @@ model = Wav2Vec2ForCTC.from_pretrained("Marxav/wav2vec2-large-xlsr-53-breton")
|
|
39 |
|
40 |
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
41 |
|
42 |
-
chars_to_ignore_regex = '[
|
43 |
|
44 |
# Preprocessing the datasets.
|
45 |
# We need to read the audio files as arrays
|
@@ -67,7 +67,7 @@ print("Reference:", test_dataset["sentence"][:nb_samples])
|
|
67 |
```
|
68 |
The above code leads to the following prediction for the first two samples:
|
69 |
* Prediction: ["nel ler ket dont abenn eus netra la vez ser mirc'hid evel sij", 'an eil hag egile']
|
70 |
-
* Reference: ['"N
|
71 |
|
72 |
The model can be evaluated as follows on the {language} test data of Common Voice.
|
73 |
```python
|
@@ -85,7 +85,7 @@ processor = Wav2Vec2Processor.from_pretrained('Marxav/wav2vec2-large-xlsr-53-bre
|
|
85 |
model = Wav2Vec2ForCTC.from_pretrained('Marxav/wav2vec2-large-xlsr-53-breton2')
|
86 |
model.to("cuda")
|
87 |
|
88 |
-
chars_to_ignore_regex = '[
|
89 |
|
90 |
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
91 |
|
@@ -119,4 +119,5 @@ def evaluate(batch):
|
|
119 |
|
120 |
result = test_dataset.map(evaluate, batched=True, batch_size=8)
|
121 |
|
122 |
-
print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["sentence"])))
|
|
|
|
39 |
|
40 |
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
41 |
|
42 |
+
chars_to_ignore_regex = '[\\\\\\\\,\\\\,\\\\?\\\\.\\\\!\\\\;\\\\:\\\\"\\\\“\\\\%\\\\”\\\\�\\\\(\\\\)\\\\/\\\\«\\\\»\\\\½\\\\…]'
|
43 |
|
44 |
# Preprocessing the datasets.
|
45 |
# We need to read the audio files as arrays
|
|
|
67 |
```
|
68 |
The above code leads to the following prediction for the first two samples:
|
69 |
* Prediction: ["nel ler ket dont abenn eus netra la vez ser mirc'hid evel sij", 'an eil hag egile']
|
70 |
+
* Reference: ['"N\\\\\\\\'haller ket dont a-benn eus netra pa vezer nec\\\\\\\\'het evel-se."', 'An eil hag egile.']
|
71 |
|
72 |
The model can be evaluated as follows on the {language} test data of Common Voice.
|
73 |
```python
|
|
|
85 |
model = Wav2Vec2ForCTC.from_pretrained('Marxav/wav2vec2-large-xlsr-53-breton2')
|
86 |
model.to("cuda")
|
87 |
|
88 |
+
chars_to_ignore_regex = '[\\\\\\\\,\\\\,\\\\?\\\\.\\\\!\\\\;\\\\:\\\\"\\\\“\\\\%\\\\”\\\\�\\\\(\\\\)\\\\/\\\\«\\\\»\\\\½\\\\…]'
|
89 |
|
90 |
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
91 |
|
|
|
119 |
|
120 |
result = test_dataset.map(evaluate, batched=True, batch_size=8)
|
121 |
|
122 |
+
print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["sentence"])))
|
123 |
+
```
|