powered by
Calculate the sum vector of multiple words.
sum_wordvec(data, x = NULL, verbose = TRUE)
Normalized sum vector.
A wordvec (data.table) or embed (matrix), see data_wordvec_load().
wordvec
embed
data_wordvec_load()
Can be:
NULL: use the sum of all word vectors in data
NULL
data
a single word:
"China"
a vector of words:
c("king", "queen")
cc(" king , queen ; man | woman")
an R formula (~ xxx) specifying words that positively and negatively contribute to the similarity (for word analogy):
~ xxx
~ boy - he + she
~ king - man + woman
~ Beijing - China + Japan
Print information to the console? Defaults to TRUE.
TRUE
Download pre-trained word vectors data (.RData): https://psychbruce.github.io/WordVector_RData.pdf
.RData
normalize()
most_similar()
dict_expand()
dict_reliability()
sum_wordvec(normalize(demodata), ~ king - man + woman)
Run the code above in your browser using DataLab