def __init__(
        self,
        source_file,
        target_file=None,
        source_preprocessing=None,
        target_preprocessing=None,
        word_tokenization=None,
        top_n=-1,
    ):
        """
        Create a summarization dataset instance given the
        paths of the source file and the target file

        Args:
            source_file (str): Full path of the file which contains a list of
                the paragraphs with line break as seperator.
            target_file (str): Full path of the file which contains a list of
                the summaries for the paragraphs in the source file with line break as
                seperator.
            source_preprocessing (list of functions): A list of preprocessing functions
                to process the paragraphs in the source file.
            target_preprocessing (list of functions): A list of preprocessing functions
                to process the paragraphs in the source file.
            word_tokenization (function): Tokenization function for tokenize the
                paragraphs and summaries. The tokenization method is used for sentence
                selection in
                :meth:`utils_nlp.models.transformers.extractive_summarization.
                ExtSumProcessor.preprocess`
            top_n (int, optional): The number which specifies how many examples in the
                beginning of the paragraph and summary lists that will be processed by
                this function. Defaults to -1, which means the whole lists of paragraphs
                and summaries should be procsssed.
        """

        source_iter = _line_iter(source_file)

        if top_n != -1:
            source_iter = itertools.islice(source_iter, top_n)

        self._source = _create_data_from_iterator(
            source_iter, source_preprocessing, word_tokenization
        )

        if target_file:
            target_iter = _line_iter(target_file)
            if top_n != -1:
                target_iter = itertools.islice(target_iter, top_n)
            self._target = _create_data_from_iterator(
                target_iter, target_preprocessing, word_tokenization
            )
        else:
            self._target = None

        Create a summarization dataset instance given the
        paths of the source file and the target file

        Args:
            source_file (str): Full path of the file which contains a list of
                the paragraphs with line break as seperator.
            target_file (str): Full path of the file which contains a list of
                the summaries for the paragraphs in the source file with line break as
                seperator.
            source_preprocessing (list of functions): A list of preprocessing functions
                to process the paragraphs in the source file.
            target_preprocessing (list of functions): A list of preprocessing functions
                to process the paragraphs in the source file.
            word_tokenization (function): Tokenization function for tokenize the
                paragraphs and summaries. The tokenization method is used for sentence
                selection in
                :meth:`utils_nlp.models.transformers.extractive_summarization.
                ExtSumProcessor.preprocess`
            top_n (int, optional): The number which specifies how many examples in the
                beginning of the paragraph and summary lists that will be processed by
                this function. Defaults to -1, which means the whole lists of paragraphs
                and summaries should be procsssed.
        
utils_nlp/models/transformers/datasets.py