Determine the Language of a Text
Make a function that determines the language that a text is written in.
how it works
Samples of texts in various languages are abundant on the web. Import French, English, German, and Spanish texts to use to train a classifier:
This is what the beginning of the French text looks like:
Make a classifier function using the training texts:
Test the classifier on texts that were not in the training set:
Make a table of classified phrases: