dict_expand | R Documentation |
Expand a dictionary from the most similar words.
dict_expand(data, words, threshold = 0.5, iteration = 5, verbose = TRUE)
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 |
An expanded list (character vector) of words.
Download pre-trained word vectors data (.RData
):
https://psychbruce.github.io/WordVector_RData.pdf
sum_wordvec
most_similar
dict_reliability
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"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.