C4W3_Assignment in Natural Language Processing with Attention Models

Hi @Pavamana

Notice the utils.py file code mentions model after the input and output and as you mention in the next predict word model first, it was causing the type error.

kindly mention according to the image I have highlight in the blue

Let me know if the issue persist.
The reason it was causing this error was in the helper function the padding mask mentioned the input (i.e. in this case tokenised_question) first and as you mentioned model first, it raised an error.

Regards
DP

Hi @Deepti_Prasad ,
I’m just reading your responses as I’m also not getting the expected output and I was wondering why we even have padded_question and why did we run the keras pad_sequences if we are not using it at all? I assume I’m missing something so please any ideas would help a lot.

you are mixing your question with your error, I checked your comment on other thread but because you had asked a particular mentor, I didn’t respond.

Anyways for this question, the reason we are not using padded question here because for the grade cell in question, the padded question are recalled by particular argument i.e. tokenized_question.

Now there would be doubt why would they want to create a separate padded_question with argument name tokenized_question, so the answer would be padded_question was kind of recalled as global variable where as tokenized_question here is assigned to a particular set of questions or a particular question, hence recalled for this grade cell separately.

Also @RLSK, it is request as community guidelines we always advise learner to create new topics, so they don’t loose track of their learning journey, you can always tag a post link which you is similar to your issue rather than commenting on older threads as sometime mentors might ignore as it is marked post resolved with solution.

Regards
DP