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: :param: str encoding_type: target列使用什么类型的encoding方式，支持bioes, bio两种。
  :param bool lower: 是否将words小写化后再建立词表，绝大多数情况都不需要设置为True。
docstr_tok: [":","param",":","str","encoding_type",":","target\u5217\u4f7f\u7528\u4ec0\u4e48\u7c7b\u578b\u7684encoding\u65b9\u5f0f\uff0c\u652f\u6301bioes",",","bio\u4e24\u79cd\u3002",":","param","bool","lower",":","\u662f\u5426\u5c06words\u5c0f\u5199\u5316\u540e\u518d\u5efa\u7acb\u8bcd\u8868\uff0c\u7edd\u5927\u591a\u6570\u60c5\u51b5\u90fd\u4e0d\u9700\u8981\u8bbe\u7f6e\u4e3aTrue\u3002"]
code: def __init__(
      self, encoding_type: str = "bio", lower: bool = False, num_proc=0
  ):
      r"""
  
      :param: str encoding_type: target列使用什么类型的encoding方式，支持bioes, bio两种。
      :param bool lower: 是否将words小写化后再建立词表，绝大多数情况都不需要设置为True。
      """
      if encoding_type == "bio":
          self.convert_tag = iob2
      elif encoding_type == "bioes":
  
          def func(words):
              return iob2bioes(iob2(words))
  
          # self.convert_tag = lambda words: iob2bioes(iob2(words))
          self.convert_tag = func
      else:
          raise ValueError(
              "encoding_type only supports `bio` and `bioes`."
          )
      self.lower = lower
      self.num_proc = num_proc
  
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 1 to create a new _NERPipe object from inherited base classes: Pipe with example: obj = _NERPipe(encoding_type, lower, num_proc)