Do we have Sanskrit training images and box files online?

186 views
Skip to first unread message

rohit saluja

unread,
May 6, 2016, 3:29:44 AM5/6/16
to tesseract-ocr
Do we have Sanskrit training images and box files available online?

Thanks
Rohit

ShreeDevi Kumar

unread,
May 14, 2016, 12:16:05 PM5/14/16
to tesser...@googlegroups.com
There are newer traineddata files at https://github.com/Shreeshrii/imagessan _ have not uploaded the box files there. if you have training tools installed, you can use the text2image program with the files there to create the box files.

I am travelling so do not have access to the computer which has the box files.

ShreeDevi
____________________________________________________________
भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com

--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/a6c02172-1fb1-4f00-b096-44332cd81075%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rohit saluja

unread,
Jun 12, 2016, 1:56:48 AM6/12/16
to tesseract-ocr
Hey thanks for replying.
Which options to use with text2image command? Also, is there any configuration file and fonts list?

I tried the default option of text2image with tesseract github training data with sanskrit 2003, but the recognition results are far away from san.traineddata file on github.
Any help in matching san.traineddata results, starting from the scratch, would be highly appreciated.

Thanks in advance
Rohit

ShreeDevi Kumar

unread,
Jun 12, 2016, 11:48:17 PM6/12/16
to tesser...@googlegroups.com

Google has not provided images and box files for San.traineddata released for 3.04

I tried training using text2image with a combination of different fonts and training text. Results are at https://github.com/Shreeshrii/imagessan/tree/master/tessdata

You can give these a try to see if recognition is any better.

You can unpack any trained data file using -u option with combine-tessdata to see the config files etc.

http://manpages.ubuntu.com/manpages/trusty/man1/combine_tessdata.1.html

Use the dawg2wordlist to look at the various dictionary word lists used.

http://manpages.ubuntu.com/manpages/trusty/man1/dawg2wordlist.1.html

- sent from my phone. excuse the brevity.

--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.

rohit saluja

unread,
Jun 13, 2016, 7:17:07 AM6/13/16
to tesser...@googlegroups.com
Thanks again for replying. I will surely check them out.

My experience is that OCR on sanskrit data with hin.traineddata gives better results than san.traineddata. I do know know, it is due to cube mode or devanagari preprocessing(segmentation i guess) in devanagari?

I wonder why such preprocessing is not applied in san.traineddata.
Please let me know whether you are using cube mode in your traineddata or not, and are you using devanagari preprocessing?

--
You received this message because you are subscribed to a topic in the Google Groups "tesseract-ocr" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tesseract-ocr/apmhpJ3K924/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tesseract-oc...@googlegroups.com.

To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.

ShreeDevi Kumar

unread,
Jun 13, 2016, 9:23:14 AM6/13/16
to tesser...@googlegroups.com

Yes, hin traineddata with cube gives better results than san.

I did some rudimentary testing with the new traineddata I made. It does not use cube. Look at the config files, it has some options for devanagari processing.

You could try to unpack the hin traineddata and then remake the Dawg files using sanskrit wordlists and combine them as an experiment.

If you have unicode version of the font used for the docs you want to OCR, then train using that.

- sent from my phone. excuse the brevity.

ShreeDevi Kumar

unread,
Jun 13, 2016, 9:34:15 AM6/13/16
to tesser...@googlegroups.com

If you look at the readme files in the diff subdirectories starting with OCR under
https://github.com/Shreeshrii/imagessan/tree/master you will see results of character and word level accuracy. Depending on the font, character level accuracy is around 80% and word level accuracy around 60%

I have not used it for actual OCR of any text because sanskritocr software by dr. Oliver hellwig gives better results.

See https://sites.google.com/site/sanskritcode/ocr/1-ocr-ing

- sent from my phone. excuse the brevity.

rohit saluja

unread,
Jun 13, 2016, 6:06:12 PM6/13/16
to tesser...@googlegroups.com
Hey thanks a lot for your reply. This seems to be a great idea to use hin data with sanskrit wordlist.

Still I am interested in knowing the things building from scratch.
So I used some boxfiles and images I created for sanskrit 2003 font and used the hindi config file from https://github.com/tesseract-ocr/langdata/blob/master/hin/hin.config
and I renamed it as san3ds.config. san3ds(3 for 2003 ds for devanagari split) is the new name I am giving for my new training data.

I was able to train san3ds without any config file before.

I just renamed san3ds.word-dawg as san3ds.cube-word-dawg. Remaining files I kept as it is.
I could form san3.traineddata file, but I am getting an error while recognition:-

Cube ERROR (CubeRecoContext::Load): unable to read cube language model params from /usr/local/share/tessdata/san3ds.cube.lm
Cube ERROR (CubeRecoContext::Create): unable to init CubeRecoContext object
init_cube_objects(true, &tessdata_manager):Error:Assert failed:in file tessedit.cpp, line 214
Segmentation fault (core dumped)

Any help in this, why this is happening? Is it wrong in renaming word-dawg, I cannot find any separate option for generating cube-word-dawg.

Thanks in advance
Rohit


rohit saluja

unread,
Jun 13, 2016, 6:14:46 PM6/13/16
to tesser...@googlegroups.com
Also thanks a lot for mentioning about SanskritOCR, I did not knew that.

ShreeDevi Kumar

unread,
Jun 15, 2016, 9:02:16 AM6/15/16
to tesser...@googlegroups.com

You can check out the older version of sanskritocr from http://learnsanskrit.org/tools/ocr

The new version is commercial software, available as a demo for free, but requires payment for use.

- sent from my phone. excuse the brevity.

ShreeDevi Kumar

unread,
Jun 18, 2016, 2:11:13 PM6/18/16
to tesser...@googlegroups.com
I do not know about the training process for cube, it is not documented. 

I have uploaded the box/tif pairs generated by text2image under windows for sanskrit - there are two versions  s21 and s95 - using different fonts and exposure levels. Please see

In s21, each font is used for 3 different exposure levels , -1, 0 and 1. 
tesstrain.sh --lang san --langdata_dir ./langdata --tessdata_dir ./ --exposures "-1 0 1" 

In s95, each font is used only at 0 exposure level.

ShreeDevi
____________________________________________________________
भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com

rohit saluja

unread,
Jun 21, 2016, 3:06:23 AM6/21/16
to tesseract-ocr
Hey thanks a lot. Your replies are really helpful.

Rohit

rohit saluja

unread,
Jun 30, 2016, 6:55:27 AM6/30/16
to tesseract-ocr
Hi

I just ocred 30 pages of a sanskrit book on Sanskrit OCR. I got WER of 54% and CER of 24 %.
Whereas I get WER of 20 % on Indsenz and CER Of 8 %. Have you tried comparing Indsenz with Sanskrit OCR. Which one is better where?

ShreeDevi Kumar

unread,
Jun 30, 2016, 10:28:04 AM6/30/16
to tesser...@googlegroups.com

Oliver had released first version of sanskritocr for free and new version is commercial with demo, sold by indsenz. I assume newer one may be better, it also allows for training for particular fonts.

- sent from my phone. excuse the brevity.

Reply all
Reply to author
Forward
0 new messages