read.binary.vectors: Read binary word2vec format files

View source: R/matrixFunctions.R

read.binary.vectorsR Documentation

Read binary word2vec format files

Description

Read binary word2vec format files

Usage

read.binary.vectors(filename, nrows = Inf, cols = "All",
  rowname_list = NULL, rowname_regexp = NULL)

Arguments

filename

A file in the binary word2vec format to import.

nrows

Optionally, a number of rows to stop reading after. Word2vec sorts by frequency, so limiting to the first 1000 rows will give the thousand most-common words; it can be useful not to load the whole matrix into memory. This limit is applied BEFORE 'name_list' and 'name_regexp'.

cols

The column numbers to read. Default is "All"; if you are in a memory-limited environment, you can limit the number of columns you read in by giving a vector of column integers

rowname_list

A whitelist of words. If you wish to read in only a few dozen words, all other rows will be skipped and only these read in.

rowname_regexp

A regular expression specifying a pattern for rows to read in. Row names matching that pattern will be included in the read; all others will be skipped.

Value

A VectorSpaceModel object


bmschmidt/wordVectors documentation built on June 2, 2022, 3:53 p.m.