model_norm: Normalization Model

Description Usage Arguments Details Examples

View source: R/models.R

Description

Compute the l1 or l2 normalization by normalizing separately for each document in a corpus.

Usage

1
2
3
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

1
2
3
4
5
6
docs <- prepare_documents(corpus)
dictionary <- corpora_dictionary(docs)
corpora <- doc2bow(dictionary, docs)

# fit model
norm <- model_norm(corpora)

news-r/gensimr documentation built on Jan. 9, 2021, 5:55 a.m.