chinese-bert-wwm
Route Chinese-BERT-wwm model loading, model selection, benchmark data, and troubleshooting workflows for HFL Chinese BERT-family resources.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- chinese-bert-wwm
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route Chinese-BERT-wwm model loading, model selection, benchmark data, and troubleshooting workflows for HFL Chinese BERT-family resources.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/model-family-overview.md4.3 KB
- 参考文档references/repo-provenance.md2.6 KB
- 参考文档references/repo-routing-metadata.json458 B
- 参考文档references/troubleshooting.md5.2 KB
- 脚本scripts/check_chinese_bert_wwm_setup.py5.1 KB
03 SKILL.md 正文
Chinese-BERT-wwm
Use this repo skill when a task involves HFL Chinese BERT/RoBERTa/RBT checkpoints released from the Chinese-BERT-wwm resource repository, Chinese Whole Word Masking (WWM), model loading through Transformers or PaddleHub, downstream Chinese NLP benchmark interpretation, or the bundled sentiment/NER dataset schemas.
What this skill covers
- HFL model ids such as
hfl/chinese-bert-wwm,hfl/chinese-bert-wwm-ext,hfl/chinese-roberta-wwm-ext,hfl/chinese-roberta-wwm-ext-large,hfl/rbt3,hfl/rbt4,hfl/rbt6, andhfl/rbtl3. - Correct Transformers class choice: use
BertTokenizer/BertModelorAutoTokenizer/AutoModel; do not use RoBERTa classes for the RoBERTa-wwm-named checkpoints. - Offline/cache-aware model-id validation and optional online checkpoint loading decisions.
- Model selection and fine-tuning expectations for Chinese reading comprehension, sentiment, sentence-pair matching, NLI, document classification, and Traditional Chinese tasks.
- Dataset source pointers, copyright/download constraints, benchmark metrics, and schema validation for included ChnSentiCorp, Weibo, and PeopleDaily fixture archives.
First steps
- Read
references/model-family-overview.mdfor the compact model catalog, WWM meaning, and route map. - If the task is about loading a checkpoint or validating a model id/cache, open
sub-skills/model-loading/SKILL.md. - If the task is about choosing a model, learning rates, compact variants, WWM/CWS implications, or reproduction expectations, open
sub-skills/task-selection-and-finetuning/SKILL.md. - If the task is about datasets, benchmark metrics, included zip schemas, or missing/copyright-restricted data, open
sub-skills/data-and-benchmarks/SKILL.md. - For setup failures that span multiple workflows, open
references/troubleshooting.md.
Sub-skill routes
| User task | Read |
|---|---|
"Load hfl/chinese-roberta-wwm-ext with Transformers", "is RobertaTokenizer correct?", "check offline cache for hfl/rbt3", "what PaddleHub module name should I use?" |
sub-skills/model-loading/SKILL.md |
| "Which checkpoint should I fine-tune for CMRC/DRCD/XNLI/LCQMC?", "what LR did the README use?", "do I need Chinese word segmentation for WWM?", "should I use RBTL3 or truncate a large model?" | sub-skills/task-selection-and-finetuning/SKILL.md |
"Where is BQ Corpus/LCQMC data?", "validate chnsenticorp.zip", "what metric does DRCD use?", "is CJRC test data official?" |
sub-skills/data-and-benchmarks/SKILL.md |
Minimal setup check
This repository is not an installable Python package. Transformers workflows require an environment with transformers and, for full model materialization, a backend such as PyTorch. In the user's chosen Python environment, a typical public setup is:
python -m pip install transformers torch
The root helper performs an offline import/model-id check and never downloads checkpoints:
python scripts/check_chinese_bert_wwm_setup.py --help
python scripts/check_chinese_bert_wwm_setup.py --require-transformers
python scripts/check_chinese_bert_wwm_setup.py --list-models
For model-specific cache/load checks, use sub-skills/model-loading/scripts/check_transformers_model.py. For included dataset archive schemas, use sub-skills/data-and-benchmarks/scripts/validate_dataset_schema.py.
Key operating facts
- WWM is a pretraining data-construction strategy. It does not require manual word segmentation of downstream input text.
- The RoBERTa-wwm-ext models are RoBERTa-like BERT-family models. Load them as BERT models or through
Auto*classes. - TensorFlow checkpoint zip downloads and Hugging Face/PyTorch model directories are different file formats; choose the loading/conversion path explicitly.
- Published benchmark values are empirical references, often max/average over multiple runs, not guaranteed reproduction targets.
- Some dataset folders provide only source pointers due to copyright, large file size, or in-house test constraints. Do not create downloaders that bypass those constraints.
Required references
references/repo-provenance.md: source commit, evidence paths, package/library context, and refresh baseline.references/repo-routing-metadata.json: structured scenario metadata used if this verified skill is later imported into the managed repo-skill library.references/model-family-overview.md: shared model catalog and route map.references/troubleshooting.md: cross-cutting environment, cache, dataset, and reproducibility failures.
Boundaries
This skill does not provide the unreleased original pretraining implementation, full model weights, full dataset downloads, PaddleHub/PaddlePaddle as required dependencies, or guaranteed benchmark reproduction. Ask for user approval before downloading large checkpoints, installing broad optional frameworks, using credentials, mutating caches, or redistributing restricted datasets.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).