Description Usage Arguments Details Value Author(s) References See Also Examples
Selects the nearest word to an input out of a set of options
1 | MultipleChoice(x,y,tvectors=tvectors,breakdown=TRUE)
|
x |
a character vector of |
y |
a character vector specifying multiple answer options |
tvectors |
the semantic space in which the computation is to be done (a numeric matrix where every row is a word vector) |
breakdown |
if |
Computes all the cosines between a given sentence/document or word and multiple answer options. Then
selects the nearest option to the input (the option with the highest cosine).This function relies entirely on the costring
function.
A warning message will be displayed if all words of one answer alternative are not found in the semantic space.
The nearest option to x
as a character
Fritz Günther
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.
1 2 3 4 5 | data(wonderland)
LSAfun:::MultipleChoice("Who does the march hare celebrate his unbirthday with?",
c("Mad Hatter","Red Queen","Caterpillar","Cheshire Cat"),
tvectors=wonderland)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.