def METHOD_NAME(text, sequence_length=MAX_SEQ_LEN):
    """
    Perform the BERT preprocessing from text -> input token ids
    """
    # convert text into token ids
    tokens = bert_tokenizer.tokenize(text)
    # flatten the output ragged tensors
    tokens = tokens.merge_dims(1, 2)[:, :sequence_length]
    # Add start and end token ids to the id sequence
    start_tokens = tf.fill([tf.shape(text)[0], 1], CLS_ID)
    end_tokens = tf.fill([tf.shape(text)[0], 1], SEP_ID)
    tokens = tokens[:, :sequence_length - 2]
    tokens = tf.concat([start_tokens, tokens, end_tokens], axis=1)
    # truncate sequences greater than MAX_SEQ_LEN
    tokens = tokens[:, :sequence_length]
    # pad shorter sequences with the pad token id
    tokens = tokens.to_tensor(default_value=PAD_ID)
    pad = sequence_length - tf.shape(tokens)[1]
    tokens = tf.pad(tokens, [[0, 0], [0, pad]], constant_values=PAD_ID)
    # and finally reshape the word token ids to fit the output
    # data structure of TFT
    return tf.reshape(tokens, [-1, sequence_length])