i am getting the error in word_to _idx is not defined. where do i need to define it, As i created the function generator but after compiling it always gives the same error
Word_to_idx is not defined
You need to define this dictionary, initialize empty dictionary where you initialized idx_to_word = {], add word_to_idx = {] in next line, Hope this removes the error.
Happy learning 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.