GitHub
Tesseract OCR:tesseract-ocr/tesseract: Tesseract Open Source OCR Engine (main repository) (github.com)
Tesseract User Manual:Tesseract User Manual | tessdoc (tesseract-ocr.github.io)
How to train LSTM Tesseract:tessdoc/TrainingTesseract-5.md at main ·tesseract-ocr/tessdoc (github.com)
- 作業系統:win10
- 版本訊息-命令提示字元(CMD)
C:\Users\user>tesseract --version tesseract v5.0.1.20220118 leptonica-1.78.0 libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.5.3) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.0 Found AVX2 Found AVX Found FMA Found SSE4.1 Found libarchive 3.5.0 zlib/1.2.11 liblzma/5.2.3 bz2lib/1.0.6 liblz4/1.7.5 libzstd/1.4.5 Found libcurl/7.77.0-DEV Schannel zlib/1.2.11 zstd/1.4.5 libidn2/2.0.4 nghttp2/1.31.0
一、修改eval.sh
使用notepad++開啟eval.sh修改內容
評估原本的chi_tra.lstm
lstmeval \
--model train/chi_tra.lstm \
--traineddata tessdata/chi_tra.traineddata \
--eval_listfile train/chi_tra.training_files.txt
評估訓練完的PMingLiU_checkpoint
lstmeval \
--model train/PMingLiU_checkpoint \
--traineddata tessdata/chi_tra.traineddata \
--eval_listfile train/chi_tra.training_files.txt
二、執行eval.sh
在tesstrainsh-win中右鍵(Git Bash Here)開啟Bash,輸入下面指令
sh eval.sh
在 Tesseract 的情況下,CER 和 WER 被測量為 Bag-of-CER 和 Bag-of-WER,即不是通過序列比對,而是作為計數(跨每行)。
- Bag of Char error rate(BCER)
- Bag of Word error rate(BWER)
評估原本的chi_tra.lstm
BCER eval=5.102329, BWER eval=28.982749
評估訓練完的PMingLiU_checkpoint
BCER eval=3.109002, BWER eval=20.521559
參考資料