Как восстановить токен из весов кодировщика BERT
#tensorflow #nlp #bert-language-model Вопрос: preprocess_url = "https://tfhub.dev/tensorflow/bert_en_cased_preprocess/3" encoder_url = 'https://tfhub.dev/tensorflow/bert_en_cased_L-12_H-768_A-12/4' bert_preprocess_model = hub.KerasLayer(preprocess_url) bert_model = hub.KerasLayer(encoder_url) text = ['hi'] text_preprocessed = bert_preprocess_model(text) bert_model(text_preprocessed)['sentence_output'] # This last output prints a (1,…