def _preprocess(sentences, preprocess_pipeline, word_tokenize=None):
    """
    Helper function to preprocess a list of paragraphs.

    Args:
        param (Tuple): params are tuple of (a list of strings,
            a list of preprocessing functions, and function to tokenize
            setences into words). A paragraph is represented with a
            single string with multiple setnences.

    Returns:
        list of list of strings, where each string is a token or word.
    """
    if preprocess_pipeline is not None:
        for function in preprocess_pipeline:
            sentences = function(sentences)

    if word_tokenize is None:
        return sentences
    else:
        return sentences, [word_tokenize(sentence) for sentence in sentences]

    Helper function to preprocess a list of paragraphs.

    Args:
        param (Tuple): params are tuple of (a list of strings,
            a list of preprocessing functions, and function to tokenize
            setences into words). A paragraph is represented with a
            single string with multiple setnences.

    Returns:
        list of list of strings, where each string is a token or word.
    
utils_nlp/models/transformers/datasets.py