def get_preprocess_filenames(pipelines, vocab_file, dataset_file=None):
    """
    Gets the appropriate vocabulary file path to load.

    Parameters
    ----------
    pipelines : list
        List of preprocessing pipelines.
    vocab_file : str
        Path of vocabulary file.
    dataset_file : str, optional
        Path of dataset file.

    Returns
    -------
    vocab_to_load : str
        Path of vocabulary file to load.
    dataset_to_load : str, optional
        Path of dataset to load.

    """
    pipelines.sort()
    if pipelines is None or len(pipelines) == 0:
        return None
    dataset_to_load = dataset_file[:-4] if dataset_file else ''
    vocab_to_load = vocab_file[:-4]
    for pipeline in pipelines:
        dataset_to_load += '_' + pipeline
        vocab_to_load += '_' + pipeline
    dataset_to_load += '.csv'
    vocab_to_load += '.txt'
    if dataset_file:
        return vocab_to_load, dataset_to_load
    else:
        return vocab_to_load