AttributeError: 'list' object has no attribute 'keys' When doing NLP

Hello, I am trying to create my own NLP algorithm after watching the video for Lesson 4. I have basically replicated exactly what Jeremy has done, except for a few changes to variable names. But, when I call trainer.train() it is giving me an “AttributeError: ‘list’ object has no attribute ‘keys’”. I have looked around and I cannot find a single solution that is working for me. Does anyone have any ideas about what I should do?

Here is the link to my notebook: notebook1eaac02bf3 | Kaggle