Skip to navigation

nemo_curator.stages.text.utils.text

View as Markdown

Module Contents

Functions

NameDescription
normalize_textNormalize text in a cuDF Series.

API

nemo_curator.stages.text.utils.text.normalize_text(
text_series: cudf.Series,
lowercase: bool = True,
normalize_space: bool = True
) -> cudf.Series

Normalize text in a cuDF Series.

Parameters:

text_series
cudf.Series

Series containing the text to normalize.

lowercase
boolDefaults to True

Whether to lowercase the text.

normalize_space
boolDefaults to True

Whether to collapse whitespace runs and trim leading and trailing whitespace.

Returns: cudf.Series

The normalized text series.

Raises:

  • TypeError: If text_series is not a cuDF Series.