code: 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("[PAD]", "")
          .replace("[unused1]", "")
          .replace(r" +", " ")
          .replace(" [unused2] ", ". ")
          .replace("[unused2]", "")
          .strip()
      )
  
      return summary
  
imports: import os
  from .data_abs import BertAbsDataBunch
  from .learner_util import Learner
  from torch import nn
  from typing import List
  import torch
  from box import Box
  from tokenizers import BertWordPieceTokenizer
  from .summarisation import BertAbs, build_predictor
  from .summarisation import BertAbsConfig
  from fastprogress.fastprogress import master_bar, progress_bar
  import numpy
  import pandas
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: format_summary(translation) and returns: summary