Skip to content

feat(model): retrain th model on Wisesight corpus with LogitBoost - #1473

Open
tushuhei wants to merge 2 commits into
mainfrom
feat/retrain-th-wisesight
Open

tushuhei wants to merge 2 commits into
mainfrom
feat/retrain-th-wisesight

Conversation

@tushuhei

Copy link
Copy Markdown
Member

Summary

Retrain the default Thai model (budoux/models/th.json) on the Wisesight word-tokenization corpus using the Active-Hessian & Zero-Drift LogitBoost pipeline (it=6000).

Pipeline & Dataset Changes

  • scripts/prepare_wisesight.py:
    • Extract preprocess_line() to strip Unicode Cf invisible format characters (such as U+200B), extended pictographs, emoji variation selectors (U+FE0E/U+FE0F), skin-tone modifiers, and attached combining marks (\p{M}*).
    • Filter out unsegmented sentences without separator boundaries (utils.SEP not in cleaned) and collapse consecutive whitespace chunks (| | | -> | |).
    • Support deterministic 80:10:10 train/val/test dataset splitting (--split-dir, --val-ratio, --test-ratio, --seed=42), resolving the 99.4% train/val data leakage between wisesight-1000 and wisesight-160.
  • scripts/run_training_pipeline.py:
    • Route --lang th to "wisesight" split prefix and automatically download wisesight-1000-samples-tokenised.label and invoke scripts/prepare_wisesight.py --split-dir (while keeping th_word routed to Unicode corpora).
  • Tests & Docs:
    • Add unit tests in scripts/tests/test_prepare_wisesight.py and scripts/tests/test_run_training_pipeline.py, and update scripts/README.md.

Evaluation Summary (Wisesight 80:10:10 Split & External Unicode th Benchmark)

Model / Config Features Raw Size Wisesight Train (781) F1 / Chunk F1 Wisesight Val (97) F1 Wisesight Test (97) F1 / Chunk F1 External Unicode th (3,308) F1 / Chunk F1
AdaBoost (it=10000, 80% split) 461 5.4 KB 92.22% / 81.16% 91.95% 91.86% / 80.38% 88.65% / 72.31%
AdaBoost (it=100000, 80% split) 1,353 17.4 KB 94.78% / 87.29% 94.49% 94.06% / 85.48% 91.37% / 78.73%
New LogitBoost (it=6000, 80% split) 2,296 30.2 KB 97.25% / 93.09% 95.72% 95.18% / 88.07% 92.11% / 80.61%
Previous main th.json (trained on 100% of Wisesight) 2,427 32.5 KB 96.28% / 90.75% (in-sample) (in-sample) 91.85% / 79.91%

Retrain the default Thai model (`budoux/models/th.json`) on the Wisesight
word-tokenization corpus using the Active-Hessian & Zero-Drift LogitBoost
pipeline (`it=6000`).

Also update `scripts/prepare_wisesight.py` and `scripts/run_training_pipeline.py` to:
- Strip Unicode Cf invisible format characters (such as U+200B), extended
  pictographs, emoji variation selectors, skin-tone modifiers, and attached
  combining marks.
- Filter out unsegmented sentences without separator boundaries and collapse
  consecutive whitespace chunks.
- Support deterministic 80:10:10 train/val/test dataset splitting (`--split-dir`)
  and automatic Wisesight corpus fetching when `--lang th` is passed.

Change-Id: I31efb5466e79291880d561deef944ac8c6c4708c
Change-Id: I85e65f415ce26c5379390e91f068ddfc4177b781
@tushuhei
tushuhei force-pushed the feat/retrain-th-wisesight branch from a78112d to 327518c Compare October 28, 2026 02:54
@tushuhei
tushuhei requested a review from kojiishi October 28, 2026 03:15

@kojiishi kojiishi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM w/nit

Returns:
Cleaned BudouX-segmented line using `utils.SEP` (`▁`).
"""
line = ''.join(ch for ch in line.strip() if unicodedata.category(ch) != 'Cf')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Since you're already using regex, I think you can do this by:

line = regex.compile(r'\p{Cf}').sub('', line)

This branch has not been deployed

No deployments
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