1. A method for text prediction comprising: at an electronic device: receiving a text input, the text input associated with an input context; determining, 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; determining, 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; determining, 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; determining, 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 determining, 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.