get_author_topics: Get Author topics

Description Usage Arguments Examples

View source: R/models.R

Description

Construct vectors of topics for each author.

Usage

1

Arguments

auth2doc

Output of model_at.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
docs <- prepare_documents(corpus)
dictionary <- corpora_dictionary(docs)
corpora <- doc2bow(dictionary, docs)
corpus_mm <- serialize_mmcorpus(corpora)

# fit model
auth2doc <- auth2doc(authors, name, document)

## Not run: 
# create temp to hold serialized data
temp <- tempfile("serialized")

atmodel <- model_at(
  corpus_mm, 
  id2word = dictionary, 
  author2doc = auth2doc, 
  num_topics = 2L, 
  serialized = TRUE,
  serialization_path = temp
)

# delete temp
unlink(temp, recursive = TRUE)
get_author_topics(atmodel)

## End(Not run)

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