Comments (1)
Note: In METS, the labels are a flat sequence of gt:state
elements with @prop
from the above mentioned schema file, one per page.
<mets:dmdSec ID="DMDGT_0001">
<mets:mdWrap MDTYPE="OTHER" OTHERMDTYPE="GT">
<mets:xmlData>
<gt:gt>
<gt:state prop="granularity/physical/document-related/word"/>
<gt:state prop="granularity/physical/document-related/text-line"/>
<gt:state prop="granularity/physical/document-related/region"/>
<gt:state prop="data-attributes/document-related/visual/text/font/multi-font/typefaces"/>
<gt:state prop="data-attributes/document-related/visual/text/font/multi-font/font-sizes"/>
<gt:state prop="data-attributes/language/mixed"/>
<gt:state prop="condition/production-related/document-faults/ink-from-facing"/>
<gt:state prop="condition/wear/additions/informative/annotations"/>
<gt:state prop="condition/production-related/document-characteristics/low-contrast"/>
<gt:state prop="condition/acquisition/method-flaws/imaging/uneven-illumination"/>
</gt:gt>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
These are then referenced under each physical structMap's page via @DMDID
.
IMO in core we first need some additional API to support that. Like (in analogy to pageId):
OcrdMets.get_gt_labelling(self, for_fileIds=None) # returns dict of file ID to label list
OcrdMets.get_gt_labelling_for_file(self, ocrd_file) # returns label list
OcrdMets.set_gt_labelling_for_file(self, labels, ocrd_file) # takes label list
# but also:
OcrdMets.add_file(self, ... labels=None, ...) # add full label list
OcrdMets.find_files(self, ... labels=None, ...) # filter by label list (match any)
What's your opinion, @kba?
Perhaps – instead of parsing this from the METS, we could also see to it that OCR-D mirrors them in the parsed PAGE-XML, i.e. OcrdPage
.
For example as:
<MetadataItem type="imageProperties" name="gt-labelling">
<Labels externalModel="https://github.com/OCR-D/gt-labelling/blob/master/xsd_schema/OCR-D_GT_schema.xsd" externalId="http://www.ocr-d.de/GT/">
<Label value="granularity/physical/document-related/word"/>
<Label value="granularity/physical/document-related/text-line"/>
<Label value="granularity/physical/document-related/region"/>
<Label value="data-attributes/document-related/visual/text/font/multi-font/typefaces"/>
<Label value="data-attributes/document-related/visual/text/font/multi-font/font-sizes"/>
<Label value="data-attributes/language/mixed"/>
<Label value="condition/production-related/document-faults/ink-from-facing"/>
<Label value="condition/wear/additions/informative/annotations"/>
<Label value="condition/production-related/document-characteristics/low-contrast"/>
<Label value="condition/acquisition/method-flaws/imaging/uneven-illumination"/>
</Labels>
</MetadataItem>
This would make it easier to access the labels from a processor or PAGE viewer.
from browse-ocrd.
Related Issues (20)
- chdir to workspace HOT 1
- make TextView and PageView searchable
- cannot run in Python pre 3.7.2 anymore HOT 2
- Feature Request: Scroll lock panels
- Integrate page-xml-draw HOT 4
- PageView: PNG-Export
- PageView: Additional information in tooltip HOT 1
- page view: add baselines if available HOT 1
- PageView: component menu not editable HOT 2
- ViewPage: ignore AlternativeImage if not retrievable HOT 6
- support path names with spaces
- ViewPage: ReadingOrder display ignores tables
- AlternativeImage selection glitch
- False warning about number of images per grp/page
- Support remote images HOT 3
- AttributeError: 'EntryPoints' object has no attribute 'get' HOT 2
- use last fileGrp as default HOT 3
- add CLI options for better Dockerization HOT 2
- Application crashes on launch HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browse-ocrd.