Skip to contents

This function calculates topic similarity over a sequence of conversation exchanges within a single dyad.

Usage

topic_sim_seq(conversation, method = "lda", num_topics = 2, window_size = 3)

Arguments

conversation

A data frame representing the conversation

method

A character string specifying the method to use: "lda" or "lsa"

num_topics

An integer specifying the number of topics to use in the model

window_size

An integer specifying the size of the sliding window

Value

A list containing the sequence of similarities and the average similarity

Examples

conversation <- data.frame(
  processed_text = c("The cat sat on the mat", "The dog chased the cat",
                     "The mat was comfortable", "The cat liked the mat")
)
result <- topic_sim_seq(conversation, method = "lda", num_topics = 2, window_size = 2)
print(result)
#> $sequence
#> [1] 1 1 1
#> 
#> $average
#> [1] 1
#>