MultipleChoice: Answers Multiple Choice Questions

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Selects the nearest word to an input out of a set of options

Usage

1
MultipleChoice(x,y,tvectors=tvectors,breakdown=TRUE)

Arguments

x

a character vector of length(x) = 1 specifying a sentence/ document (or also a single word)

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 TRUE, the function breakdown is applied to the input

Details

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.

Value

The nearest option to x as a character

Author(s)

Fritz Günther

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.

See Also

cosine, Cosine, costring

Examples

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)

codymarquart/LSAfun documentation built on May 13, 2019, 8:47 p.m.