Cosine: Compute cosine similarity

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

Description

Computes the cosine similarity for two single words

Usage

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

Arguments

x

A single word, given as a character of length(x) = 1

y

A single word, given as a character of length(y) = 1

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

Instead of using numeric vectors, as the cosine() function from the lsa package does, this function allows for the direct computation of the cosine between two single words (i.e. Characters). which are automatically searched for in the LSA space given in as tvectors.

Value

The cosine similarity as a numeric

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.

Dennis, S. (2007). How to use the LSA Web Site. In T. K. Landauer, D. S. McNamara, S. Dennis, & W. Kintsch (Eds.), Handbook of Latent Semantic Analysis (pp. 35-56). Mahwah, NJ: Erlbaum.

http://lsa.colorado.edu/

See Also

distance asym

Examples

1
2
3
data(wonderland)

Cosine("alice","rabbit",tvectors=wonderland)

codymarquart/LSAfun2 documentation built on May 13, 2019, 8:48 p.m.