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)
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python | Remove item from dictionary when key is unknown
- Unknown facts about Python
- Find the average of an unknown number of inputs in Python
- Python Program to detect the edges of an image using OpenCV | Sobel edge detection method
- Python | Detect corner of an image using OpenCV
- Python | Detect Polygons in an Image using OpenCV
- Detect Cat Faces in Real-Time using Python-OpenCV
- Detect the RGB color from a webcam using Python - OpenCV
- Detect Mutation using Python
- Detect an object with OpenCV-Python
- Python - Detect loop in Dictionaries
- Detect script exit in Python
- Grammar Checker in Python using Language-check
- Language Translator Using Google API in Python
- How to Create a Programming Language using Python?
- Detect and Recognize Car License Plate from a video in real time
- Interquartile Range to Detect Outliers in Data
- Natural Language Processing using Polyglot - Introduction
- Python Language Introduction
- Python Language advantages and applications
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.