Commit
•
08a76a0
1
Parent(s):
e4ab2bd
Update README.md
Browse files
README.md
CHANGED
@@ -133,14 +133,14 @@ test_dataset = test_dataset.map(speech_file_to_array_fn)
|
|
133 |
# Preprocessing the datasets.
|
134 |
# We need to read the audio files as arrays
|
135 |
def evaluate(batch):
|
136 |
-
|
137 |
|
138 |
-
|
139 |
-
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
|
145 |
result = test_dataset.map(evaluate, batched=True, batch_size=8)
|
146 |
|
@@ -153,7 +153,7 @@ print(f"CER: {cer.compute(predictions=predictions, references=references, chunk_
|
|
153 |
|
154 |
**Test Result**:
|
155 |
|
156 |
-
|
157 |
|
158 |
| Model | WER | CER |
|
159 |
| ------------- | ------------- | ------------- |
|
|
|
133 |
# Preprocessing the datasets.
|
134 |
# We need to read the audio files as arrays
|
135 |
def evaluate(batch):
|
136 |
+
\\tinputs = processor(batch["speech"], sampling_rate=16_000, return_tensors="pt", padding=True)
|
137 |
|
138 |
+
\\twith torch.no_grad():
|
139 |
+
\\t\\tlogits = model(inputs.input_values.to(DEVICE), attention_mask=inputs.attention_mask.to(DEVICE)).logits
|
140 |
|
141 |
+
\\tpred_ids = torch.argmax(logits, dim=-1)
|
142 |
+
\\tbatch["pred_strings"] = processor.batch_decode(pred_ids)
|
143 |
+
\\treturn batch
|
144 |
|
145 |
result = test_dataset.map(evaluate, batched=True, batch_size=8)
|
146 |
|
|
|
153 |
|
154 |
**Test Result**:
|
155 |
|
156 |
+
In the table below I report the Word Error Rate (WER) and the Character Error Rate (CER) of the model. I ran the evaluation script described above on other models as well (on 2021-04-22). Note that the table below may show different results from those already reported, this may have been caused due to some specificity of the other evaluation scripts used.
|
157 |
|
158 |
| Model | WER | CER |
|
159 |
| ------------- | ------------- | ------------- |
|