UNQ_C6- Predit function

Not understood what is meaning of “increment by checking the ‘word’ index in vocab” for Q1 and Q2

Hi @Sushant_Patade

Yes, I agree, the code hints are kind of misleading. What is wanted from you is to encode q1:

  • From: “When will I see you?”
  • To: [585 76 4 46 53 21]

That can be accomplished in many ways. For me, the list comprehension could have been the most straightforward.

But since here you have Q1 and Q2 initialized as empty lists and the for loop containing code hint Q1 += None, each “None” should be a list with a single element of the number corresponding to the number of particular word.

For example, if Q1 is [585 76 ], then at next iteration, the word “I” becomes number 4 and is added to the list (like [4]), so that Q1 now is [585 76 4]. Note: [585 76] + [4] will get you [585 76 4].

I agree that this is not the most efficient way to encode words and I will suggest for code improvement.

Good luck!