get_documents_topics: Get Document Topics

Description Usage Arguments Examples

Description

Get document-topics matrix.

Usage

1
2
3
4
get_docs_topics(corpus)

## S3 method for class 'gensim.interfaces.CorpusABC'
get_docs_topics(corpus)

Arguments

corpus

Corpus.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
docs <- prepare_documents(corpus)
dictionary <- corpora_dictionary(docs)
corpora <- doc2bow(dictionary, docs)
corpus_mm <- serialize_mmcorpus(corpora)
tfidf <- model_tfidf(corpus_mm)
corpus_transformed <- wrap(tfidf, corpora)

# fit model
lsi <- model_lsi(corpus_transformed, id2word = dictionary, num_topics = 2L)
wrapped_corpus <- wrap(lsi, corpus_transformed)
get_docs_topics(wrapped_corpus)

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