W3cubDocs

/TensorFlow 2.3

tf.raw_ops.UnicodeScript

Determine the script codes of a given tensor of Unicode integer code points.

This operation converts Unicode code points to script codes corresponding to each code point. Script codes correspond to International Components for Unicode (ICU) UScriptCode values. See http://icu-project.org/apiref/icu4c/uscript_8h.html Returns -1 (USCRIPT_INVALID_CODE) for invalid codepoints. Output shape will match input shape.

Examples:

tf.strings.unicode_script([1, 31, 38])
<tf.Tensor: shape=(3,), dtype=int32, numpy=array([0, 0, 0], dtype=int32)>
Args
input A Tensor of type int32. A Tensor of int32 Unicode code points.
name A name for the operation (optional).
Returns
A Tensor of type int32.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/raw_ops/UnicodeScript