extract_ngrams: Extract n-grams from text

View source: R/text_preprocessing.R

extract_ngramsR Documentation

Extract n-grams from text

Description

This function extracts n-grams (sequences of n words) from text.

Usage

extract_ngrams(text, n = 1, min_freq = 2)

Arguments

text

Character vector of texts to process

n

Integer specifying the n-gram size (1 for unigrams, 2 for bigrams, etc.)

min_freq

Minimum frequency to include an n-gram

Value

A data frame containing n-grams and their frequencies


LBDiscover documentation built on June 16, 2025, 5:09 p.m.