Commit 823dec4
committed
feat(publications): structured OCR for scholarly literature, keeping the footnotes
Adds AI_publication_extraction — journal articles, chapters, monographs and
theses through Mistral Document AI with block extraction — and factors the
shared Mistral OCR plumbing out into common/mistral_ocr.py, which
AI_ocr_extraction/02 now uses too.
It is a separate pipeline because AI_ocr_extraction drops every page's header
and footer from page 2 onward. On a newspaper that removes the running head; on
a journal article it removes the footnotes. Measured on a 33-page article from
the Cahiers du CERLESHS (item 4987), the page feet held 53 substantive footnotes
against 32 folio numbers — 7,388 characters of apparatus against 56 of noise. So
a page foot is kept here unless it is a folio number or repeats across the
document.
Two supporting changes:
* PropertyTarget gains is_public, defaulting to None, meaning "do not decide":
an existing value keeps the visibility a curator gave it and a new one is
created public, exactly as before. This pipeline sets False, because its
sources are copyrighted and a newly created bibo:content would otherwise
publish a whole monograph. The flag is also what the Hugging Face export reads
as OCR_is_public to decide whether to mask a row's full text, so it reaches
well past the archive's own UI.
* The PDFs and their JSON sidecars are gitignored: one thesis is 276 MB, and the
sidecars carry the full extracted text.1 parent cda95fd commit 823dec4
13 files changed
Lines changed: 2875 additions & 91 deletions
File tree
- AI_ocr_extraction
- AI_publication_extraction
- common
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
205 | 119 | | |
206 | 120 | | |
207 | 121 | | |
| |||
0 commit comments