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.

model_logentropy(corpus, normalize = FALSE)

# S3 method for python.builtin.tuple
model_logentropy(corpus,
  normalize = FALSE)

load_logentropy(file)

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

docs <- prepare_documents(corpus)
#> Preprocessing 9 documents #> 9 documents after perprocessing
dictionary <- corpora_dictionary(docs) corpora <- doc2bow(dictionary, docs) # fit model log_entropy <- model_logentropy(corpora) wrap(log_entropy, corpora)
#> <gensim.interfaces.TransformedCorpus>