Calculate stylistic similarity between two conversations
Source:R/main_functions.R
stylistic_similarity.Rd
This function calculates various stylistic features and their similarity between two conversations.
Examples
text1 <- "The quick brown fox jumps over the lazy dog. It's a sunny day."
text2 <- "A lazy cat sleeps on the warm windowsill. Birds chirp outside."
stylistic_similarity(text1, text2)
#> $text1_features
#> ttr avg_sentence_length fk_grade
#> 1.0000000 6.5000000 0.5603846
#>
#> $text2_features
#> ttr avg_sentence_length fk_grade
#> 1.000000 5.500000 4.791364
#>
#> $feature_differences
#> ttr avg_sentence_length fk_grade
#> 0.000000 1.000000 4.230979
#>
#> $overall_similarity
#> [1] 0.6543704
#>
#> $cosine_similarity
#> [1] 0.5680224
#>