Created
July 30, 2019 14:59
-
-
Save billpku/a1bdc2d7e27f37fd8dc1fd0e9dd54d69 to your computer and use it in GitHub Desktop.
NER with BERT in Action
This file contains hidden or 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
| from keras.preprocessing.sequence import pad_sequences | |
| # Make text token into id | |
| input_ids = pad_sequences([tokenizer.convert_tokens_to_ids(txt) for txt in tokenized_texts], | |
| maxlen=max_len, dtype="long", truncating="post", padding="post") | |
| print(input_ids[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment