model_logentropy: Log Entropy Model

Description Usage Arguments Examples

View source: R/models.R

Description

This module allows simple Bag of Words (BoW) represented corpus to be transformed into log entropy space. It implements Log Entropy Model that produces entropy-weighted logarithmic term frequency representation.

Usage

1
2
3

Arguments

corpus

Model as returned by doc2bow.

normalize

If TRUE, the resulted log entropy weighted vector will be normalized to length of 1, If FALSE - do nothing.

file

Path to a saved model.

Examples

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

# fit model
log_entropy <- model_logentropy(corpora)
wrap(log_entropy, corpora)

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