
Convert translations and coded text fields to a corpus
corpus.qlm_coded.RdConverts a qlm_translate() result, or a text column of a qlm_coded
object, to a quanteda corpus. Quanteda is optional and is needed only when
calling its corpus() generic.
Value
A quanteda corpus with the translation names, or .id, as
document names. If the texts came from a corpus, its docvars and
system and user metadata are restored, and text summary caches are
cleared. Translation provenance is stored in
meta$user$quallmer$translation. For a coded object, the other output
columns, coding metadata and codebook are stored in
meta$user$quallmer$coding.
Examples
if (FALSE) { # \dontrun{
translated <- qlm_translate(c(a = "Bonjour"), "deepl/quality_optimized")
quanteda::corpus(translated)
summaries <- qlm_code(translated, my_summary_codebook, model = "openai/gpt-4o-mini")
quanteda::corpus(summaries, text_field = "summary")
} # }