code: def sent_tokenize(text):
      """
      segment text into sentences
      """
      lang = detect_lang(text)
      sents = []
      if is_chinese(lang):
          for sent in re.findall(
              "[^!?。\.\!\?]+[!?。\.\!\?]?", text, flags=re.U
          ):
              sents.append(sent)
      else:
          for paragraph in segmenter.process(text):
              for sentence in paragraph:
                  sents.append(" ".join([t.value for t in sentence]))
      return sents
  
file_path: ktrain/ktrain/text/shallownlp/utils.py
imports: from .imports import *
label_desc: Use image node_id 8 for calling a global function with example usage: sent_tokenize(text) and returns: sents