fst_get_top_ngrams {finnsurveytext} | R Documentation |
Make Top N-grams Table
Description
Creates a table of the most frequently-occurring n-grams within the data.
Usage
fst_get_top_ngrams(
data,
number = 10,
ngrams = 1,
norm = "number_words",
pos_filter = NULL,
strict = TRUE
)
Arguments
data |
A dataframe of text in CoNLL-U format. |
number |
The number of n-grams to return, default is '10'. |
ngrams |
The type of n-grams to return, default is '1'. |
norm |
The method for normalising the data. Valid settings are '"number_words"' (the number of words in the responses, default), '"number_resp"' (the number of responses), or 'NULL' (raw count returned). |
pos_filter |
List of UPOS tags for inclusion, default is 'NULL' which means all word types included. |
strict |
Whether to strictly cut-off at 'number' (ties are alphabetically ordered), default is 'TRUE'. |
Value
A table of the most frequently occurring n-grams in the data.
Examples
q11_1 <- conllu_dev_q11_1_nltk
fst_get_top_ngrams(q11_1, norm = NULL)
fst_get_top_ngrams(q11_1, number = 10, ngrams = 1, norm = "number_resp")
cb <- conllu_cb_bullying
pf <- c("NOUN", "VERB", "ADJ", "ADV")
fst_get_top_ngrams(cb, number = 15, pos_filter = pf)
[Package finnsurveytext version 1.0.0 Index]