Learn R Programming

text (version 0.9.50)

textSimilarityTest: Test whether there is a significant difference in meaning between two sets of texts (i.e., between their word embeddings).

Description

Test whether there is a significant difference in meaning between two sets of texts (i.e., between their word embeddings).

Usage

textSimilarityTest(
  x,
  y,
  Npermutations = 10000,
  method = "paired",
  alternative = c("two_sided", "less", "greater"),
  output.permutations = TRUE,
  N_cluster_nodes = 1,
  seed = 1001
)

Arguments

x

Set of word embeddings from textEmbed.

y

Set of word embeddings from textEmbed.

Npermutations

Number of permutations (default 1000).

method

Compute a "paired" or an "unpaired" test.

alternative

Use a two or one-sided test (select one of: "two_sided", "less", "greater").

output.permutations

If TRUE, returns permuted values in output.

N_cluster_nodes

Number of cluster nodes to use (more makes computation faster; see parallel package).

seed

Set different seed.

Value

A list with a p-value, cosine_estimate and permuted values if output.permutations=TRUE.

Examples

Run this code
# NOT RUN {
x <- word_embeddings_4$harmonywords
y <- word_embeddings_4$satisfactionwords
textSimilarityTest(x,
  y,
  method = "paired",
  Npermutations = 100,
  N_cluster_nodes = 1,
  alternative = "two_sided"
)
# }

Run the code above in your browser using DataLab