def save_data(data_iter, is_test=False, save_path="./", chunk_size=None):
        """ Save the preprocessed data into files with specified chunk size

        Args:
            data_iter (iterator): Data iterator returned from
                :class:`utils_nlp.models.transformers.datasets.SummarizationDataset`
            is_test (bool): Boolean value which indicates whether target data
                is included. If set to True, the file name contains "test", otherwise,
                the file name contains "train". Defaults to False.
            save_path (str): Directory where the data should be saved. Defaults to "./".
            chunk_size (int): The number of examples that should be included in each
                file. Defaults to None, which means only one file is used.

        Returns:
            a list of strings which are the files the data is saved to.
        """
        os.makedirs(save_path, exist_ok=True)

        def _chunks(iterable, chunk_size):
            iterator = filter(None, iterable)
            for first in iterator:
                if chunk_size:
                    yield itertools.chain(
                        [first], itertools.islice(iterator, chunk_size - 1)
                    )
                else:
                    yield itertools.chain([first], itertools.islice(iterator, None))

        chunks = _chunks(data_iter, chunk_size)
        filename_list = []
        for i, chunked_data in enumerate(chunks):
            filename = f"{i}_test" if is_test else f"{i}_train"
            torch.save(list(chunked_data), os.path.join(save_path, filename))
            filename_list.append(os.path.join(save_path, filename))
        return filename_list
 Save the preprocessed data into files with specified chunk size

        Args:
            data_iter (iterator): Data iterator returned from
                :class:`utils_nlp.models.transformers.datasets.SummarizationDataset`
            is_test (bool): Boolean value which indicates whether target data
                is included. If set to True, the file name contains "test", otherwise,
                the file name contains "train". Defaults to False.
            save_path (str): Directory where the data should be saved. Defaults to "./".
            chunk_size (int): The number of examples that should be included in each
                file. Defaults to None, which means only one file is used.

        Returns:
            a list of strings which are the files the data is saved to.
        
utils_nlp/models/transformers/extractive_summarization.py