Can I get a hint! Max len of the longest tweet NLP

When creating a post, please add:

  • Week # must be added in the tags option of the post.
  • Link to the classroom item you are referring to:
  • Description (include relevant info but please do not post solution code or your entire notebook)

Hello @arvyzukai,

I was doing this practice ungraded assignment, although I am getting the correct expected output while running the grader cell, the test cell states otherwise.

I recalled the length of the tweet by using len function for the tweet in the whole dataset as in train_x + val_x which gave me the matching expected output but states otherwise while running the cell. I am sharing screenshot of both exercise cells where it matches with the expected output.

![Screenshot 1945-10-18 at 1.53.15 PM|690x261](upload://dp


66DTB76DykWC7DLCa6bus5jTI.png)

I guess I need to pad the max length of whole dataset??? Hint please!!!

Regards
DP

Hi @Deepti_Prasad

Aren’t you by chance using train_x and val_x instead of training_x and validation_x in the max_length(..) function?
It could be one of the explanations why you get the expected output but fail the tests (where in your case the max_length is also 51, instead of 2 or 3).

Cheers

Lol shoot you are right eessh :joy: :zipper_mouth_face: :woman_facepalming:

I did try once only training_x but without validation x (probably the mistake :grin:) then switched back to train_x

Thank you arvy :saluting_face:

Regards
DP

1 Like