def postprocess(
        self,
        results,
        examples_file,
        features_file,
        n_best_size=20,
        n_top_start=5,
        n_top_end=5,
        max_answer_length=30,
        unanswerable_exists=False,
        output_prediction_file="./qa_predictions.json",
        output_nbest_file="./nbest_predictions.json",
        output_null_log_odds_file="./null_odds.json",
        null_score_diff_threshold=0.0,
        verbose_logging=False,
    ):

        """
        Postprocesses start and end logits generated by :meth:`AnswerExtractor.fit`.

        Args:
            results (list): List of :class:`QAResultExtended`.
            examples_file (str): One of the files cached by
                :meth:`QAProcessor.preprocess`. This file contains the original
                document tokens that are used to generate the final answers from
                the predicted start and end positions.
            features_file (str): One of the files cached by
                :meth:`QAProcessor.preprocess`. This file contains the mapping from
                indices in the processed token list to the original document tokens
                that are used to generate the final predicted answers.
            n_best_size (int, optional): The number of candidates to choose from each
                QAResult to generate the final prediction.
                It's also the maximum number of n-best answers to output for
                each question. Note that the number of n-best answers can be smaller
                than `n_best_size` because some unqualified answers, e.g. answers
                that are too long are removed.
            n_top_start (int, optional): For XLNet only. Beam size for span start.
                Note that this needs to be consistent with the XLNet model
                configuration. Defaults to 5.
            n_top_end (int, optional): For XLNet only. Beam size for span end.
                Note that this needs to be consistent with the XLNet model
                configuration. Defaults to 5.
            max_answer_length (int, optional): Maximum length of the answer.
                Defaults to 30.
            unanswerable_exists (bool, optional): Whether there are unanswerable
                questions in the data. If True, the start and end logits of the
                [CLS] token, which indicate the probability of the answer being empty,
                are included in the candidate answer list.
                Defaults to False.
            output_prediction_file (str, optional): Path of the file to save the
                predicted answers.
                Defaults to "./qa_predictions.json".
            output_nbest_file (str, optional): Path of the file to save the n-best
                answers. Defaults to "./nbest_predictions.json".
            output_null_log_odds_file (str, optional): If unanswerable_exists is True,
                the score difference between empty prediction and best non-empty
                prediction are saved to this file. These scores can be used to find the
                best threshold for predicting an empty answer.
                Defaults to "./null_odds.json".
            null_score_diff_threshold (float, optional): For BERT models only.
                If unanswerable_exists=True and the score difference between empty
                prediction and best non-empty prediction is higher than this threshold,
                the final predicted answer is empty. Defaults to 0.0.
            verbose_logging (bool, optional): Whether to log details of answer
                postprocessing. Defaults to False.

        Returns:
            tuple: (OrderedDict, OrderedDict, OrderedDict)
                The keys of the dictionaries are the `qa_id` in the original
                :class:`utils_nlp.dataset.pytorch.QADataset`
                The values of the first dictionary are the predicted answer texts
                    in string type.
                The values of the second dictionary are the softmax probabilities
                    of the predicted answers.
                The values of the third dictionary are the n-best answers for
                    each qa_id. Note that the number of n-best answers can be smaller
                    than `n_best_size` because some unqualified answers, e.g. answers
                    that are too long, are removed.
        """
        if self.model_type == "xlnet":
            final_answers, answer_probs, nbest_answers = postprocess_xlnet_answer(
                results=results,
                examples_file=examples_file,
                features_file=features_file,
                tokenizer=self.tokenizer,
                n_best_size=n_best_size,
                n_top_start=n_top_start,
                n_top_end=n_top_end,
                max_answer_length=max_answer_length,
                unanswerable_exists=unanswerable_exists,
                output_prediction_file=output_prediction_file,
                output_nbest_file=output_nbest_file,
                output_null_log_odds_file=output_null_log_odds_file,
                verbose_logging=verbose_logging,
            )
        else:
            final_answers, answer_probs, nbest_answers = postprocess_bert_answer(
                results=results,
                examples_file=examples_file,
                features_file=features_file,
                do_lower_case=self.do_lower_case,
                n_best_size=n_best_size,
                max_answer_length=max_answer_length,
                unanswerable_exists=unanswerable_exists,
                output_prediction_file=output_prediction_file,
                output_nbest_file=output_nbest_file,
                output_null_log_odds_file=output_null_log_odds_file,
                null_score_diff_threshold=null_score_diff_threshold,
                verbose_logging=verbose_logging,
            )
        return final_answers, answer_probs, nbest_answers

        Postprocesses start and end logits generated by :meth:`AnswerExtractor.fit`.

        Args:
            results (list): List of :class:`QAResultExtended`.
            examples_file (str): One of the files cached by
                :meth:`QAProcessor.preprocess`. This file contains the original
                document tokens that are used to generate the final answers from
                the predicted start and end positions.
            features_file (str): One of the files cached by
                :meth:`QAProcessor.preprocess`. This file contains the mapping from
                indices in the processed token list to the original document tokens
                that are used to generate the final predicted answers.
            n_best_size (int, optional): The number of candidates to choose from each
                QAResult to generate the final prediction.
                It's also the maximum number of n-best answers to output for
                each question. Note that the number of n-best answers can be smaller
                than `n_best_size` because some unqualified answers, e.g. answers
                that are too long are removed.
            n_top_start (int, optional): For XLNet only. Beam size for span start.
                Note that this needs to be consistent with the XLNet model
                configuration. Defaults to 5.
            n_top_end (int, optional): For XLNet only. Beam size for span end.
                Note that this needs to be consistent with the XLNet model
                configuration. Defaults to 5.
            max_answer_length (int, optional): Maximum length of the answer.
                Defaults to 30.
            unanswerable_exists (bool, optional): Whether there are unanswerable
                questions in the data. If True, the start and end logits of the
                [CLS] token, which indicate the probability of the answer being empty,
                are included in the candidate answer list.
                Defaults to False.
            output_prediction_file (str, optional): Path of the file to save the
                predicted answers.
                Defaults to "./qa_predictions.json".
            output_nbest_file (str, optional): Path of the file to save the n-best
                answers. Defaults to "./nbest_predictions.json".
            output_null_log_odds_file (str, optional): If unanswerable_exists is True,
                the score difference between empty prediction and best non-empty
                prediction are saved to this file. These scores can be used to find the
                best threshold for predicting an empty answer.
                Defaults to "./null_odds.json".
            null_score_diff_threshold (float, optional): For BERT models only.
                If unanswerable_exists=True and the score difference between empty
                prediction and best non-empty prediction is higher than this threshold,
                the final predicted answer is empty. Defaults to 0.0.
            verbose_logging (bool, optional): Whether to log details of answer
                postprocessing. Defaults to False.

        Returns:
            tuple: (OrderedDict, OrderedDict, OrderedDict)
                The keys of the dictionaries are the `qa_id` in the original
                :class:`utils_nlp.dataset.pytorch.QADataset`
                The values of the first dictionary are the predicted answer texts
                    in string type.
                The values of the second dictionary are the softmax probabilities
                    of the predicted answers.
                The values of the third dictionary are the n-best answers for
                    each qa_id. Note that the number of n-best answers can be smaller
                    than `n_best_size` because some unqualified answers, e.g. answers
                    that are too long, are removed.
        
utils_nlp/models/transformers/question_answering.py