code: def pack_batch_nested_mapping(batch: Mapping) -> Dict:
      """
      需要恢复出 nested 的 dict 原来的样式
  
      :param batch:
      :return:
      """
      dicts = []
  
      for key, value in batch.items():
          if not isinstance(key, tuple):
              key = [key]
          d = {key[-1]: value}
          for k in key[:-1:][::-1]:
              d = {k: d}
          dicts.append(d)
      return reduce(_merge_dict, dicts)
  
file_path: fastNLP/fastNLP/core/collators/packer_unpacker.py
imports: from collections import defaultdict
  from functools import reduce
  from typing import Sequence, Mapping, Dict
label_desc: Use image node_id 2 for calling a global function with example usage: pack_batch_nested_mapping(batch) and returns: reduce