(label, maxlen, label_vocab_file_path, pad_id)
return label_id
Tokenize labels
Tokenize labels
Tokenize labels
def tokenize_label(label, maxlen, label_vocab_file_path, pad_id):
  """Tokenize labels"""
  vocabs = read_lines_from_text_file(label_vocab_file_path)
  label_id, _ = py_x_ops.sentence_to_ids(
      label,
      maxlen=maxlen,
      use_vocab_file=False,
      vocab=vocabs,
      load_token_ids_from_vocab=True,
      pad_id=pad_id,
      check_tokens=False)
  return label_id
def tokenize_label ( label , maxlen , label_vocab_file_path , pad_id ) : vocabs = read_lines_from_text_file ( label_vocab_file_path ) label_id , _ = py_x_ops . sentence_to_ids ( label , maxlen = maxlen , use_vocab_file = False , vocab = vocabs , load_token_ids_from_vocab = True , pad_id = pad_id , check_tokens = False ) return label_id