Created
March 9, 2020 17:47
-
-
Save hanneshapke/e657f8df643c174ff8dca81309f6f677 to your computer and use it in GitHub Desktop.
adding_of_CLS_and_SEP_tokens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLS_ID = tf.constant(101, dtype=tf.int64) | |
SEP_ID = tf.constant(102, dtype=tf.int64) | |
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment