Learn R Programming

text (version 0.9.50)

textSimilarity: Compute the cosine semantic similarity between two text variables.

Description

Compute the cosine semantic similarity between two text variables.

Usage

textSimilarity(x, y)

Arguments

x

Word embeddings from textEmbed.

y

Word embeddings from textEmbed.

Value

A vector comprising cosine semantic similarity scores.

See Also

see textSimilarityNorm and textSimilarityTest

Examples

Run this code
# NOT RUN {
library(dplyr)
word_embeddings <- word_embeddings_4
similiarty_scores <- textSimilarity(word_embeddings$harmonytext, word_embeddings$satisfactiontext)
comment(similiarty_scores)
# }

Run the code above in your browser using DataLab