dict_expand {PsychWordVec} | R Documentation |
Expand a dictionary from the most similar words.
Description
Expand a dictionary from the most similar words.
Usage
dict_expand(data, words, threshold = 0.5, iteration = 5, verbose = TRUE)
Arguments
data |
A |
words |
A single word or a list of words, used to calculate the sum vector. |
threshold |
Threshold of cosine similarity,
used to find all words with similarities higher than this value.
Defaults to |
iteration |
Number of maximum iterations. Defaults to |
verbose |
Print information to the console? Defaults to |
Value
An expanded list (character vector) of words.
Download
Download pre-trained word vectors data (.RData
):
https://psychbruce.github.io/WordVector_RData.pdf
See Also
Examples
dict = dict_expand(demodata, "king")
dict
dict = dict_expand(demodata, cc("king, queen"))
dict
most_similar(demodata, dict)
dict.cn = dict_expand(demodata, "China")
dict.cn # too inclusive if setting threshold = 0.5
dict.cn = dict_expand(demodata,
cc("China, Chinese"),
threshold=0.6)
dict.cn # adequate to represent "China"
[Package PsychWordVec version 2023.9 Index]