I keep on getting 0 points on seq_and_pad

[code removed - moderator]

I keep on getting 0 point on this function with this error:

There was a problem grading your submission. Details:
operands could not be broadcast together with shapes (120,) (10,)

1 Like

Please use function parameters instead of global variables.
See padding and maxlen.

One more thing. You already have a tokenizer. Don’t create one inside the function.

Convert sentences to sequences

sequences = tokenizer.texts_to_sequences(sentences)

Pad the sequences using the correct padding and maxlen

padded_sequences = pad_sequences(sequences, padding, maxlen)

I’ve hanged things it’s still not working. It’s giving me the error now:
Cannot interpret ‘120’ as a data type

The 3rd parameter of pad_sequences is dtype. Please use keyword argument to specify maxlen and padding. Do brush up on python if rusty.