Intro Thoughts
Status Quo
library(tidyverse)
Experiment
library(mall)
options(.mall_chat = ellmer::chat_google_gemini())
## Using model = "gemini-2.5-flash".
colors_not_num <- colors()[!(colors() |> str_detect("1|2|3|4|5|6|7|8|9|10"))]
df <- tribble(~item, ~times,
"cat", 1,
"peacock", 2,
"bear", 3,
"mammoth", 4) |>
llm_classify(item,
labels = sample(colors_not_num, 20, replace = F),
pred_name = "color")
df
## # A tibble: 4 × 3
## item times color
## <chr> <dbl> <chr>
## 1 cat 1 gray
## 2 peacock 2 chartreuse
## 3 bear 3 goldenrod
## 4 mammoth 4 gray
df |>
ggplot() +
aes(x = item) +
geom_bar() +
aes(fill = I(color))
