TensorFlow进行文字编码的三种方式
文章目录
前言
TF.Text
import tensorflow_text as text
具体看官方文档就行呀
tf.keras.preprocessing.text
具体看官方文档就行呀
TensorFlow Datasets
具体看官方文档就行呀
总结
三种方式,一般使用TensorFlow Datasets的数据集就可以用他的API,不过他的tfds.features.text.SubwordTextEncoder
废弃了转tfds.deprecated.text.TextEncoder
了要注意。
自己定义的数据集合一般就用tf.keras.preprocessing.text这个更灵活哈