Dear all,
I have been trying to translate a corpus for a research that I am conducting. After several fruitless searches I came across the deeplr package. I have read the documentation, however I have been unable to utilise the package. I am doing a topic modelling analysis for French politicians on Twitter.
Since I was unable to translate the corpus I though that maybe I could use it for a smaller amount of data. I created a graph with the topics in the corpus in order of prevalence along with the top words that contribute to each topic. And I thought that I could translate just the words in the graph. However, I have failed yet again. I even tried to download a package to translate data frames but it does not work: GitHub - paulcbauer/deeplr: Translate in R using DeepL.
I am kind of lost due to my inexperience and the previous searches that did not turn out anything. Does anyone have any ideas on how to translate the data, or if there are any packages that could be utilised? I have attached my code here. I thank you in advance for your help.
Best regards,
M
library(rtweet)
library(tidyverse); theme_set(theme_minimal())
#> Warning: package 'tidyverse' was built under R version 4.0.5
#> Warning: package 'ggplot2' was built under R version 4.0.4
#> Warning: package 'tibble' was built under R version 4.0.5
#> Warning: package 'tidyr' was built under R version 4.0.5
#> Warning: package 'dplyr' was built under R version 4.0.5
#> Warning: package 'forcats' was built under R version 4.0.5
library(quanteda)
#> Warning: package 'quanteda' was built under R version 4.0.4
#> Package version: 2.1.2
#> Parallel computing: 2 of 8 threads used.
#> See https://quanteda.io for tutorials and examples.
#>
#> Attaching package: 'quanteda'
#> The following object is masked from 'package:utils':
#>
#> View
library(stm)
#> stm v1.3.6 successfully loaded. See ?stm for help.
#> Papers, resources, and other materials at structuraltopicmodel.com
library(seededlda)
#> Warning: package 'seededlda' was built under R version 4.0.4
#>
#> Attaching package: 'seededlda'
#> The following object is masked from 'package:stats':
#>
#> terms
library(stopwords)
#> Warning: package 'stopwords' was built under R version 4.0.4
library(stringi)
library(deeplr)
#>
#> Attaching package: 'deeplr'
#> The following object is masked from 'package:purrr':
#>
#> detect
LePen_tr<-LePen_weighted %>% toEnglish2(
text,
source_lang = "FR",
split_sentences = FALSE,
preserve_formatting = FALSE,
get_detect = FALSE,
auth_key = my_key
)
#> Error in toEnglish2(., text, source_lang = "FR", split_sentences = FALSE, : unused argument (text)
Created on 2021-08-13 by the reprex package (v2.0.1)