Support returning indices in text_dataset_from_directory
See original GitHub issueFor data logging I need the indices ids of a row/ batch. Current implementation is limited in this regard:
tf.keras.utils.text_dataset_from_directory(
directory
)
>> {"attention_mask" , "input_ids"}
For specific tasks the row id is needed:
tf.keras.utils.text_dataset_from_directory(
directory,
with_indices=True
)
>> {"attention_mask" , "input_ids", "indices_ids"}
@haifeng-jin, @Haaris-Rahman, @mattdangerw, @guberti, @edumucelli
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
tf.keras.utils.text_dataset_from_directory | TensorFlow v2.11.0
Generates a tf.data.Dataset from text files in a directory.
Read more >python - Get labels from dataset when using tensorflow ...
My images are organized in directories having the label as the name. The documentation says the function returns a tf.data.Dataset object.
Read more >Load - Hugging Face
Wherever a dataset is stored, Datasets can help you load it. This guide will show you how to load a dataset from: The...
Read more >Add an index to a list or library column - Microsoft Support
Learn how to add indexes to SharePoint list and library columns to make ... you are using to filter data both in views...
Read more >Image data loading - Keras
Dataset from image files in a directory. ... labels='inferred') will return a tf.data. ... Supported image formats: jpeg, png, bmp, gif.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yea I did not realize the
map_fn
has to be stateless. Another way is:The
new_ds
object will have the index .trying this out in google colab, actually does not increment the counter