首页 > 解决方案 > 如何在 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.

我试过标准化=“无”、“无”、“无”、“无”、无和无,但没有任何效果。我查看了文档和博客文章,但我不知道我做错了什么......任何想法

标签: pythontensorflowmachine-learningkerasword2vec

解决方案


推荐阅读