summary.top2vec {doc2vec}R Documentation

Get summary information of a top2vec model

Description

Get summary information of a top2vec model. Namely the topic centers and the most similar words to a certain topic

Usage

## S3 method for class 'top2vec'
summary(
  object,
  type = c("similarity", "c-tfidf"),
  top_n = 10,
  data = object$data,
  embedding_words = object$embedding$words,
  embedding_docs = object$embedding$docs,
  ...
)

Arguments

object

an object of class top2vec as returned by top2vec

type

a character string with the type of summary information to extract for the topwords. Either 'similarity' or 'c-tfidf'. The first extracts most similar words to the topic based on semantic similarity, the second by extracting the words with the highest tf-idf score for each topic

top_n

integer indicating to find the top_n most similar words to a topic

data

a data.frame with columns 'doc_id' and 'text' representing documents. For each topic, the function extracts the most similar documents. And in case type is 'c-tfidf' it get the words with the highest tf-idf scores for each topic.

embedding_words

a matrix of word embeddings to limit the most similar words to. Defaults to the embedding of words from the object

embedding_docs

a matrix of document embeddings to limit the most similar documents to. Defaults to the embedding of words from the object

...

not used

Examples

# For an example, look at the documentation of ?top2vec

[Package doc2vec version 0.2.0 Index]