Skip to contents

Calculates and binds the importance of bigrams and their synergistic average.

Usage

bind_lr(tbl, term = "token", lr_mode = c("n", "dn"), avg_rate = 1)

Arguments

tbl

A tidy text dataset.

term

<data-masked> Column containing terms as string or symbol.

lr_mode

Method for computing 'FL' and 'FR' values. n is equivalent to 'LN' and 'RN', and dn is equivalent to 'LDN' and 'RDN'.

avg_rate

Weight of the 'LR' value.

Value

A data.frame.

Details

The 'LR' value is the synergistic average of bigram importance that based on the words and their positions (left or right side).

Examples

# \donttest{
prettify(hiroba, col_select = "POS1") |>
  mute_tokens(POS1 != "\u540d\u8a5e") |>
  bind_lr() |>
  head()
#>   doc_id sentence_id token_id    token   POS1   ltoken rtoken fl fr       lr
#> 1      1           1        1 ポラーノ   名詞 ポラーノ   <NA> 43  1 6.557439
#> 2      1           1        2     <NA>   助詞     <NA>   広場  1 63 7.937254
#> 3      1           1        3     広場   名詞     広場   <NA> 63  1 7.937254
#> 4      2           2        1     宮沢   名詞     宮沢   賢治  3  3 3.000000
#> 5      2           2        2     賢治   名詞     賢治   <NA>  3  1 1.732051
#> 6      3           3        1     <NA> 接頭詞     <NA>     十  1 36 6.000000
# }