model_at: Author-topic Model

Description Usage Arguments See Also Examples

View source: R/models.R

Description

Author-topic Model

Usage

1
2
3

Arguments

corpus

Model as returned by mmcorpus_serialize.

...

Any other options, from the ยจ official documentation.

file

Path to a saved model.

See Also

get_author_topics

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
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)

## End(Not run)

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