Get_padded_sequences

Obviously something is wrong with my code but I don’t see it. Here are my results and the expected results?

First padded sequence looks like this: [96 1 1 … 0 0 0] Numpy array of all sequences has shape: (2225, 2441) This means there are 2225 sequences in total and each one has a size of 2441

Expected Output:

First padded sequence looks like this: 

[  96  176 1157 ...    0    0    0]

Numpy array of all sequences has shape: (2225, 2438)

This means there are 2225 sequences in total and each one has a size of 2438

Hello @Michael_Crabtree ,

Send me your notebook via dm such that I can check where it went wrong.By clicking on the profile picture, you will see an option to message.There you can attach your notebook. Then we can discuss the issues here, under the topic you created.

With regards,
Nilosree Sengupta

Hello @Michael_Crabtree ,

I have gone through your notebook.

Under the function, def fit_tokenizer(sentences), for instantiating the Tokenizer class, you don’t need to take num_words= 100. For this you are getting a different output.Removing it will solve this.

WIth regards,
Nilosree Sengupta

That was it!!
Thank you very much for your help.
Mike

Well, not exactly. Now my answer looks like this. Still a little bit off(and the grader doesn’t like it!)

First padded sequence looks like this: [ 96 176 1158 … 0 0 0] Numpy array of all sequences has shape: (2225, 2441) This means there are 2225 sequences in total and each one has a size of 2441

Expected Output:

First padded sequence looks like this: 

[  96  176 1157 ...    0    0    0]

Numpy array of all sequences has shape: (2225, 2438)

This means there are 2225 sequences in total and each one has a size of 2438

this is my answer:

First padded sequence looks like this:

[ 96 176 1158 … 0 0 0]

Numpy array of all sequences has shape: (2225, 2441)

This means there are 2225 sequences in total and each one has a size of 2441

Hello @Michael_Crabtree ,

In my side, I get the perfect output with the solution I provided to u.
Send me via dm your latest version of notebook again, if not yet resolved.

With regards,
Nilosree Sengupta