" for s,l in train_data " what is the "s" and "l"?

it occurring here :


i didn’t find any “s” or “l” dict in imdb_reviews

i knew that s is sentences,l is labels ,but where is was been defined? i m confuse.

Maybe investigate the data type and structure of train_data. If it has named columns, what are they?

s refers to the text and l refers to the label. Please read this to know more about dataset iteration using methods like take and Iterator

You can also look at info.features and see this:

FeaturesDict({
        'label': ClassLabel(shape=(), dtype=tf.int64, num_classes=2),
        'text': Text(shape=(), dtype=tf.string),
    }),

s and l are just iterators in the for loop, referring to sentences and labels respectively which are then being defined within the loop conditions. You can use any other letter characters or strings instead of those (for example: a,b or x,y or sentence, label), but make sure you also adjust the loop conditions according to your chosen iterators and assign them appropriately.