Description Usage Arguments Value Examples
View source: R/stylest_predict.R
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.
1 | stylest_predict(model, text, prior = NULL)
|
model |
|
text |
Text vector. May be a |
prior |
Prior probability, defaults to |
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
1 2 3 4 | 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?")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.