vocabulary.Rd
Return the vocabulary as a vector of words.
vocabulary(model) # S3 method for wordvectors vocabulary(model) # S3 method for wordclusters vocabulary(model)
model | A model as returned by |
---|
# NOT RUN { # setup word2vec Julia dependency setup_word2vec() # sample corpus data("macbeth", package = "word2vec.r") # train model model_path <- word2vec(macbeth) # get word vectors model <- word_vectors(model_path) # get vocabulary vocab <- vocabulary(model) head(vocab) # }