predict_troll: Detect if given texts are trolls

Description Usage Arguments Value Examples

View source: R/predict_troll.R

Description

Detect if given texts are trolls

Usage

1
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

1
2
text <- c("You suck, die!", "What a nice world we have today", "I like you", "I hate you")
(pred <- predict_troll(text))

schliebs/trollR documentation built on May 23, 2019, 2:52 p.m.