R/param_max_tokens.R

Defines functions max_tokens

Documented in max_tokens

#' Maximum number of retained tokens
#'
#' Used in `textrecipes::step_tokenfilter()`.
#'
#' @inheritParams Laplace
#' @examples
#' max_tokens()
#' @export
max_tokens <- function(range = c(0L, as.integer(10^3)), trans = NULL) {
  new_quant_param(
    type = "integer",
    range = range,
    inclusive = c(TRUE, TRUE),
    trans = trans,
    label = c(max_tokens = "# Retained Tokens"),
    finalize = NULL
  )
}

Try the dials package in your browser

Any scripts or data that you put into this service are public.

dials documentation built on April 3, 2023, 5:43 p.m.