Compute the semantic similarity between a text variable and a word norm (i.e., a text represented by one word embedding that represent a construct).

textSimilarityNorm(x, y)

Arguments

x

Word embeddings from textEmbed (with several rows of text).

y

Word embedding from textEmbed (from only one text).

Value

A vector comprising cosine semantic similarity scores.

See also

Examples

if (FALSE) { library(dplyr) library(tibble) harmonynorm <- c("harmony peace ") satisfactionnorm <- c("satisfaction achievement") norms <- tibble::tibble(harmonynorm, satisfactionnorm) wordembeddings <- wordembeddings4 wordembeddings_wordnorm <- textEmbed(norms) similarity_scores <- textSimilarityNorm( wordembeddings$harmonytext, wordembeddings_wordnorm$harmonynorm ) }