Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
…or training pipeline - Move core ML classes from tika-langdetect-charsoup-core to new tika-ml/tika-ml-core module: rename CharSoupModel → LinearModel, FeatureExtractor → TextFeatureExtractor, add generic FeatureExtractor<T> interface and Prediction class - Add tika-ml/tika-ml-chardetect scaffold: ByteNgramFeatureExtractor, MlEncodingDetector, CharsetConfusables, TrainCharsetModel - ScriptAwareFeatureExtractor: add skip-bigram support (non-CJK only), configurable trigrams; use distinct FNV salt for skip-bigrams - CorpusReader: filter tilde-redacted web-crawl noise (~~~), split literal \n paragraph separators so each segment trains independently (fixes dv Dhivehi headline-prefix contamination: 32.9% → 95.5% @20 chars) - TrainLanguageModel: add --skip-bigrams, --max-train, --eval-only flags; multi-length evaluation (@20/50/100/200/full chars); per-language accuracy breakdown; confusion matrix for worst languages; macro-F1 reporting; lenient scoring via LanguageConfusables - Add LanguageConfusables: symmetric confusable groups for lenient eval, buildGroupIndices/collapseGroups utilities extracted from CharSoupLanguageDetector - Add download_madlad.py and build_charset_training.py training data scripts - Add run-lang-train.sh helper script Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Consolidates all encoding detection into a dedicated module hierarchy: tika-charset-detectors (parent) ├── tika-charset-detectors-core — BOM, HTML (WHATWG spec), ML detector; │ no heavy external deps beyond commons-io ├── tika-charset-detectors-icu4j — wraps ICU4J (optional) ├── tika-charset-detectors-universal — wraps juniversalchardet fork (optional) └── tika-charset-detectors-tools — TrainCharsetModel, EvalCharsetDetectors, DiagnoseCharsetDetector, BenchmarkCharsetDetectors, and the Python data-prep scripts Default detection chain (SPI): BOM → StandardHtmlEncodingDetector → MlEncodingDetector. CharSoupEncodingDetector (MetaEncodingDetector, tika-langdetect-charsoup) arbitrates when present on the classpath. Moved out of tika-parser-html-module: HtmlEncodingDetector, StandardHtmlEncodingDetector and all charsetdetector helpers → org.apache.tika.detect.html Moved out of tika-parser-text-module: Icu4jEncodingDetector, UniversalEncodingDetector, UniversalEncodingListener → org.apache.tika.detect.encoding Security fixes in StandardHtmlEncodingDetector pipeline: - CharsetAliases: replaced synchronized lazy-init with static initializer - PreScanner.getAttributeValue: explicit EOF handling for unclosed quoted values - PreScanner.skipAll: documented mark(1) pattern and its invariants New detectors: BomEncodingDetector, HttpHeaderEncodingDetector. Added docs/modules/ROOT/pages/configuration/encoding-detectors.adoc. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Thanks for your contribution to Apache Tika! Your help is appreciated!
Before opening the pull request, please verify that
TIKA-XXXX)[TIKA-XXXX] Issue or pull request title)./mvnw clean testmainbranch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulledmainbranchtika-bom/pom.xml.We will be able to faster integrate your pull request if these conditions are met. If you have any questions how to fix your problem or about using Tika in general, please sign up for the Tika mailing list. Thanks!