Learn R Programming

text (version 0.9.90)

textDistance: Compute the semantic distance between two text variables.

Description

Compute the semantic distance between two text variables.

Usage

textDistance(x, y, method = "euclidean")

Value

A vector comprising semantic distance scores.

Arguments

x

Word embeddings (from textEmbed).

y

Word embeddings (from textEmbed).

method

Character string describing type of measure to be computed; default is "euclidean" (see also measures from stats:dist() including "maximum", "manhattan", "canberra", "binary" and "minkowski".

See Also

see textSimilarity, textSimilarityNorm and textSimilarityTest

Examples

Run this code
library(dplyr)
distance_scores <- textDistance(
  word_embeddings_4$harmonytext,
  word_embeddings_4$satisfactiontext
)
comment(distance_scores)

Run the code above in your browser using DataLab