Skip to content

TIKA-4745 - add cohort-specific caps#2848

Merged
tballison merged 2 commits into
mainfrom
TIKA-4744-nb-cohort-cap
May 29, 2026
Merged

TIKA-4745 - add cohort-specific caps#2848
tballison merged 2 commits into
mainfrom
TIKA-4744-nb-cohort-cap

Conversation

@tballison
Copy link
Copy Markdown
Contributor

Small tweak to improve sbcs -> cjk confusion

@tballison tballison changed the title TIKA-4744 - add cohort-specific caps TIKA-4745 - add cohort-specific caps May 28, 2026
@THausherr THausherr requested a review from Copilot May 29, 2026 04:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Mojibuster’s Naive Bayes bigram encoding detector to reduce SBCS→CJK misclassification by changing the per-distinct-bigram clipping rule to be cohort-aware (script-family aware), and adds an internal .skills/ write-up describing a workflow for running encoding regression comparisons with tika-eval.

Changes:

  • Replace “top-vs-runner-up” per-bigram clipping with a “top-vs-best cross-cohort” cap and introduce a Cohort mapping for model labels.
  • Tighten the cap magnitude (CAP_PER_BIGRAM_NATS) from 20.0 to 10.0 and enforce model-label→cohort coverage at model load time.
  • Add a .skills/ document with a condensed procedure (commands + SQL) for encoding regression hunts using a single app build and multiple configs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
tika-encoding-detectors/tika-encoding-detector-mojibuster/src/main/java/org/apache/tika/ml/chardetect/NaiveBayesBigramEncodingDetector.java Adds cohort taxonomy/mapping and changes per-bigram capping to be cross-cohort aware to reduce SBCS→CJK confusion.
.skills/tika-eval-encoding-regression.md Adds a workflow doc for running encoding regression comparisons and investigating flips via tika-eval + SQL + trace metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .skills/tika-eval-encoding-regression.md Outdated
Comment thread .skills/tika-eval-encoding-regression.md Outdated
Comment thread .skills/tika-eval-encoding-regression.md Outdated
Comment thread .skills/tika-eval-encoding-regression.md Outdated
@tballison tballison merged commit 499e703 into main May 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants