fit_term_usage: Internal stylest2 function to compute term usage

View source: R/stylest2_fit.R

fit_term_usageR Documentation

Internal stylest2 function to compute term usage

Description

Internal stylest2 function to compute term usage

Usage

fit_term_usage(dfm, smoothing, terms, term_weights)

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.

Value

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.


stylest2 documentation built on May 29, 2024, 1:50 a.m.