Description Usage Arguments Details Value Examples
The main function in stylest
, stylest_fit
fits a
model using a corpus of texts labeled by speaker.
1 2 3 4 5 6 7 8 9 10 11 |
x |
Text vector. May be a |
speaker |
Vector of speaker labels. Should be the same length as
|
terms |
If not |
filter |
If not |
smooth |
Numeric value used smooth term frequencies instead of the default of 0.5 |
term_weights |
Dataframe of distances (or any weights) per word in the vocab. This dataframe should have one column $word and a second column $weight_var containing the weight for the word. See the vignette for details. |
fill_method |
if |
fill_weight |
numeric value to fill in as weight for any term
which does not have a weight specified in |
weight_varname |
Name of the column in term_weights containing the weights,
default= |
The user may specify only one of terms
or cutoff
.
If neither is specified, all terms will be used.
A S3 stylest_model
object containing:
speakers
Vector of unique speakers,
filter
text_filter used,
terms
terms used in fitting the model,
ntoken
Vector of number of tokens per speaker,
smooth
Smoothing value,
weights
If not NULL, a named matrix of weights for each term in the vocab,
rate
Matrix of speaker rates for each term in vocabulary
1 2 | data(novels_excerpts)
speaker_mod <- stylest_fit(novels_excerpts$text, novels_excerpts$author)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.