index2.Rd
Return the index of the work in the vectors.
index(model, word) # S3 method for wordvectors index(model, word) # S3 method for wordclusters index(model, word)
model | A model as returned by |
---|---|
word | The word to extract. |
# 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) # cindex of macbeth index(model, "macbeth") # }