I am trying to combine CNN and LSTM for the textual data for purpose of classifying.
Could someone give me some examples of how to implement a CNN + LSTM structure in PyTorch? I know I should use word embeddings to convert text to vector. Then, these vectors should be sent to CNN and the output of CNN (features) should be fed into the LSTM network and then a sigmoid layer should be applied. But I have no idea how to implement this by PyTorch?

image700×211 3.69 KB

Thanks!