Detect if given texts are trolls

predict_troll(x, model_ = NULL, mdl_data_ = NULL)

Arguments

x

a vector of text

model_

a model that is passed to predict, defaults to the model supplied with this package

mdl_data_

a model as returned by build_features (the mdl) containing the vectorizer, tfidf, and the lsa objects. Defaults to the mdl_data from this package.

Value

a vector with the same lengths as x that holds the predicted probabilities that the given text is trolling

Examples

text <- c("You suck, die!", "What a nice world we have today", "I like you", "I hate you") (pred <- predict_troll(text))
#> [1] 0.99461335 0.06459010 0.01856389 0.19459596