class_docstr: fastNLP的数据容器。
  
  Example::
  
      from fastNLP.core.dataset import DataSet, Instance
      data = {'x': [[1, 0, 1], [0, 1, 1], 'y': [0, 1]}
      data1 = [Instance(x=[1,0,1],y=0), Instance(x=[0,1,1],y=1)]
      ds = DataSet(data)
      ds = DataSet(data1)
  
  fastNLP的 DataSet 是 key-value 存储形式， 目前支持两种初始化方式，输入 data 分别为 ``List[:class:`~fastNLP.core.dataset.Instance`]`` 和
  ``Dict[str, List[Any]]``。
  
      * 当 data 为 ``List[:class:`~fastNLP.core.dataset.Instance`]`` 时,  每个 ``Instance`` 的 field_name 需要保持一致。
        Instance 详见 :class:`~fastNLP.core.dataset.Instance` 。
      * 当 data 为 ``Dict[str, List[Any]]`` 时， 则每个 key 的 value 应该为等长的 list， 否则不同 field 的长度不一致。
  
  :param data: 初始化的内容，其只能为两种类型，分别为 ``List[:class:`~fastNLP.core.dataset.Instance`]`` 和
      ``Dict[str, List[Any]]``。
  
      * 当 data 为 ``List[:class:`~fastNLP.core.dataset.Instance`]`` 时,  每个 ``Instance`` 的 field_name 需要保持一致。
        Instance 详见 :class:`~fastNLP.core.dataset.Instance` 。
      * 当 data 为 ``Dict[str, List[Any]] 时， 则每个 key 的 value 应该为等长的 list， 否则不同 field 的长度不一致。
class_docstr_tok: ["fastNLP\u7684\u6570\u636e\u5bb9\u5668\u3002","Example",":",":","from","fastNLP.core.dataset","import","DataSet",",","Instance","data","=","{","'","x","'",":","[","[","1",",","0",",","1","]",",","[","0",",","1",",","1","]",",","'","y","'",":","[","0",",","1","]","}","data1","=","[","Instance","(","x=","[","1,0,1","]",",","y=0",")",",","Instance","(","x=","[","0,1,1","]",",","y=1",")","]","ds","=","DataSet","(","data",")","ds","=","DataSet","(","data1",")","fastNLP\u7684","DataSet","\u662f","key-value","\u5b58\u50a8\u5f62\u5f0f\uff0c","\u76ee\u524d\u652f\u6301\u4e24\u79cd\u521d\u59cb\u5316\u65b9\u5f0f\uff0c\u8f93\u5165","data","\u5206\u522b\u4e3a","``","List","[",":","class",":","`","~fastNLP.core.dataset.Instance","`","]","``","\u548c","``","Dict","[","str",",","List","[","Any","]","]","``","\u3002","*","\u5f53","data","\u4e3a","``","List","[",":","class",":","`","~fastNLP.core.dataset.Instance","`","]","``","\u65f6",",","\u6bcf\u4e2a","``","Instance","``","\u7684","field_name","\u9700\u8981\u4fdd\u6301\u4e00\u81f4\u3002","Instance","\u8be6\u89c1",":","class",":","`","~fastNLP.core.dataset.Instance","`","\u3002","*","\u5f53","data","\u4e3a","``","Dict","[","str",",","List","[","Any","]","]","``","\u65f6\uff0c","\u5219\u6bcf\u4e2a","key","\u7684","value","\u5e94\u8be5\u4e3a\u7b49\u957f\u7684","list\uff0c","\u5426\u5219\u4e0d\u540c","field","\u7684\u957f\u5ea6\u4e0d\u4e00\u81f4\u3002",":","param","data",":","\u521d\u59cb\u5316\u7684\u5185\u5bb9\uff0c\u5176\u53ea\u80fd\u4e3a\u4e24\u79cd\u7c7b\u578b\uff0c\u5206\u522b\u4e3a","``","List","[",":","class",":","`","~fastNLP.core.dataset.Instance","`","]","``","\u548c","``","Dict","[","str",",","List","[","Any","]","]","``","\u3002","*","\u5f53","data","\u4e3a","``","List","[",":","class",":","`","~fastNLP.core.dataset.Instance","`","]","``","\u65f6",",","\u6bcf\u4e2a","``","Instance","``","\u7684","field_name","\u9700\u8981\u4fdd\u6301\u4e00\u81f4\u3002","Instance","\u8be6\u89c1",":","class",":","`","~fastNLP.core.dataset.Instance","`","\u3002","*","\u5f53","data","\u4e3a","``","Dict","[","str",",","List","[","Any","]","]","\u65f6\uff0c","\u5219\u6bcf\u4e2a","key","\u7684","value","\u5e94\u8be5\u4e3a\u7b49\u957f\u7684","list\uff0c","\u5426\u5219\u4e0d\u540c","field","\u7684\u957f\u5ea6\u4e0d\u4e00\u81f4\u3002"]
docstr: 将当前 DataSet 与输入的 ``dataset`` 结合成一个更大的 dataset，需要保证两个 dataset 都包含了相同的 field。结合后的 dataset
  的 field_name 和 _collator 以当前 dataset 为准。若 ``dataset`` 中包含的 field 多于当前的 DataSet，则多余的 field 会被忽略；
  若 ``dataset`` 中未包含所有当前 DataSet 含有 field，则会报错。
  
  :param dataset: 需要和当前 DataSet 拼接的 ``dataset``；
  :param inplace: 是否直接将 ``dataset`` 组合到当前 DataSet 中；
  :param field_mapping: 当传入的 ``dataset`` 中的 field 名称和当前 dataset 不一致时，需要通过 ``field_mapping`` 把输入的 ``dataset``
      中的 field 名称映射到当前 field。``field_mapping`` 为 dict 类型，key 为 11dataset`` 中的 field 名称，value 是需要映射成的名称
  
  :return: :class:`~fastNLP.core.dataset.DataSet`
docstr_tok: ["\u5c06\u5f53\u524d","DataSet","\u4e0e\u8f93\u5165\u7684","``","dataset","``","\u7ed3\u5408\u6210\u4e00\u4e2a\u66f4\u5927\u7684","dataset\uff0c\u9700\u8981\u4fdd\u8bc1\u4e24\u4e2a","dataset","\u90fd\u5305\u542b\u4e86\u76f8\u540c\u7684","field\u3002\u7ed3\u5408\u540e\u7684","dataset","\u7684","field_name","\u548c","_collator","\u4ee5\u5f53\u524d","dataset","\u4e3a\u51c6\u3002\u82e5","``","dataset","``","\u4e2d\u5305\u542b\u7684","field","\u591a\u4e8e\u5f53\u524d\u7684","DataSet\uff0c\u5219\u591a\u4f59\u7684","field","\u4f1a\u88ab\u5ffd\u7565\uff1b","\u82e5","``","dataset","``","\u4e2d\u672a\u5305\u542b\u6240\u6709\u5f53\u524d","DataSet","\u542b\u6709","field\uff0c\u5219\u4f1a\u62a5\u9519\u3002",":","param","dataset",":","\u9700\u8981\u548c\u5f53\u524d","DataSet","\u62fc\u63a5\u7684","``","dataset","``","\uff1b",":","param","inplace",":","\u662f\u5426\u76f4\u63a5\u5c06","``","dataset","``","\u7ec4\u5408\u5230\u5f53\u524d","DataSet","\u4e2d\uff1b",":","param","field_mapping",":","\u5f53\u4f20\u5165\u7684","``","dataset","``","\u4e2d\u7684","field","\u540d\u79f0\u548c\u5f53\u524d","dataset","\u4e0d\u4e00\u81f4\u65f6\uff0c\u9700\u8981\u901a\u8fc7","``","field_mapping","``","\u628a\u8f93\u5165\u7684","``","dataset","``","\u4e2d\u7684","field","\u540d\u79f0\u6620\u5c04\u5230\u5f53\u524d","field\u3002","``","field_mapping","``","\u4e3a","dict","\u7c7b\u578b\uff0ckey","\u4e3a","11dataset","``","\u4e2d\u7684","field","\u540d\u79f0\uff0cvalue","\u662f\u9700\u8981\u6620\u5c04\u6210\u7684\u540d\u79f0",":","return",":",":","class",":","`","~fastNLP.core.dataset.DataSet","`"]
code: def concat(
      self,
      dataset: "DataSet",
      inplace: bool = True,
      field_mapping: Dict = None,
  ) -> "DataSet":
      """
      将当前 DataSet 与输入的 ``dataset`` 结合成一个更大的 dataset，需要保证两个 dataset 都包含了相同的 field。结合后的 dataset
      的 field_name 和 _collator 以当前 dataset 为准。若 ``dataset`` 中包含的 field 多于当前的 DataSet，则多余的 field 会被忽略；
      若 ``dataset`` 中未包含所有当前 DataSet 含有 field，则会报错。
  
      :param dataset: 需要和当前 DataSet 拼接的 ``dataset``；
      :param inplace: 是否直接将 ``dataset`` 组合到当前 DataSet 中；
      :param field_mapping: 当传入的 ``dataset`` 中的 field 名称和当前 dataset 不一致时，需要通过 ``field_mapping`` 把输入的 ``dataset``
          中的 field 名称映射到当前 field。``field_mapping`` 为 dict 类型，key 为 11dataset`` 中的 field 名称，value 是需要映射成的名称
  
      :return: :class:`~fastNLP.core.dataset.DataSet`
      """
      assert isinstance(
          dataset, DataSet
      ), "Can only concat two datasets."
  
      fns_in_this_dataset = set(self.get_field_names())
      fns_in_other_dataset = dataset.get_field_names()
      reverse_field_mapping = {}
      if field_mapping is not None:
          fns_in_other_dataset = [
              field_mapping.get(fn, fn) for fn in fns_in_other_dataset
          ]
          reverse_field_mapping = {
              v: k for k, v in field_mapping.items()
          }
      fns_in_other_dataset = set(fns_in_other_dataset)
      fn_not_seen = list(fns_in_this_dataset - fns_in_other_dataset)
  
      if fn_not_seen:
          raise RuntimeError(
              f"The following fields are not provided in the dataset:{fn_not_seen}"
          )
  
      if inplace:
          ds = self
      else:
          ds = deepcopy(self)
  
      for fn in fns_in_this_dataset:
          ds.get_field(fn).content.extend(
              deepcopy(
                  dataset.get_field(
                      reverse_field_mapping.get(fn, fn)
                  ).content
              )
          )
  
      return ds
  
imports: import _pickle
  from copy import deepcopy
  from typing import Optional, List, Callable, Union, Dict, Any, Mapping
  from types import LambdaType
  import sys
  import time
  import numpy
  from .field import FieldArray
  from .instance import Instance
  from fastNLP.core.utils.utils import pretty_table_printer, deprecated
  from fastNLP.core.collators import Collator
  from fastNLP.core.utils.rich_progress import f_rich_progress, DummyFRichProgress
  from fastNLP.core.utils.tqdm_progress import f_tqdm_progress
  from ..log import logger
  from fastNLP.core.utils.dummy_class import DummyClass
  from ..utils.utils import _get_fun_msg
label_desc: Use image node_id 35 for calling the DataSet obj's underlying member method code with example usage: obj.concat(dataset, inplace, field_mapping) and returns: ds