if (FALSE) {
# Processing time is often longer than ten seconds
# because the function uses a large language model.
library(NaileR)
data(beard_wide)
intro_beard <- "As a barber, you make
recommendations based on consumers comments.
Examples of consumers descriptions of beards
are as follows."
intro_beard <- gsub('\n', ' ', intro_beard) |>
stringr::str_squish()
req_beard <- "Each group should contain beards with descriptions
that relate to a similar type of person - not
necessarily the same person, but sharing common traits.
Each group must have a short,
meaningful name that characterizes the person."
req_beard <- gsub('\n', ' ', req_beard) |>
stringr::str_squish()
res <- nail_sort(beard_wide[,1:5], name_size = 3,
stimulus_id = "beard", introduction = intro_beard,
measure = 'the description was',
request = req_beard,
nb.clusters = 6,
generate = TRUE)
cat(res$prompt_llm[[1]])
cat(res$res_llm[[1]])
res$dta_sort
}
Run the code above in your browser using DataLab