gpt4 book ai didi

python - TensorFlow VocabularyProcessor 的替代方案是什么?

转载 作者:太空狗 更新时间:2023-10-30 01:25:42 25 4
gpt4 key购买 nike

它说它已被弃用,将来会被删除。另一行说“请使用 tensorflow/transform 或 tf.data”。我搜索了互联网,但找不到答案。这是给我警告的行:

# Change texts into numeric vectors
vocab_processor = tf.contrib.learn.preprocessing.VocabularyProcessor(max_sequence_length,min_frequency=min_word_frequency)

最佳答案

我也没有解决。一组解释在这里:

tf.contrib.learn.preprocessing: Deprecated. The python-only preprocessing functions are not a good fit for TensorFlow. Please use tf.data, and consider tensorflow/transform for more complex use cases.

https://github.com/tensorflow/tensorflow/blob/r1.8/tensorflow/contrib/learn/README.md

这个例子应该有所帮助......但它并没有解释太多 https://github.com/tensorflow/transform/blob/master/examples/sentiment_example.py

review_indices = tft.compute_and_apply_vocabulary(
review_tokens, top_k=VOCAB_SIZE)

关于python - TensorFlow VocabularyProcessor 的替代方案是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49830843/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com