Randomly samples words within a given similarity range to the input
Usage
choose.target(x,lower,upper,n,tvectors=tvectors)
Value
A named numeric vector. The names of the vector give the target words, the entries their respective cosine similarity to the input.
Arguments
x
a character vector of length(x) = 1 specifying a word or a sentence/document
lower
the lower bound of the similarity range; a numeric
upper
the upper bound of the similarity range; a numeric
n
an integer giving the number of target words to be sampled
tvectors
the semantic space in which the computation is to be done (a numeric matrix where every row is a word vector)
Author
Fritz Guenther
Details
Computes cosine values between the input x and all the word vectors in tvectors. Then only selects words with a cosine similarity between lower and upper to the input, and randomly samples n of these words.
This function is designed for randomly selecting target words with a predefined similarity towards a given prime word (or sentence/document).
References
Landauer, T.K., & Dumais, S.T. (1997). A solution to Plato's problem: The Latent Semantic Analysis theory of acquisition, induction and representation of knowledge. Psychological Review, 104, 211-240.