if (FALSE) {
# Processing time is often longer than ten seconds
# because the function uses a large language model.
library(FactoMineR)
library(NaileR)
library(dplyr)
data(car_alone)
sampled_car_alone <- car_alone %>%
group_by(car_alone_capable_restrictive) %>%
sample_frac(0.5)
sampled_car_alone <- as.data.frame(sampled_car_alone)
intro_car <- "Knowing the impact on the climate,
I have made these choices based on
the following benefits and constraints..."
intro_car <- gsub('\n', ' ', intro_car) |>
stringr::str_squish()
res_nail_textual <- nail_textual(sampled_car_alone, num.var = 1,
num.text = 2,
introduction = intro_car,
request = NULL,
model = 'llama3', isolate.groups = TRUE,
generate = TRUE)
res_nail_textual[[1]]$response |> cat()
res_nail_textual[[3]]$response |> cat()
res_nail_textual[[2]]$response |> cat()
res_nail_textual[[4]]$response |> cat()
}
Run the code above in your browser using DataLab