opentts-uk / examples /remove_accents.py
Yehor Smoliakov
Fixes in data
4436e8b
raw
history blame
327 Bytes
import json
from datasets import load_dataset
def remove_accents(x):
chars = list(x.encode('utf-8').replace(b'\xcc\x81', b'').decode('utf-8'))
return ''.join(chars)
ds = load_dataset("Yehor/tts-mykyta-uk", "tetiana")
for row in ds['train']:
row['text'] = remove_accents(row['text'])
print(json.dumps(row))