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)

Arguments

corpus

Model as returned by wrap.

norm

Norm used to normalize, defaults to l2.

file

Path to a saved model.

Details

Target dimensionality (num_topics) of 200–500 is recommended as a “golden standard” https://dl.acm.org/citation.cfm?id=1458105.

Examples

docs <- prepare_documents(corpus)
#> Preprocessing 9 documents #> 9 documents after perprocessing
dictionary <- corpora_dictionary(docs) corpora <- doc2bow(dictionary, docs) # fit model norm <- model_norm(corpora)