Calculate semantic similarity sequence for a single dyad
Source:R/conversation_sequence.R
sem_sim_seq.Rd
This function calculates semantic similarity over a sequence of conversation exchanges within a single dyad.
Examples
conversation <- data.frame(
processed_text = c("The weather is nice", "It's a beautiful day",
"The sun is shining", "Perfect day for a picnic")
)
result <- sem_sim_seq(conversation, method = "tfidf", window_size = 2)
#> Warning: The 'tfidf' method may not provide highly meaningful results for short conversations or those with little vocabulary overlap. Consider using 'word2vec' or 'glove' methods for more robust results.
#> Warning: The 'tfidf' method may not provide highly meaningful results for short conversations or those with little vocabulary overlap. Consider using 'word2vec' or 'glove' methods for more robust results.
print(result)
#> $sequence
#> [1] 0.5 0.5
#>
#> $average
#> [1] 0.5
#>