我使用的是Google,下面的导入不知何故不起作用:
from bert.tokenization import FullTokenizer我得到了这个错误:
ModuleNotFoundError: No module named 'bert.tokenization'我试图通过运行以下命令来安装bert:
!pip install --upgrade bert知道如何解决这个错误吗?
发布于 2019-06-12 05:18:37
我找到了它:
!pip install bert-tensorflow发布于 2020-04-07 11:09:15
安装:pip install bert-for-tf2
然后进口,
from bert import bert_tokenization BertTokenizer = bert_tokenization.FullTokenizer
发布于 2020-02-28 12:25:43
对于使用TensorFlow 2.0和bert For -TF2库遇到这个问题的人,我发现在使用pip3安装后丢失了一些文件。我在这里发布了我的解决方案:
https://github.com/google-research/bert/issues/638#issuecomment-592488730
https://stackoverflow.com/questions/56555066
复制相似问题