1. A method implemented by data processing apparatus, the method comprising: obtaining textual input provided to a document editing application by a user device, the textual input being provided to the document editing application for inclusion in a document; providing the textual input and prior text of the document as input to a classification model that: identifies a plurality of document topics for the document based on the prior text and identifies one or more textual input topics for the textual input; and for each of the plurality of document topics for the document, assigns a document-topic score indicating a probability that the document is related to the document topic to which the document-topic score is assigned, wherein the prior text was included in the document prior to the textual input, and wherein the classification model was trained based on historical documents of other users; and receiving, from the classification model, one or more textual input topics for the textual input; determining, based on the textual input, to provide one or more textual suggestions for inclusion in the document, and in response: searching by document topic in a group of candidate selections to select a plurality of candidate suggestions that are associated with by a confidence score to one or more document topics for the document, the selecting one or more candidate suggestions also based on at least one of the one or more textual input topics and a ranking of each candidate suggestion based on the plurality of document topics and the one or more textual input topics and the one of the one or more topics to which each candidate is associated, and wherein the plurality of candidate suggestions are selected based on the ranking, each candidate suggestion comprising one or more words for inclusion into the document; generating a topic score for each of the plurality of candidate suggestions that were selected based on i) the selected candidate suggestion's confidence score and ii) the document-topic score assigned to the document topic associated with the selected candidate suggestion; and providing some but not all of the selected candidate suggestions based on the selected candidate suggestions' topic scores.