Skip to contents

Get topic coherence from Palmetto remote or local

Usage

ask_palmetto(solution, depth = "full", coherence = "npmi", backend = "web")

Arguments

solution

A wide tibble where each column contains a top-N terms.

depth

The number of top terms to use to use for coherence estimation. If backend = "web", then the number cannot be less than 3 and more than 10.

coherence

A name of coherence metric. Valid names: "ca", "cp", "cv", "npmi", "uci", "umass". Default is npmi.

backend

Path to Palmetto either "web" or a string with an URL. Example: http://localhost:7777/service/.

Value

A wide tibble with requested coherence scores.

Examples

df1 <- tibble::tibble(col1 = c("apple", "banana", "cherry"), col2 = c("dog", "cat", "mouse"))

ask_palmetto(df1)
#> # A tibble: 1 × 2
#>    col1  col2
#>   <dbl> <dbl>
#> 1 0.263 0.286