stylest2_fit: Fit speaker model to document-feature matrix
Description
This function generates a model of speaker/author attribution, given a document-feature
matrix.
Usage
stylest2_fit(
dfm,
smoothing = 0.5,
terms = NULL,
term_weights = NULL,
fill_weight = NULL
)
Value
An S3 object, a model with with each term that occurs in the text, the
frequency of use for each author, and the frequency of that terms' occurrence
through the texts.
Arguments
- dfm
a quanteda dfm object
- smoothing
the smoothing parameter value for smoothing the dfm. Should
be a numeric scalar, default to 0.5.
- terms
If not NULL, terms to be used in the model. If NULL,
use all terms.
- term_weights
Named vector of distances (or any weights) per term in the
vocab. Names should correspond to the term.
- fill_weight
Numeric value to fill in as weight for any term which does
not have a weight specified in term_weights.
Examples
Run this codedata(novels_dfm)
stylest2_fit(dfm = novels_dfm)
Run the code above in your browser using DataLab