cowsay::say("Это заготовка для главы. Загляните позже.", "egret")
-------------------------------------------
<Это заготовка для главы. Загляните позже.>
-------------------------------------------
\
\
_,
-==<' `
) /
/ (_.
| ,-,`\
\\ \ \
`\, \ \
||\ \`|,
jgs _|| `=`-'
~~`~`
Многоклассовая классификация может использоваться для определения автора, жанра, тематики или эмоциональной тональности текста.
library(tidyverse)
library(textrecipes)
library(tidymodels)
Данные
load("../data/greek_corpus.Rdata")
greek_corpus |>
count(corpus) |>
ggplot(aes(reorder(corpus, n), n, fill = corpus)) +
geom_bar(stat = "identity", show.legend = FALSE) +
coord_flip() +
xlab(NULL) +
ylab(NULL) +
scale_fill_viridis_d() +
theme_light() +
geom_text(aes(label = n), nudge_y = 4, color = "grey40")
set.seed(06022025)
data_split <- initial_split(greek_corpus, strata = corpus)
data_train <- training(data_split)[-2]
data_test <- testing(data_split)[-2]
data_train