Need help/resources to overcome my difficulty of learning sequence models and NLP


I started learning Deep Learning with PyTorch some months ago and I worked mostly with CNNs which were pretty straight forward and the concepts were fairly easy to grasp.

For the past 2 weeks, i am trying to get involved with sequence models and NLP in order to do my bachelor thesis on the topic of sentiment analysis and everything is messed up. I understand the architectures and the maths behind them, but i cant understand how to apply them correctly in PyTorch. What is the most complicated for me, is the input and the output of the networks. I can’t figure out how to feed the network, in what way depending of the problem, what i should be trying to get as an output at each time step etc.

Can someone explain me or give me some good resources in order to overcome this obstacle?
Thank you

This repo might be helpful. You’ll find some resources in the official tutorials too.

If you are interested in a higher-level API, then maybe FastAI could be a good resource as well.

Here is my code for an RNN classifier in case you have sentiment classes (e.g., positive, negative neutral) and not a numerical value. It’s a basic implementation of a many-to-one RNN network model. The code looks only a bit cluttered since I wanted to parameterize the number or RNN layers, linear layers, what activation and whether dropout to use, etc. Maybe this gives you some ideas how to proceed.