docstr: 将 Sequence[Sequence] 转为 Mapping 。例如 [[[1, 2], 2], [[3], 2]] -> {'_0': [[1, 2], [3]], '_1': [2, 2]}
  
  :param batch: 需要 unpack 的 batch 数据。
  :param ignore_fields: 需要忽略的 field 。
  :param input_fields: 需要设置为 input 的 field 。
  :return:
docstr_tok: ["\u5c06","Sequence","[","Sequence","]","\u8f6c\u4e3a","Mapping","\u3002\u4f8b\u5982","[","[","[","1",",","2","]",",","2","]",",","[","[","3","]",",","2","]","]","-",">","{","'_0","'",":","[","[","1",",","2","]",",","[","3","]","]",",","'_1","'",":","[","2",",","2","]","}",":","param","batch",":","\u9700\u8981","unpack","\u7684","batch","\u6570\u636e\u3002",":","param","ignore_fields",":","\u9700\u8981\u5ffd\u7565\u7684","field","\u3002",":","param","input_fields",":","\u9700\u8981\u8bbe\u7f6e\u4e3a","input","\u7684","field","\u3002",":","return",":"]
code: def unpack_batch(
      batch: Sequence[Sequence], ignore_fields, input_fields
  ) -> Dict:
      """
      将 Sequence[Sequence] 转为 Mapping 。例如 [[[1, 2], 2], [[3], 2]] -> {'_0': [[1, 2], [3]], '_1': [2, 2]}
  
      :param batch: 需要 unpack 的 batch 数据。
      :param ignore_fields: 需要忽略的 field 。
      :param input_fields: 需要设置为 input 的 field 。
      :return:
      """
      dict_batch = defaultdict(list)
      for sample in batch:
          for i, content in enumerate(sample):
              field_name = f"_{i}"
              if field_name in ignore_fields:
                  continue
              dict_batch[field_name].append(content)
      return dict_batch
  
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 1 for calling the SequencePackerUnpacker obj's underlying member method code with example usage: obj.unpack_batch(batch, ignore_fields, input_fields) and returns: dict_batch