code: def _granularize(data_bundle, tag_map):
      r"""
      该函数对data_bundle中'target'列中的内容进行转换。
  
      :param data_bundle:
      :param dict tag_map: 将target列中的tag做以下的映射，比如{"0":0, "1":0, "3":1, "4":1}, 则会删除target为"2"的instance，
          且将"1"认为是第0类。
      :return: 传入的data_bundle
      """
      if tag_map is None:
          return data_bundle
      for name in list(data_bundle.datasets.keys()):
          dataset = data_bundle.get_dataset(name)
          dataset.apply_field(
              lambda target: tag_map.get(target, -100),
              field_name="target",
              new_field_name="target",
          )
          dataset.drop(lambda ins: ins["target"] == -100)
          data_bundle.set_dataset(dataset, name)
      return data_bundle
  
file_path: fastNLP/fastNLP/io/pipe/utils.py
imports: from typing import List
  from ...core.vocabulary import Vocabulary
  from fastNLP.core.log import logger
  from pkg_resources import parse_version
label_desc: Use image node_id 10 for calling a global function with example usage: _granularize(data_bundle, tag_map) and returns: data_bundle, data_bundle