Views
No views yet
import re
chars_to_ignore_regex = '[\,\?\.\!\;\:\"\”\’\'\“\(\)\[\\\\&/!\‘]' # delete following chars
chars_to_space_regex = '[\–\—\-]' # replace the following chars into space
def remove_special_characters(batch):
batch["sentence"] = re.sub(chars_to_ignore_regex, '', batch["sentence"]).lower() + " "
batch["sentence"] = re.sub(chars_to_space_regex, ' ', batch["sentence"]) + " "
# replacing some character
batch["sentence"] = batch["sentence"].replace("é", "e").replace("á", "a").replace("ł", "l").replace("ń", "n").replace("ō", "o").strip()
return batch
common_voice = common_voice.map(remove_special_characters)| Training Loss | Epoch | Step | Validation Loss | Wer |
|---|---|---|---|---|
| 0.0706 | 1.9231 | 1000 | 0.2361 | 18.0484 |
| 0.0099 | 3.8462 | 2000 | 0.1875 | 10.3607 |
| 0.001 | 5.7692 | 3000 | 0.1760 | 9.1737 |