【问题标题】:How to set the min_frequency while using tf.keras.preprocessing.text.tokenizer and ignore the words which are less then min_frequency?如何在使用 tf.keras.preprocessing.text.tokenizer 时设置 min_frequency 并忽略小于 min_frequency 的单词?
【发布时间】:2020-06-23 08:20:52
【问题描述】:

有什么方法可以设置 tf.keras.preprocessing.text.tokenizer 中的“min_frequency”,就像 tf.contrib.learn.preprocessing.VocabularyProcessor 中的“min_frequency”一样?

【问题讨论】:

    标签: python-2.7 tensorflow


    【解决方案1】:

    num_words 实际上有助于做同样的事情,这里num_words 将占据频率最高的num_words 词。

    所以,您从 min_frequency 中的 tf.contrib.learn.preprocessing.VocabularyProcessor 获得的功能可以得到相同的功能,但方式不同。

    【讨论】:

      猜你喜欢
      • 2020-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-10
      • 2021-10-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多