code: def _toks_from_sentence(doc, entity_type, tag_type):
      toks = []
      for tok in WHITESPACE_SPLITTER.split(doc):
          if len(tok) > 0:
              toks.append(
                  Tok(
                      _get_pos_tag(tok),
                      tok[:2].lower(),
                      tok.lower(),
                      ent_type=""
                      if entity_type is None
                      else entity_type.get(tok, ""),
                      tag=""
                      if tag_type is None
                      else tag_type.get(tok, ""),
                  )
              )
      return toks
  
file_path: scattertext/scattertext/WhitespaceNLP.py
imports: import re
  from scattertext.emojis.ProcessedEmojiStructure import VALID_EMOJIS
label_desc: Use image node_id 3 for calling a global function with example usage: _toks_from_sentence(doc, entity_type, tag_type) and returns: toks