Getting from words to documents