PyTorch implementation of Dieng et al.'s TopicRNN: a language model that combines local (syntatic) dependencies, with global (semantic) dependencies to produce a contextual RNN that can be trained end-to-end.
The RNN is responsible for capturing local, syntactic properties while the learned, latent topics are responsbile for capturing global semantics and coherence.