Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tfx.components.Transform returns invalid results #308

Closed
raminmohammadi opened this issue Sep 13, 2023 · 1 comment
Closed

tfx.components.Transform returns invalid results #308

raminmohammadi opened this issue Sep 13, 2023 · 1 comment

Comments

@raminmohammadi
Copy link

tf.version = 2.13.0

I'm encountering an issue while working with the "transform" function, which involves processing individual input data items. Each of these data inputs consists of two keys: 'entities' and 'text'.

My specific task is to perform a transformation on the "text" dimension of the input tensor, breaking it down into individual characters. For example, given the input "This is a test," I intend to follow these steps:

Split the text into character arrays: [['t', 'h', 'i', 's'], ['i', 's'], ['a'], ['t', 'e', 's', 't']]

Code 1: tf.strings.unicode_split(tf.strings.split('This is a test'), input_encoding='UTF-8')
Map each character to a dictionary, obtain its index, and pad each word to a width of 12 characters.

Code 2: tf.map_fn(get_index, text, fn_output_signature=tf.TensorSpec(shape=(1, Wlength), dtype=tf.int64, name=None))

I have create a colab file including the data and process and where the problem happens.

https://colab.research.google.com/drive/1ap8Gycu7s--mz0VAxp4W2DphAd1HW1yi?usp=sharing

@singhniraj08 singhniraj08 self-assigned this Sep 19, 2023
@singhniraj08
Copy link

@raminmohammadi, responded at tfx/issues/6278. Since this is a duplicate issue, requesting you to close this issue and follow above thread for updates. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants