Language detection or language identification is the task of identifying the language(s) in a fragment of text.