model_norm.Rd
Compute the l1 or l2 normalization by normalizing separately for each document in a corpus.
model_norm(corpus, norm = c("l2", "l1")) # S3 method for wrapped model_norm(corpus, norm = c("l2", "l1")) # S3 method for list model_norm(corpus, norm = c("l2", "l1")) # S3 method for python.builtin.list model_norm(corpus, norm = c("l2", "l1")) # S3 method for python.builtin.tuple model_norm(corpus, norm = c("l2", "l1")) load_norm(file)
corpus | Model as returned by |
---|---|
norm | Norm used to normalize, defaults to |
file | Path to a saved model. |
Target dimensionality (num_topics
) of 200–500 is recommended as a “golden standard” https://dl.acm.org/citation.cfm?id=1458105.
#> → Preprocessing 9 documents #> ← 9 documents after perprocessingdictionary <- corpora_dictionary(docs) corpora <- doc2bow(dictionary, docs) # fit model norm <- model_norm(corpora)