code: def get_tokenizer(tokenize_method: str, lang="en"):
      r"""
  
      :param tokenize_method: 获取 tokenzier 方法，支持 ``['spacy', 'raw', 'cn-char']`` 。``'raw'`` 表示使用空格作为切分， ``'cn-char'`` 表示
          按字符切分，``'spacy'`` 则使用 :mod:`spacy` 库进行分词。
      :param lang: :mod:`spacy` 使用的语言，当前仅支持 ``'en'`` 。
      :return: tokenize 函数
      """
      tokenizer_dict = {
          "spacy": None,
          "raw": _raw_split,
          "cn-char": _cn_char_split,
      }
      if tokenize_method == "spacy":
          import spacy
  
          spacy.prefer_gpu()
          if lang != "en":
              raise RuntimeError("Spacy only supports en right now.")
          if parse_version(spacy.__version__) >= parse_version("3.0"):
              en = spacy.load("en_core_web_sm")
          else:
              en = spacy.load(lang)
          tokenizer = lambda x: [w.text for w in en.tokenizer(x)]
      elif tokenize_method in tokenizer_dict:
          tokenizer = tokenizer_dict[tokenize_method]
      else:
          raise RuntimeError(
              f"Only support {tokenizer_dict.keys()} tokenizer."
          )
      return tokenizer
  
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 3 for calling a global function with example usage: get_tokenizer(tokenize_method, lang) and returns: tokenizer