class_docstr: NER任务的处理Pipe, 该Pipe会（1）复制raw_words列，并命名为words; (2）在words, target列建立词表
  (创建 :class:`fastNLP.Vocabulary` 对象，所以在返回的DataBundle中将有两个Vocabulary); (3）将words，target列根据相应的
  Vocabulary转换为index。
  
  raw_words列为List[str], 是未转换的原始数据; words列为List[int]，是转换为index的输入数据; target列是List[int]，是转换为index的
  target。返回的DataSet中被设置为input有words, target, seq_len; 设置为target有target, seq_len。
class_docstr_tok: ["NER\u4efb\u52a1\u7684\u5904\u7406Pipe",",","\u8be5Pipe\u4f1a\uff081\uff09\u590d\u5236raw_words\u5217\uff0c\u5e76\u547d\u540d\u4e3awords",";","(","2\uff09\u5728words",",","target\u5217\u5efa\u7acb\u8bcd\u8868","(","\u521b\u5efa",":","class",":","`","fastNLP.Vocabulary","`","\u5bf9\u8c61\uff0c\u6240\u4ee5\u5728\u8fd4\u56de\u7684DataBundle\u4e2d\u5c06\u6709\u4e24\u4e2aVocabulary",")",";","(","3\uff09\u5c06words\uff0ctarget\u5217\u6839\u636e\u76f8\u5e94\u7684","Vocabulary\u8f6c\u6362\u4e3aindex\u3002","raw_words\u5217\u4e3aList","[","str","]",",","\u662f\u672a\u8f6c\u6362\u7684\u539f\u59cb\u6570\u636e",";","words\u5217\u4e3aList","[","int","]","\uff0c\u662f\u8f6c\u6362\u4e3aindex\u7684\u8f93\u5165\u6570\u636e",";","target\u5217\u662fList","[","int","]","\uff0c\u662f\u8f6c\u6362\u4e3aindex\u7684","target\u3002\u8fd4\u56de\u7684DataSet\u4e2d\u88ab\u8bbe\u7f6e\u4e3ainput\u6709words",",","target",",","seq_len",";","\u8bbe\u7f6e\u4e3atarget\u6709target",",","seq_len\u3002"]
docstr: 支持的DataSet的field为
  
  .. csv-table::
     :header: "raw_words", "target"
  
     "[Nadim, Ladki]", "[B-PER, I-PER]"
     "[AL-AIN, United, Arab, ...]", "[B-LOC, B-LOC, I-LOC, ...]"
     "[...]", "[...]"
  
  :param ~fastNLP.DataBundle data_bundle: 传入的DataBundle中的DataSet必须包含raw_words和ner两个field，且两个field的内容均为List[str]在传入DataBundle基础上原位修改。
  :return: 处理后的 ``data_bundle``
docstr_tok: ["\u652f\u6301\u7684DataSet\u7684field\u4e3a","..","csv-table",":",":",":","header",":","``","raw_words","''",",","``","target","''","``","[","Nadim",",","Ladki","]","''",",","``","[","B-PER",",","I-PER","]","''","``","[","AL-AIN",",","United",",","Arab",",","...","]","''",",","``","[","B-LOC",",","B-LOC",",","I-LOC",",","...","]","''","``","[","...","]","''",",","``","[","...","]","''",":","param","~fastNLP.DataBundle","data_bundle",":","\u4f20\u5165\u7684DataBundle\u4e2d\u7684DataSet\u5fc5\u987b\u5305\u542braw_words\u548cner\u4e24\u4e2afield\uff0c\u4e14\u4e24\u4e2afield\u7684\u5185\u5bb9\u5747\u4e3aList","[","str","]","\u5728\u4f20\u5165DataBundle\u57fa\u7840\u4e0a\u539f\u4f4d\u4fee\u6539\u3002",":","return",":","\u5904\u7406\u540e\u7684","``","data_bundle","``"]
code: def process(self, data_bundle: DataBundle) -> DataBundle:
      r"""
      支持的DataSet的field为
  
      .. csv-table::
         :header: "raw_words", "target"
  
         "[Nadim, Ladki]", "[B-PER, I-PER]"
         "[AL-AIN, United, Arab, ...]", "[B-LOC, B-LOC, I-LOC, ...]"
         "[...]", "[...]"
  
      :param ~fastNLP.DataBundle data_bundle: 传入的DataBundle中的DataSet必须包含raw_words和ner两个field，且两个field的内容均为List[str]在传入DataBundle基础上原位修改。
      :return: 处理后的 ``data_bundle``
      """
      # 转换tag
      for name, dataset in data_bundle.iter_datasets():
          dataset.apply_field(
              self.convert_tag,
              field_name="target",
              new_field_name="target",
              num_proc=self.num_proc,
          )
  
      _add_words_field(data_bundle, lower=self.lower)
  
      # index
      _indexize(data_bundle)
  
      for name, dataset in data_bundle.iter_datasets():
          dataset.add_seq_len("words")
  
      return data_bundle
  
imports: from .pipe import Pipe
  from .utils import _add_chars_field
  from .utils import _indexize, _add_words_field
  from .utils import iob2, iob2bioes
  from fastNLP.io.data_bundle import DataBundle
  from ..loader.conll import Conll2003NERLoader, OntoNotesNERLoader
  from ..loader.conll import PeopleDailyNERLoader, WeiboNERLoader, MsraNERLoader, ConllLoader
  from ...core.vocabulary import Vocabulary
label_desc: Use image node_id 2 for calling the _NERPipe obj's underlying member method code with example usage: obj.process(data_bundle) and returns: data_bundle