code: def bert_preprocess(filename, vocab):
      tokenizer = tokenization.FullTokenizer(
          vocab_file=vocab, do_lower_case=False
      )
      new_filename = filename + ".bert"
      f1 = open(new_filename, "w")
      per_count = 0
      with open(filename, "r") as f:
          lines = f.readlines()
          for line in lines:
              str1 = line.split("\t")[1]
              label1 = line.split("\t")[0]
              new_label_list = []
              old_label_list = label1.split(" ")
              word_list = str1.split(" ")
              tokens = []
              tokens.append("[CLS]")
              new_label_list.append("O")
              per_count = 0
              for i, (w, t) in enumerate(
                  zip(word_list, old_label_list)
              ):
                  token = tokenizer.tokenize(w)
                  tokens.extend(token)
                  for i, _ in enumerate(token):
                      if i == 0:
                          new_label_list.append(t)
                      else:
                          new_label_list.append("X")
              tokens.append("[SEG]")
              new_label_list.append("O")
              assert len(tokens) == len(new_label_list)
              rm_new_label_list = [
                  i for i in new_label_list if i != "O" and i != "X"
              ]
              rm_old_label_list = [
                  i for i in old_label_list if i != "O" and i != "X"
              ]
              assert len(rm_new_label_list) == len(rm_old_label_list)
              f1.write(
                  " ".join(new_label_list)
                  + "\t"
                  + " ".join(tokens)
                  + "\n"
              )
  
imports: import sys
  from absl import logging
  from bert import tokenization
label_desc: Use image node_id 1 for calling a global function with example usage: bert_preprocess(filename, vocab) without return types