IIIFマニフェストファイルからOCR結果を含むTEI_XMLファイルを作成するプログラム
概要 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_urlとoutput_dirの値を更新して、セルを実行します。 output_dirに、OCR結果を含むTEI/XMLファイルが出力されます。 出力例 以下のように、ページおよび行ごとのOCR結果を含むファイルが作成されます。 < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ? ? T t f t t / p p d / s b p / / / / t b a l s l s l s / a l s l s l s l s l s l s l s l s l s l s l s l s l x x E e i i i t u u a p o i t b s f t e o b b e b e b e a b b e b e b e b e b e b e b e b e b e b e b e b e b m m I i l t t i b b t u u b r i o i e x d / g / g / g b / g / g / g / g / g / g / g / g / g / g / g / g / l l H e l l t l l e b r l b u l i t y n > > > > n > > > > > > > > > > > > > - - x e D e e l i i > l c > t l r e H > > = t t t = t t t t t t t t t t t t m m m a e S > e c s 2 i e a > c D e " y y y " y y y y y y y y y y y y o o l d s t O S a h 0 c D r e e a 1 p p p 2 p p p p p p p p p p p p d d n e c m C t t e 2 a e g D s d " e e e " e e e e e e e e e e e e e e s r > t R m i r 5 t s e e c e = = = = = = = = = = = = = = = l l = > > 結 t o > - i c t s > r t " " " t " " " " " " " " " " " " " 果 > n N 0 o > = c > y 本 本 本 y 本 本 本 本 本 本 本 本 本 本 本 本 h h h : S D 1 n " > p 文 文 文 p 文 文 文 文 文 文 文 文 文 文 文 文 r r t t L - S h e " " " e " " " " " " " " " " " " e e t h m 古 2 t t = = f f p t t 典 9 m t " n n n " n n n n n n n n n n n n = = : t > O < t p p = = = p = = = = = = = = = = = = " " / p C / > s a " " " a " " " " " " " " " " " " h h / s R d : g 1 3 4 g 1 2 3 4 5 6 7 8 9 1 1 1 t t w : < a / e " " " e " " " " " " " " " 0 1 2 t t w / / t / " " " " " p p w / p e i c c c c c c c c c c c c : : . i u > i f o o o f o o o o o o o o o c c c / t i b i a r r r a r r r r r r r r r o o o / e i l f c r r r c r r r r r r r r r r r r w w i f i . s e e e s e e e e e e e e e r r r w w - . s d = s s s = s s s s s s s s s e e e w w c d h l " p p p " p p p p p p p p p s s s . . . l e . h = = = h = = = = = = = = = p p p t t o . r i t " " " t " " " " " " " " " = = = e e r i > t t # # # t # # # # # # # # # " " " i i g t c p z z z p z z z z z z z z z # # # - - / c . s o o o s o o o o o o o o o z z z c c n . u : n n n : n n n n n n n n n o o o . . s u - / e e e / e e e e e e e e e n n n o o / - t / - - - / - - - - - - - - - e e e r r 1 t o i 1 3 4 i 1 2 3 4 5 6 7 8 9 - - - g g . o k i " " " i " " " " " " " " " 1 1 1 / 0 k y i > > > i > > > > > > > > > 0 1 2 r r " y o f 国 空 ゆ f あ ・ 中 住 ね に は は な " " " e e > o . . 外 せ ふ . つ ・ 川 ぬ ら く じ つ り > > > l l . a d < み か d た ・ ノ < れ ま め か ぬ こ お ほ e e a c l / 二 ほ l い ・ 中 / 給 れ て し れ ぼ ぼ ど a a c . . s < < . < ・ 川 s は て う う な し す が s s . j i e / / i / ・ 宿 e ぬ も し て ど て て み e e j p t g s s t s ・ に g ま な と な の ふ さ の / / p / c > e e c e ・ て > ゝ ら 世 が 給 し ぐ い x x / r . g g . g ・ 之 に は を ら へ た り と m m r e u > > u > ・ 源 。 ぬ 思 ふ ば り の な l l e p - - ・ 氏 わ を ひ ま 。 。 ほ が / / p o t t ・ 十 れ 。 知 じ な い そ か t t o / o o ・ 六 は こ ぬ く み ど く ら e e / i k k ・ 才 か よ れ こ た ら ち ざ i i i i y y ・ < く ひ ば そ を う い り / / i i o o ・ / 人 な < 思 さ た さ し c c i f . . ・ s に ん / ひ へ し き け u u f / a a ・ e < < s < < と < < s s / 0 c c ・ g / / e / / < / / t t 0 f . . ・ > s s g s s / s s o o f 1 j j ・ e e > e e s e e m m 1 1 p p ・ g g g g e g g / / 1 a / / ・ > > > > g > > s s a 3 i i ・ > c c 3 e i i ・ h h e d i i ・ e e d - f f ・ m m - 1 / / ・ a a 1 8 s s ・ / / 8 c o o ・ r r c 2 t t ・ e e 2 - o o ・ l l - 7 _ _ ・ a a 7 3 o o ・ x x 3 2 g g ・ n n 2 2 a a ・ g g 2 - i i ・ / / - 6 _ _ ・ t t 6 3 2 2 ・ e e 3 4 0 0 ・ i i 4 0 2 2 ・ _ _ 0 - 3 3 ・ a a - 1 1 1 ・ l l 1 9 0 0 ・ l l 9 e / / ・ . . e d A A ・ r r d 3 0 0 ・ n n 3 f 5 5 < g g f 0 _ _ / " " 0 d 4 4 s d 9 / / e t t 9 6 0 0 g y y 6 6 0 0 > p p 6 e 2 2 e e e / / / = = / m A A " " m a 0 0 a a a n 5 5 p p n i _ _ p p i f 4 4 l l f e _ _ i i e s 0 0 c c s t 0 0 a a t " 2 2 t t < / _ _ i i / > 0 0 o o t 0 0 n n i 0 0 / / t 1 2 x x l . . m m e t t l l > i i " " f f / / s s f f c c u u h h l l e e l l m m / / a a f f t t u u y y l l p p l l e e / / n n 0 0 s s / / = = d d " " e e h h f f t t a a t t u u p p l l : : t t / . . / j j r p p p e u g g l r " " a l > > x . n o g c . l o c r . g r n g s d s s t d r l u / c s t c u h r e e m / a 1 t . r 0 o " n ? " > ? > まとめ 不完全な点もあるかと思いますが、参考になりましたら幸いです。 ...