WordClusters: Word Clusters Reference Class

Description Usage Format Methods Examples

Description

Convert the output of word_clusters into a convenient reference class.

Usage

1

Format

An object of class R6ClassGenerator of length 24.

Methods

All methods applicable to objects of class wordclusters as returned by word_clusters are valid here. See their respective man pages for documentation on their arguments and return values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# setup word2vec Julia dependency
setup_word2vec()

# sample corpus
data("macbeth", package = "word2vec.r")

# train model
model_path <- word2clusters(macbeth, classes = 15L)

# get word vectors
model <- word_clusters(model_path)
wc <- WordClusters$new(model)
wc$get_words(4L)
wc$in_vocabulary("cake")

## End(Not run)

news-r/word2vec.r documentation built on Nov. 4, 2019, 9:41 p.m.