code: def preprocess(lac, texts, word_dict, use_gpu=False, batch_size=1):
      """
      firstly, the predicted texts are segmented by lac module
      then, the word segmention results input into senta
      """
      result = []
      input_dict = {"text": texts}
      processed = lac.lexical_analysis(
          data=input_dict, use_gpu=use_gpu, batch_size=batch_size
      )
      unk_id = word_dict["<unk>"]
      for index, data in enumerate(processed):
          result_i = {"processed": []}
          result_i["origin"] = texts[index]
          for word in data["word"]:
              if word in word_dict:
                  _index = word_dict[word]
              else:
                  _index = unk_id
              result_i["processed"].append(_index)
          result.append(result_i)
      return result
  
imports: import io
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: preprocess(lac, texts, word_dict, use_gpu, batch_size) and returns: result