K Best, Document based model