if (FALSE) {
# Processing time is often longer than ten seconds
# because the function uses a large language model.
### Example 1: QDA data on chocolates ###
library(NaileR)
library(SensoMineR)
data(chocolates)
intro_sensochoc <- "Six chocolates were measured according
to sensory attributes by a trained panel.
I will give you the results from this study.
You will have to identify what sets these chocolates apart."
intro_sensochoc <- gsub('\n', ' ', intro_sensochoc) |>
stringr::str_squish()
req_sensochoc <- "Please explain what makes each chocolate distinct
and provide a sensory profile of each chocolate."
req_sensochoc <- gsub('\n', ' ', req_sensochoc) |>
stringr::str_squish()
res_nail_qda <- nail_qda(sensochoc,
formul="~Product+Panelist",
firstvar = 5,
introduction = intro_sensochoc,
request = NULL,
model = 'llama3',
isolate.groups = FALSE,
drop.negative = FALSE,
proba = 0.05,
generate = TRUE)
cat(res_nail_qda$response)
}
Run the code above in your browser using DataLab