Converting Numpy text array to tf.data.Dataset
i have 2 a numpy nd arrays of shape (2000,) where each element is a list containing words as items. Thus each list is a sentence. The other nd array are just the binary labels.
I want to convert this to tensorflow data Dataset where each item is a sentence with a label.
but i get :
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type list).
How could this be done?
Solution – 1
This error usually occurs when each list in your array has a different number of elements (words). Try using a