This function takes a data frame containing a label column and adds bi-, tri-, and n-grams.
It uses the tidytext library to allow dynamic specification of n and returns
the same data frame with added column ngrams_n where n is defined by the input.
add_ngram(df, inner_col, n = 2, exclude_self = FALSE)The input data frame with column ngrams_n added