【问题标题】:Get Vocabulary list from Tensorflow pretrained embedding从 Tensorflow 预训练嵌入中获取词汇表
【发布时间】:2021-04-01 15:36:57
【问题描述】:

我现在使用这个https://tfhub.dev/google/Wiki-words-500/2 作为预训练嵌入。对于我的应用程序(文本生成),我有兴趣获取词汇表中的标记列表。我知道它的尺寸是 1009375。但我似乎无法获得清单。我知道它已加载到内存中,但我似乎找不到它。有人知道怎么做吗?

【问题讨论】:

    标签: tensorflow tensorflow-datasets


    【解决方案1】:

    google/Wiki-words-500/2 模型的默认缓存位置是 /tmp/tfhub_modules/bf115a5fe517f019bebae05b433eaeee6415f5bf (more on caching)。您将在 assets 目录中找到该文件,其中包含辅助文件:

    wc -l /tmp/tfhub_modules/bf115a5fe517f019bebae05b433eaeee6415f5bf/assets/tokens.txt
    > 1009374
    

    【讨论】:

      猜你喜欢
      • 2016-06-20
      • 2023-03-21
      • 2017-02-16
      • 2018-04-11
      • 2016-06-11
      • 1970-01-01
      • 2019-12-30
      • 1970-01-01
      相关资源
      最近更新 更多