1. A system comprising: one or more computers including one or more storage devices storing instructions that when executed by the one or more computers cause the one or more computers to perform operations comprising: receiving a particular sequence of terms that occurs in a document, wherein the document includes multiple sequences of terms outside of the particular sequence; determining that the particular sequence of terms includes one or more first terms that refer to a particular entity; selecting one or more second terms from the particular sequence of terms that includes the one or more first terms that refer to the particular entity; generating, for each of the selected one or more second terms that are from the particular sequence of terms that includes the one or more first terms that refer to the particular entity, a name-context pair that includes (i) the one or more first terms that refer to the particular entity, and (ii) the selected one or more second terms; determining, for each distinct name-context pair, a context consistency measure that is an estimate of a probability that the selected one or more second terms of the respective name-context pair will appear in another sequence of terms based on the occurrence in the other sequence of terms of the one or more first terms that refer to the particular entity of the respective name-context pair; and storing context-entity name data that associates one or more of the distinct name-context pairs with the corresponding context consistency measure in a memory.