View source: R/matrixFunctions.R
read.vectors | R Documentation |
Read a VectorSpaceModel from a file exported from word2vec or a similar output format.
read.vectors(filename, vectors = guess_n_cols(), binary = NULL, ...)
filename |
The file to read in. |
vectors |
The number of dimensions word2vec calculated. Imputed automatically if not specified. |
binary |
Read in the binary word2vec form. (Wraps 'read.binary.vectors') By default, function guesses based on file suffix. |
... |
Further arguments passed to read.table or read.binary.vectors. Note that both accept 'nrows' as an argument. Word2vec produces by default frequency sorted output. Therefore 'read.vectors("file.bin", nrows=500)', for example, will return the vectors for the top 500 words. This can be useful on machines with limited memory. |
An matrixlike object of class 'VectorSpaceModel'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.