Apache Tika not properly extracting text from PDF for Indian languages












1















I tried to extract text from PDF, it is working fine for English but not for Indian languages like Hindi, Tamil, Malayalam etc... See the sample below, all the bold text in the extracted content is not correct. Does Tika work with non English languages?



Original Text :



மக்களுக்குப் புத்தாண்டு பரிசாக, எல்இடி டிவி, சினிமா டிக்கெட், கம்ப்யூட்டர் மானிட்டர், மாற்றுத்திறனாளிகளுக்கான உதிரிப்பாகங்கள் உள்ளிட்ட 23 வகை பொருட்கள், சேவைகளின் குறைக்கப்பட்ட ஜிஎஸ்டி வரி இன்று முதல் அமலுக்கு வந்தது.



Extracted Text :



மக்களக்கப் பத்தாண்ட பரிசாக, எல்இடடவ, சனிமா டக்ககட,் கம்ப்யட்டர் மானிட்டர,்



மாற்றத்தறனாளிகளக்கானஉதரிப்பாகங்கள் உள்ளிட்ட 23
வகககபாரடக்ள், சசகவகளின்



ககறக்கப்படட் ஜஎஸ்ட வரி இன்றமதல் அமலக்கவந்தத.



UPDATE:



If I convert the PDF to JPG and use TesseractOCRParser and mention the language as Tamil then it works lot better than the PDFParser










share|improve this question




















  • 2





    If you select the text in Acrobat and cut-n-paste it out to something like notepad, do you get the right text, or basically the same that Tika gets?

    – Gagravarr
    Jan 2 at 11:44











  • @Gagravarr Just checked, copy paste also not working properly, same as Tika

    – wolverine
    Jan 2 at 13:01








  • 1





    Right, your problem is with whatever produced the PDF then. It has almost certainly done some bad OCR, and put that text behind the image of the scan. Your only option is to tell Apache Tika to re-OCR it, and ignore the text in the PDF

    – Gagravarr
    Jan 2 at 23:44











  • @Gagravarr I am now doing ocr_only strategy and it works lot better, thanks

    – wolverine
    Jan 3 at 5:22
















1















I tried to extract text from PDF, it is working fine for English but not for Indian languages like Hindi, Tamil, Malayalam etc... See the sample below, all the bold text in the extracted content is not correct. Does Tika work with non English languages?



Original Text :



மக்களுக்குப் புத்தாண்டு பரிசாக, எல்இடி டிவி, சினிமா டிக்கெட், கம்ப்யூட்டர் மானிட்டர், மாற்றுத்திறனாளிகளுக்கான உதிரிப்பாகங்கள் உள்ளிட்ட 23 வகை பொருட்கள், சேவைகளின் குறைக்கப்பட்ட ஜிஎஸ்டி வரி இன்று முதல் அமலுக்கு வந்தது.



Extracted Text :



மக்களக்கப் பத்தாண்ட பரிசாக, எல்இடடவ, சனிமா டக்ககட,் கம்ப்யட்டர் மானிட்டர,்



மாற்றத்தறனாளிகளக்கானஉதரிப்பாகங்கள் உள்ளிட்ட 23
வகககபாரடக்ள், சசகவகளின்



ககறக்கப்படட் ஜஎஸ்ட வரி இன்றமதல் அமலக்கவந்தத.



UPDATE:



If I convert the PDF to JPG and use TesseractOCRParser and mention the language as Tamil then it works lot better than the PDFParser










share|improve this question




















  • 2





    If you select the text in Acrobat and cut-n-paste it out to something like notepad, do you get the right text, or basically the same that Tika gets?

    – Gagravarr
    Jan 2 at 11:44











  • @Gagravarr Just checked, copy paste also not working properly, same as Tika

    – wolverine
    Jan 2 at 13:01








  • 1





    Right, your problem is with whatever produced the PDF then. It has almost certainly done some bad OCR, and put that text behind the image of the scan. Your only option is to tell Apache Tika to re-OCR it, and ignore the text in the PDF

    – Gagravarr
    Jan 2 at 23:44











  • @Gagravarr I am now doing ocr_only strategy and it works lot better, thanks

    – wolverine
    Jan 3 at 5:22














1












1








1








I tried to extract text from PDF, it is working fine for English but not for Indian languages like Hindi, Tamil, Malayalam etc... See the sample below, all the bold text in the extracted content is not correct. Does Tika work with non English languages?



Original Text :



மக்களுக்குப் புத்தாண்டு பரிசாக, எல்இடி டிவி, சினிமா டிக்கெட், கம்ப்யூட்டர் மானிட்டர், மாற்றுத்திறனாளிகளுக்கான உதிரிப்பாகங்கள் உள்ளிட்ட 23 வகை பொருட்கள், சேவைகளின் குறைக்கப்பட்ட ஜிஎஸ்டி வரி இன்று முதல் அமலுக்கு வந்தது.



Extracted Text :



