概要

IIIFマニフェストファイルからOCR結果を含むTEI_XMLファイルを作成するプログラムを作成しました。このプログラムの使用方法について説明します。

仕組み

IIIFマニフェストファイルのURLを指定して、NDL古典籍OCR-LiteによるOCR結果を含むTEI/XMLファイルを作成します。

https://github.com/ndl-lab/ndlkotenocr-lite

使い方

以下のノートブックにアクセスしてください。

https://colab.research.google.com/github/nakamura196/000_tools/blob/main/IIIFマニフェストファイルからTEI_XMLファイルを作成するプログラム.ipynb

そして、一つ目の再生ボタンを押します。

完了したら、「実行」という部分のmanifest_urloutput_dirの値を更新して、セルを実行します。

output_dirに、OCR結果を含むTEI/XMLファイルが出力されます。

出力例

以下のように、ページおよび行ごとのOCR結果を含むファイルが作成されます。

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<??Ttftt/ppd/sbp////tbalslsls/alslslslslslslslslslslslslxxEeiiituuapoitbsfteobbebebeabbebebebebebebebebebebebebmmIilttibbtuubrioiexd/g/g/gb/g/g/g/g/g/g/g/g/g/g/g/g/llHelltllebrlbulityn>>>>n>>>>>>>>>>>>>--xeDeelii>lc>tlreH>>=ttt=ttttttttttttmmmaeS>ecs2iea>cDe"yyy"yyyyyyyyyyyyooldstOSah0cDreea1ppp2ppppppppppppddnecmCtte2aegDsd"eee"eeeeeeeeeeeeeesr>tRmir5tseece===============ll=>>to>-icts>rt"""t""""""""""""">nN0o>=c>yyhhh:SD1n">pprrttL-She"""e""""""""""""eethm2tt==ffptt9mt"nnn"nnnnnnnnnnnn==:t>O<tpp===p============""/pC/>sa"""a""""""""""""hh/sRd:g134g123456789111ttw:<a/e"""e"""""""""012ttw//t/"""""ppw/peicccccccccccc::.iu>ifooofoooooooooccc/tibiarrrarrrrrrrrrooo/eilfcrrrcrrrrrrrrrrrrwwifi.seeeseeeeeeeeerrrww-.sd=sss=ssssssssseeewwcdhl"ppp"pppppppppsss...le.h===h=========ppptto.rit"""t"""""""""===eeri>tt###t#########"""iigtcpzzzpzzzzzzzzz###--/c.sooosooooooooozzzccn.u:nnn:nnnnnnnnnooo..su-/eee/eeeeeeeeennnoo/-t/---/---------eeerr1toi134i123456789---gg.oki"""i"""""""""111/0kyi>>>i>>>>>>>>>012rr"yoff"""ee>o...>>>ll.ad<d<eeacl/l/aac..s<<.<sss.jie//i/宿eeejptgsstsg//p/c>eece>xx/r.gg.gmmreu>>u>llep--//potttto/ooee/ikkiiiiyy<//iioo/<ccif..s/uuf/aae<<s<<<<ss/0ccg//e//<//tt0f..>ssgss/ssoof1jjee>eeseemm11ppggggegg//1a//>>>>g>>ssa3ii>cc3eiihhediieed-ffmm-1//aa18ss//8coorrc2ttee2-ooll-7__aa73ooxx32ggnn22aagg2-ii//-6__tt6322ee3400ii4022__0-33aa-111ll1900ll9e//..edAArrd300nn3f55<ggf0__/""0d44sd9//ett9600gyy6600>pp6e22eee///==/mAA""ma00aaan55ppni__ppif44llfe__iies00ccst00aat"22tt</__ii/>00oot00nni00//t12xxl..mmettll>ii""ff//ssffccuuhhlleellmm//aaffttuuyyllppllee//nn00ss//==dd""eehhffttaattuuppll::tt/../jjrpppeugglr""al>>x.nogc.locr.grngsdsstdrlu/cstcuhreem/a1t.r0o"n?">?>

まとめ

不完全な点もあるかと思いますが、参考になりましたら幸いです。