Skip to contents

Sum of idf over the n tokens of one window. i is a 0-BASED start.

Usage

morie_kamath_ch8_ngram_embedding(x, i, n)

Arguments

x

1-D idf sequence or 2-D embedding rows.

i

0-based start.

n

Window length.

Value

List with estimate, embedding, window.

Examples

morie_kamath_ch8_ngram_embedding(x = c(1, 2, 3, 4, 5, 6, 7, 8), i = 5L, n = 3L)
#> $estimate
#> [1] 21
#> 
#> $embedding
#> [1] 21
#> 
#> $window
#> [1] 6 7 8
#> 
#> $i
#> [1] 5
#> 
#> $n
#> [1] 3
#> 
#> $method
#> [1] "MoverScore n-gram embedding (Kamath Eq 8.12)"
#>