-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhelfrich-1916-translation.R
36 lines (27 loc) · 1.11 KB
/
helfrich-1916-translation.R
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
# The code to run DeepL translator.
source("deeplkey.R")
library(deeplr)
nl <- hform |>
filter(!is.na(dutch)) |>
count(ID, dutch, sort = TRUE) |>
select(-n)
nl <- nl |>
mutate(indonesian = deeplr::translate2(dutch,
target_lang = "ID",
source_lang = "NL",
split_sentences = FALSE,
preserve_formatting = TRUE,
auth_key = deeplkey))
nl |> write_rds("nl_to_idn_via_deeplr.rds")
en <- hform |>
filter(!is.na(english)) |>
count(ID, english, sort = TRUE) |>
select(-n)
en <- en |>
mutate(indonesian = deeplr::translate2(english,
target_lang = "ID",
source_lang = "EN",
split_sentences = FALSE,
preserve_formatting = TRUE,
auth_key = deeplkey))
en |> write_rds("en_to_idn_via_deeplr.rds")