data_wordvec_load {PsychWordVec} | R Documentation |
Load word vectors data (wordvec
or embed
) from ".RData" file.
Description
Load word vectors data (wordvec
or embed
) from ".RData" file.
Usage
data_wordvec_load(
file,
as = c("wordvec", "embed"),
normalize = FALSE,
verbose = TRUE
)
load_wordvec(file, normalize = TRUE)
load_embed(file, normalize = TRUE)
Arguments
file |
File name of .RData transformed by |
as |
Load as
|
normalize |
Normalize all word vectors to unit length?
Defaults to |
verbose |
Print information to the console? Defaults to |
Value
A wordvec
(data.table) or embed
(matrix).
Download
Download pre-trained word vectors data (.RData
):
https://psychbruce.github.io/WordVector_RData.pdf
See Also
Examples
d = demodata[1:200]
save(d, file="demo.RData")
d = load_wordvec("demo.RData")
d
d = load_embed("demo.RData")
d
unlink("demo.RData") # delete file for code check
## Not run:
# please first manually download the .RData file
# (see https://psychbruce.github.io/WordVector_RData.pdf)
# or transform plain text data by using `data_transform()`
# the RData file must be on your disk
# the following code cannot run unless you have the file
library(bruceR)
set.wd()
d = load_embed("../data-raw/GloVe/glove_wiki_50d.RData")
d
## End(Not run)
[Package PsychWordVec version 2023.9 Index]