python - 如何在 Tensorflow TextVectorization 上标准化 =“None”
问题描述
这可能是一个非常简单的问题,但我无法弄清楚。我正在使用 Tensorflow 的 TextVectorization 功能,但我不想对我的文本进行任何标准化。这是我要导入的打包:
import tensorflow as tf
from tensorflow.keras.layers.experimental.preprocessing import TextVectorization
from tensorflow.keras.models import Sequential
from tensorflow.keras import Input
from tensorflow.data import Dataset
这是我的实际代码的样子:
vectorize_layer = TextVectorization(max_tokens=10000, standardize="None", split='`', output_mode='int', output_sequence_length=3)
这是我得到的错误(此特定情况为“无”):
ValueError: The standardize argument of layer TextVectorization received an invalid value None. Allowed values are: `None`, a `Callable`, or one of the following values: lower_and_strip_punctuation.
我试过标准化=“无”、“无”、“无”、“无”、无和无,但没有任何效果。我查看了文档和博客文章,但我不知道我做错了什么......任何想法
解决方案
推荐阅读
- android - 如何更改已知项目保存在 SharedPrefrence 中并将图标设置为菜单中的收藏夹?
- powerbi - 如果为空则跳过一条记录
- eclipse - 更改scala编译器版本时找不到或加载主类错误
- webpack - 为 localhost 配置 HTTPS 以通过 USB 访问手机上的麦克风
- kdb - 如何在kdb的列名中选择包含点的列
- c - 当我想保护对向量的修改时,如果尝试使用 const 子句,为什么它不起作用?
- javascript - 从 css 模块中排除一个文件并单独生成 webpack 资产
- python-3.x - 假设检验总体和样本平均值
- linux - Splunk 错误:“无法查找 HOME 变量”
- c++ - C++ 你可以有条件地向下转换类指针吗?