There are several statistical approaches to language identification using different techniques to classify the data. One technique is to compare the compressibility of the text to the compressibility of texts in a set of known languages. This approach is known as mutual information based distance measure. The same technique can also be used to empirically construct family trees of languages which closely correspond to the trees constructed using historical methods. Mutual information based distance measure is essentially equivalent to more conventional model-based methods and is not generally considered to be either novel or better than simpler techniques. Another technique, as described by Cavnar and Trenkle and Dunning is to create a language n-gram model from a "training text" for each of the languages. These models can be based on characters or encoded bytes ; in the latter, language identification and character encoding detection are integrated. Then, for any piece of text needing to be identified, a similar model is made, and that model is compared to each stored language model. The most likely language is the one with the model that is most similar to the model from the text needing to be identified. This approach can be problematic when the input text is in a language for which there is no model. In that case, the method may return another, "most similar" language as its result. Also problematic for any approach are pieces of input text that are composed of several languages, as is common on the Web. For a more recent method, see Řehůřek and Kolkus. This method can detect multiple languages in an unstructured piece of text and works robustly on short texts of only a few words: something that the n-gram approaches struggle with. An older statistical method by Grefenstette was based on the prevalence of certain function words.
Identifying similar languages
One of the great bottlenecks of language identification systems is to distinguish between closely related languages. Similar languages like Serbian and Croatian or Indonesian and Malay present significant lexical and structural overlap, making it challenging for systems to discriminate between them. Recently, the DSL shared task has been organized providing a dataset containing 13 different languages in six language groups: Group A, Group B, Group C, Group D, Group E, Group F. The best system reached performance of over 95% results. Results of the DSL shared task are described in Zampieri et al. 2014.
Software
Apache OpenNLP includes char n-gram based statistical detector and comes with a model that can distinguish 103 languages
Apache Tika contains a language detector for 18 languages