This algorithm is based on Svenstrup et al.
The notebook is inspired by a greate blog entry from Matthew Honnibal. If you are interested in NLP, you should check out his and his teams work!
There are also keras implementations for this algorithms. If you want to learn more, check out dsv77's repo.
If GitHub won't show this repo's .ipynb properly, use this nbviwer-link.