code: def _word_lens_to_bmes(word_lens):
      r"""
  
      :param list word_lens: List[int], 每个词语的长度
      :return: List[str], BMES的序列
      """
      tags = []
      for word_len in word_lens:
          if word_len == 1:
              tags.append("S")
          else:
              tags.append("B")
              tags.extend(["M"] * (word_len - 2))
              tags.append("E")
      return tags
  
file_path: fastNLP/fastNLP/io/pipe/cws.py
imports: import re
  from itertools import chain
  from .pipe import Pipe
  from .utils import _indexize
  from fastNLP.io.data_bundle import DataBundle
  from fastNLP.io.loader import CWSLoader
label_desc: Use image node_id 1 for calling a global function with example usage: _word_lens_to_bmes(word_lens) and returns: tags