மக்களக்கப் பத்தாண்ட பரிசாக, எல்இடடவ, சனிமா டக்ககட,் கம்ப்யட்டர் மானிட்டர,்



மாற்றத்தறனாளிகளக்கானஉதரிப்பாகங்கள் உள்ளிட்ட 23
வகககபாரடக்ள், சசகவகளின்



ககறக்கப்படட் ஜஎஸ்ட வரி இன்றமதல் அமலக்கவந்தத.



UPDATE:



If I convert the PDF to JPG and use TesseractOCRParser and mention the language as Tamil then it works lot better than the PDFParser










share|improve this question
















I tried to extract text from PDF, it is working fine for English but not for Indian languages like Hindi, Tamil, Malayalam etc... See the sample below, all the bold text in the extracted content is not correct. Does Tika work with non English languages?



Original Text :



மக்களுக்குப் புத்தாண்டு பரிசாக, எல்இடி டிவி, சினிமா டிக்கெட், கம்ப்யூட்டர் மானிட்டர், மாற்றுத்திறனாளிகளுக்கான உதிரிப்பாகங்கள் உள்ளிட்ட 23 வகை பொருட்கள், சேவைகளின் குறைக்கப்பட்ட ஜிஎஸ்டி வரி இன்று முதல் அமலுக்கு வந்தது.



Extracted Text :



மக்களக்கப் பத்தாண்ட பரிசாக, எல்இடடவ, சனிமா டக்ககட,் கம்ப்யட்டர் மானிட்டர,்



மாற்றத்தறனாளிகளக்கானஉதரிப்பாகங்கள் உள்ளிட்ட 23
வகககபாரடக்ள், சசகவகளின்



ககறக்கப்படட் ஜஎஸ்ட வரி இன்றமதல் அமலக்கவந்தத.



UPDATE:



If I convert the PDF to JPG and use TesseractOCRParser and mention the language as Tamil then it works lot better than the PDFParser







apache-tika






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 10:26







wolverine

















asked Jan 1 at 5:06









wolverinewolverine

329319




329319








  • 2





    If you select the text in Acrobat and cut-n-paste it out to something like notepad, do you get the right text, or basically the same that Tika gets?

    – Gagravarr
    Jan 2 at 11:44











  • @Gagravarr Just checked, copy paste also not working properly, same as Tika

    – wolverine
    Jan 2 at 13:01








  • 1





    Right, your problem is with whatever produced the PDF then. It has almost certainly done some bad OCR, and put that text behind the image of the scan. Your only option is to tell Apache Tika to re-OCR it, and ignore the text in the PDF

    – Gagravarr
    Jan 2 at 23:44











  • @Gagravarr I am now doing ocr_only strategy and it works lot better, thanks

    – wolverine
    Jan 3 at 5:22














  • 2





    If you select the text in Acrobat and cut-n-paste it out to something like notepad, do you get the right text, or basically the same that Tika gets?

    – Gagravarr
    Jan 2 at 11:44











  • @Gagravarr Just checked, copy paste also not working properly, same as Tika

    – wolverine
    Jan 2 at 13:01








  • 1





    Right, your problem is with whatever produced the PDF then. It has almost certainly done some bad OCR, and put that text behind the image of the scan. Your only option is to tell Apache Tika to re-OCR it, and ignore the text in the PDF

    – Gagravarr
    Jan 2 at 23:44











  • @Gagravarr I am now doing ocr_only strategy and it works lot better, thanks

    – wolverine
    Jan 3 at 5:22








2




2





If you select the text in Acrobat and cut-n-paste it out to something like notepad, do you get the right text, or basically the same that Tika gets?

– Gagravarr
Jan 2 at 11:44





If you select the text in Acrobat and cut-n-paste it out to something like notepad, do you get the right text, or basically the same that Tika gets?

– Gagravarr
Jan 2 at 11:44













@Gagravarr Just checked, copy paste also not working properly, same as Tika

– wolverine
Jan 2 at 13:01







@Gagravarr Just checked, copy paste also not working properly, same as Tika

– wolverine
Jan 2 at 13:01






1




1





Right, your problem is with whatever produced the PDF then. It has almost certainly done some bad OCR, and put that text behind the image of the scan. Your only option is to tell Apache Tika to re-OCR it, and ignore the text in the PDF

– Gagravarr
Jan 2 at 23:44





Right, your problem is with whatever produced the PDF then. It has almost certainly done some bad OCR, and put that text behind the image of the scan. Your only option is to tell Apache Tika to re-OCR it, and ignore the text in the PDF

– Gagravarr
Jan 2 at 23:44













@Gagravarr I am now doing ocr_only strategy and it works lot better, thanks

– wolverine
Jan 3 at 5:22





@Gagravarr I am now doing ocr_only strategy and it works lot better, thanks

– wolverine
Jan 3 at 5:22












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993124%2fapache-tika-not-properly-extracting-text-from-pdf-for-indian-languages%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993124%2fapache-tika-not-properly-extracting-text-from-pdf-for-indian-languages%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith