Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

language detection

I am using tesseract for OCR, mainly on invoices. However, tesseract requires to specify the language before it starts processing a file.

I thought I am going to perform ocr based on a predefined default language. Then I'd like use the resulting text to check which language is used. If it is not the default language, I process it again in order to get a better result from tesseract.

But how can I implement a language detection algorithm? Is there a C++ library I could use?

like image 755
Pedro Avatar asked Nov 16 '11 19:11

Pedro


2 Answers

This paper "Natural Language Identification for OCR Applications" describes techniques involved in identification tasks similar to your requirements.

like image 124
nguyenq Avatar answered Sep 22 '22 22:09

nguyenq


I am not sure if this would help as the library is in Java. But I found it really cool as it is able to detect around 50 languages from the given text and with a pretty good precision level. You may like to have a look at it and as it is open source, you may rewrite the code in C++ and give it back to the open source community if your application requires to be written only in C++.

Here is the link for the same:

http://code.google.com/p/language-detection/

Note: It uses the Apache Nutch and Tika libraries for analysis.

like image 41
Abhishek Jain Avatar answered Sep 21 '22 22:09

Abhishek Jain