Overview
This project is a Python implementation of n-gram language models, trained on the Lord of the Rings trilogy. Starting from the simplest version, a bigram, the project builds up throug n-grams, then layers on three important improvements: Pruning, Backoff and Kneser-Ney smoothing.
The end result is a text generator that produces new Tolkien like sentences. You can try it yourself at Ngram.