[
https://issues.apache.org/jira/browse/TIKA-4891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18114600#comment-18114600
]
Tim Allison edited comment on TIKA-4891 at 9/12/26 3:05 PM:
------------------------------------------------------------
Bot reports from the first PR (incoming).
The approach taken was to fold tags into the existing handler rather than to
have an entirely separate handler that duplicates a portion of the
functionality of the main handler.
{noformat}
Corpus result (4000 PDFs, 1457 tagged, tika-eval vs the stripper on the same
build)
┌────────────────────────────────────────┬───────────┬──────────┬──────────────────┬─────────────┬───────────────────────┐
│ run │ dice mean │ dice p10 │
common-token p10 │ tokens lost │ new exceptions │
├────────────────────────────────────────┼───────────┼──────────┼──────────────────┼─────────────┼───────────────────────┤
│ old handler, extractMarkedContent=true │ 0.937 │ 0.847 │ 0.821
│ 5.0% │ (several docs zeroed) │
├────────────────────────────────────────┼───────────┼──────────┼──────────────────┼─────────────┼───────────────────────┤
│ rewrite TAGS │ 1.000 │ 1.000 │ 1.000
│ 0.0% │ 0 │
├────────────────────────────────────────┼───────────┼──────────┼──────────────────┼─────────────┼───────────────────────┤
│ rewrite AUTO │ 1.000 │ 1.000 │ 1.000
│ 0.0% │ 0 │
└────────────────────────────────────────┴───────────┴──────────┴──────────────────┴─────────────┴───────────────────────┘
AUTO on the default gate tags 81% of pages; the rest are pages with no tagged
text (3417), coverage failures (255, mostly scan-plugin and mixed Word
output) and dangling trees (3). Parse time is p50 1.06x, p95 1.78x on small
documents. Structure gained: 6.4k tables, 48k list items, headings and links
where the stripper had none. Reports and scripts are in
~/data/claude-work/tags-spike/ (analysis2.md, analysis-old.md,
reports-*/summary.md). Three defects the first corpus run caught, all fixed
and covered by tests
- Bidi words: splitting a word by glyph across MCIDs bypassed the stripper's
reordering and garbled Persian, Arabic and Hebrew documents. Reordered words
now stay whole under the majority label.
- PDFBox's PDTableAttributeObject.getHeaders() throws on string-valued
headers; attribute reads are guarded.
- A producer that marks the body as /Artifact and tags fragments (0001841)
passed the gate. Artifact text now counts against coverage.
{noformat}
was (Author: [email protected]):
Bot reports from the first PR (incoming).
The approach taken was to fold tags into the existing handler rather than to
have an entirely separate handler that duplicates a portion of the
functionality of the main handler.
{noformat}
Corpus result (4000 PDFs, 1457 tagged, tika-eval vs the stripper on the same
build)
┌────────────────────────────────────────┬───────────┬──────────┬──────────────────┬─────────────┬───────────────────────┐
│ run │ dice mean │ dice p10 │
common-token p10 │ tokens lost │ new exceptions │
├────────────────────────────────────────┼───────────┼──────────┼──────────────────┼─────────────┼───────────────────────┤
│ old handler, extractMarkedContent=true │ 0.937 │ 0.847 │ 0.821
│ 5.0% │ (several docs zeroed) │
├────────────────────────────────────────┼───────────┼──────────┼──────────────────┼─────────────┼───────────────────────┤
│ rewrite TAGS │ 1.000 │ 1.000 │ 1.000
│ 0.0% │ 0 │
├────────────────────────────────────────┼───────────┼──────────┼──────────────────┼─────────────┼───────────────────────┤
│ rewrite AUTO │ 1.000 │ 1.000 │ 1.000
│ 0.0% │ 0 │
└────────────────────────────────────────┴───────────┴──────────┴──────────────────┴─────────────┴───────────────────────┘
AUTO on the default gate tags 81% of pages; the rest are pages with no tagged
text (3417), coverage failures (255, mostly scan-plugin and mixed Word
output) and dangling trees (3). Parse time is p50 1.06x, p95 1.78x on small
documents. Structure gained: 6.4k tables, 48k list items, headings and links
where the stripper had none. Reports and scripts are in
~/data/claude-work/tags-spike/ (analysis2.md, analysis-old.md,
reports-*/summary.md). Three defects the first corpus run caught, all fixed
and covered by tests
- Bidi words: splitting a word by glyph across MCIDs bypassed the stripper's
reordering and garbled Persian, Arabic and Hebrew documents. Reordered words
now stay whole under the majority label.
- PDFBox's PDTableAttributeObject.getHeaders() throws on string-valued
headers; attribute reads are guarded.
- A producer that marks the body as /Artifact and tags fragments (0001841)
passed the gate. Artifact text now counts against coverage.
{noformat}
> Improve handling of PDF/UA structural tags/marked content
> ---------------------------------------------------------
>
> Key: TIKA-4891
> URL: https://issues.apache.org/jira/browse/TIKA-4891
> Project: Tika
> Issue Type: Task
> Reporter: Tim Allison
> Priority: Major
>
> PDF/UA includes structural markup. We hacked out a standalone handler for
> this back in 1.x but haven't touched it in years.
>
> We should modernize our handling of structural tags and eventually consider
> turning that on by default. That decision will be based on evaluation on
> 1000s of PDFs. This is not a default switch to be taken lightly.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)