File size: 1,284 Bytes
09b7d3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe1ed71
 
 
95d7862
 
fe1ed71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95d7862
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
language:
- tr
thumbnail:
tags:
- dataset
- turkish
- ted-multi
- cleaned

license: apache-2.0
datasets:
- ted-multi

---

# Turkish Ted talk translations 
# Created from ted-multi dataset

adding processing steps here if you want another language


```python
#using Turkish as target
target_lang="tr"  # change to your target lang


from datasets import load_dataset
#ted-multi is a multiple language translated dataset
#fits for our case , not to big and curated

dataset = load_dataset("ted_multi")

#there is no Turkish lanugage in europarl, so will need to choose one
dataset.cleanup_cache_files()


#chars_to_ignore_regex = '[,?.!\-\;\:\"“%‘”�—’…–]'  # change to the ignored characters of your fine-tuned model

#will use cahya/wav2vec2-base-turkish-artificial-cv
#checking inside model repository to find which chars removed (no run.sh)
chars_to_ignore_regex = '[\,\?\.\!\-\;\:\"\“\‘\”\'\`…\’»«]'

cols_to_remove =  ['translations', 'talk_name']
dataset = dataset.map(extract_target_lang_entries, remove_columns=cols_to_remove)


dataset_cleaned = dataset.filter(lambda x: x['text'] is not None)
dataset_cleaned

from huggingface_hub import notebook_login

notebook_login()

dataset_cleaned.push_to_hub(f"{target_lang}_ted_talk_translated")

```