View source: R/03_check_lang.R
| check_lang | R Documentation |
Many, if not all, large language models are biased to English
terms and sentence constructions. This function performs a quick check with
cld2 over every element of a string of
characters and returns whether it is mostly (75
check_lang(strings, detailed = FALSE)
strings |
character. Vector of strings containing document sentences. |
detailed |
bool. If TRUE, the full cld2 report is returned as well. |
logical. If TRUE the language of the string is mostly English.
If detailed is TRUE a list is instead returned for the full document.
# English
check_lang("Species Macrothele calpeiana is found in Alentejo.")
# Portuguese
check_lang("A espécie Macrothele calpeiana é encontrada no Alentejo.")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.