The idea behind language detection is based on the detection of the character among the expression and words in the text. The main principle is to detect commonly used words like to, of in English. Python provides various modules for language detection. In this article, the modules covered are:
Method 1: Using
This module is a port of Google’s language-detection library that supports 55 languages. This module don’t come with Python’s standard utility modules. So, it is needed to be installed externally. To install this type the below command in the terminal.
pip install langdetect
en ru es no hi ja
Method 2: Using
This module is used for natural language processing(NLP) tasks such as noun phrase extraction, sentiment analysis, classification, translation, and more. To install this module type the below command in the terminal.
pip install textblob
en ru es zh-CN hi ja
Method 3: Using
This module is a standalone Language Identification tool. It is pre-trained over a large number of languages (currently 97). It is a single.py file with minimal dependencies. To install this type the below command in the terminal.
pip install langrid
('en', -119.93012762069702) ('ru', -641.3409600257874) ('es', -191.01083326339722) ('zh', -199.18277835845947) ('hi', -286.99300467967987) ('ja', -875.6610476970673)
- Unknown facts about Python
- Python | Remove item from dictionary when key is unknown
- Detect an object with OpenCV-Python
- Python | Detect Polygons in an Image using OpenCV
- Python | Detect corner of an image using OpenCV
- Python Program to detect the edges of an image using OpenCV | Sobel edge detection method
- Python – The new generation Language
- Python Language Introduction
- Python Language advantages and applications
- Difference Between Go and Python Programming Language
- Python - Fastest Growing Programming Language
- Why is Python the Best-Suited Programming Language for Machine Learning?
- Python program to find GSoC organisations that use a Particular Programming Language
- Tips and Tricks for Competitive Programmers | Set 2 (Language to be used for Competitive Programming)
- Python | Convert list to Python array
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.