【发布时间】:2021-04-18 03:33:28
【问题描述】:
我尝试了以下方法但不起作用:
tf.strings.regex_replace(_string, "\xc2\xa0", ' ')
或
tf.strings.regex_replace(_string, "\%xc2\%xa0", ' ')
但两者都不起作用。 python 字符串替换方法应该可以工作,但作为 tf.data.Dataset 管道的一部分,它可能是模型层的一部分,我将不得不使用 tf.string.replace(...)。我也可以在 tf 管道之外进行字符串处理,但这不是优雅/强大的解决方案。
【问题讨论】:
标签: tensorflow2.0 tensorflow-datasets regexp-replace