#NoPayJan Offer - Access all CloudxLab Courses for free between 1st to 31st JanEnroll Now >>
datasets["train"] contains the train data. Similarly,
datasets["test"] contains the test data.
datasets["train"].batch(2) batches 2 data samples at a time.
datasets["train"].batch(2).take(1) allows to take 1 batch at a time.
Each batch is of type
Eager Temsor. We could convert it to numpy array using
We shall traverse through the batches and show the review(first 200 characters) and label of the first batch data samples:
for X_batch, y_batch in datasets["train"].batch(2).take(1): for review, label in zip(X_batch.numpy(), y_batch.numpy()): print("Review:", review.decode("utf-8")[:200], "...") print("Label:", label, "= Positive" if label else "= Negative") print()
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here