train_naive_classifier.Rd
Train Naive Bayes classifier (init_naive_classifer
).
train_naive_classifier(model, data, text, labels) # S3 method for naive_bayes_model train_naive_classifier(model, data, text, labels)
model | A naive Bayes classifier as returned by
|
---|---|
data | A data.frame containing |
text | Text to train model on |
labels | Bare column name containing labels. |
# NOT RUN { init_textanalysis() classes <- factor(c("financial", "legal")) model <- init_naive_classifer(classes) train <- tibble::tibble( text = c("this is financial doc", "this is legal doc"), labels = factor("financial", "legal") ) train_naive_classifier(model, train, text, labels) # }