Repository navigation
feat(model): retrain zh-hans and zh-hant models on Unicode corpora - #1467
Merged
Merged
Conversation
Retrain Simplified Chinese (`budoux/models/zh-hans.json`) and Traditional Chinese (`budoux/models/zh-hant.json`) models on the Unicode Test Corpora with `--line-break` punctuation attachment, ASCII-adjacent space preservation, and targeted fine-tuning samples for common Chinese AA reduplications (`data/finetuning/zh-hans/reduplications.txt` and `data/finetuning/zh-hant/reduplications.txt`). Also update `scripts/run_training_pipeline.py` to: - Support `<bcp47_lang>_<flavor>` model identifiers and automatic Unicode corpus preparation. - Cap auto-balanced fine-tuning weight scaling at `MAX_AUTO_WEIGHT_SCALE = 30` so small fine-tuning datasets do not overpower general corpus statistics. Change-Id: I91f88a34c49ef02c6293d33b8681f48ca3939821
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.
Summary
Retrains the Simplified Chinese (
budoux/models/zh-hans.json) and Traditional Chinese (budoux/models/zh-hant.json) models on the Unicode Test Corpora (gutenberg/*/out/google/breakpoints/zh-Hansandzh-Hant) using the updated LogitBoost pipeline.Key Changes
scripts/prepare_unicode.py:<bcp47_lang>_<flavor>model identifiers (e.g.,zh-hans,zh-hant,ja_word) and map them to the corresponding Unicode Test Corpora directory (zh-Hans,zh-Hant,ja).--line-breakpunctuation attachment mode so opening/closing CJK punctuation attaches to adjacent phrases while preserving spaces adjacent to ASCII alphanumerics/symbols (e.g.Project Gutenberg™).\u200b) and support deterministic--split-dir(train/val/test) generation.scripts/run_training_pipeline.py:zh-hans,zh-hant, and*_wordmodels when splits do not yet exist.MAX_AUTO_WEIGHT_SCALE = 30so small fine-tuning datasets do not overpower general corpus statistics.data/finetuning/zh-hans/reduplications.txt,data/finetuning/zh-hant/reduplications.txt):人人,家家,年年,月月,日日,个个/個個,层层/層層,件件,句句,字字,行行, etc.) that were sparse in the base Gutenberg literary corpus.budoux/models/zh-hans.json,budoux/models/zh-hant.json):zh-hans.json: 95.49% test accuracy (95.45% F1) on the held-out test split.zh-hant.json: 94.88% test accuracy (94.96% F1) on the held-out test split.Test Plan
uv run pytest(192 passed)uv run python scripts/lint_data.pyuv run ruff check .uv run pyrefly check