def format_summary(translation):
            """ Transforms the output of the `from_batch` function
            into nicely formatted summaries.
            """
            raw_summary = translation
            summary = (
                raw_summary.replace("[unused0]", "")
                .replace("[unused3]", "")
                .replace("[CLS]", "")
                .replace("[SEP]", "")
                .replace("[PAD]", "")
                .replace("[unused1]", "")
                .replace(r" +", " ")
                .replace(" [unused2] ", ".")
                .replace("[unused2]", "")
                .strip()
            )

            return summary
 Transforms the output of the `from_batch` function
            into nicely formatted summaries.
            
utils_nlp/models/transformers/abstractive_summarization_bertsum.py