Я пытаюсь использовать Bert из TensorFlow Hub и построить токенизатор, вот что я делаю:
>>> import tensorflow_hub as hub
>>> from bert.tokenization import FullTokenizer
>>> BERT_URL = 'https://tfhub.dev/tensorflow/bert_zh_L-12_H-768_A-12/1'
>>> bert_layer = hub.KerasLayer(BERT_URL, trainable=False)
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/resource_variable_ops.py:1781: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/resource_variable_ops.py:1781: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Но теперь, когда я проверяю файл словаря в разрешенных объектах, я получаю пустой тензор
>>> bert_layer.resolved_object.vocab_file.asset_path.shape
TensorShape([])
Как правильно получить этот файл словаря?