27. A non-transitory computer-readable storage medium comprising instructions for causing one or more processors of an electronic device to: receive a text input, the text input associated with an input context; determine, using a first language model, a first frequency of occurrence of an m-gram with respect to a first subset of a corpus, wherein the first subset is associated with a first context, and wherein the m-gram includes at least one word in the text input; determine, based on a degree of similarity between the input context and the first context, a first weighting factor, wherein a weighted first frequency of occurrence of the m-gram is obtained by applying the first weighting factor to the first frequency of occurrence of the m-gram; determine, using the first language model, a second frequency of occurrence of the m-gram with respect to a second subset of the corpus, wherein the second subset is associated with a second context; determine, based on a degree of similarity between the input context and the second context, a second weighting factor, wherein a weighted second frequency of occurrence of the m-gram is obtained by applying the second weighting factor to the second frequency of occurrence of the m-gram; and determine, based on the weighted first frequency of occurrence of the m-gram and the weighted second frequency of occurrence of the m-gram, a first weighted probability of a first predicted text given the text input, wherein the m-gram includes at least one word in the first predicted text.
27. A non-transitory computer-readable storage medium comprising instructions for causing one or more processors of an electronic device to: receive a text input, the text input associated with an input context; determine, using a first language model, a first frequency of occurrence of an m-gram with respect to a first subset of a corpus, wherein the first subset is associated with a first context, and wherein the m-gram includes at least one word in the text input; determine, based on a degree of similarity between the input context and the first context, a first weighting factor, wherein a weighted first frequency of occurrence of the m-gram is obtained by applying the first weighting factor to the first frequency of occurrence of the m-gram; determine, using the first language model, a second frequency of occurrence of the m-gram with respect to a second subset of the corpus, wherein the second subset is associated with a second context; determine, based on a degree of similarity between the input context and the second context, a second weighting factor, wherein a weighted second frequency of occurrence of the m-gram is obtained by applying the second weighting factor to the second frequency of occurrence of the m-gram; and determine, based on the weighted first frequency of occurrence of the m-gram and the weighted second frequency of occurrence of the m-gram, a first weighted probability of a first predicted text given the text input, wherein the m-gram includes at least one word in the first predicted text. 31. The computer-readable storage medium of claim 27 , wherein the first context includes a first application of the electronic device, and wherein the first subset includes a collection of user text that is associated with the first application.