TIKA-4745 - add cohort-specific caps#2848
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
Cohortmapping 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small tweak to improve sbcs -> cjk confusion