stylest_predict: Predict the most likely speaker of a text
Description
Use a fitted stylest_model to predict the most likely speaker of a text.
This function may be used on in-sample or out-of-sample texts.
Usage
stylest_predict(model, text, prior = NULL)
Arguments
model
stylest_model object
text
Text vector. May be a corpus_frame object
prior
Prior probability, defaults to NULL
Value
stylest_predict object containing:
model the fitted stylest_model object used in prediction,
predicted the predicted speaker,
log_probs matrix of log probabilities,
log_prior matrix of log prior probabilities
# NOT RUN {data(novels_excerpts)
speaker_mod <- stylest_fit(novels_excerpts$text, novels_excerpts$author)
stylest_predict(speaker_mod, "This is an example text, who wrote it?")
# }