corpus-quality
Corpus-level quality, deduplication, structured output, validation, and evaluation guidance for Trafilatura web corpora.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- corpus-quality
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Corpus-level quality, deduplication, structured output, validation, and evaluation guidance for Trafilatura web corpora.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/benchmarks-and-evaluation.md8.3 KB
- 参考文档references/data-formats-and-quality.md8.9 KB
- 参考文档references/deduplication.md7.3 KB
- 参考文档references/troubleshooting.md7.3 KB
- 脚本scripts/corpus_quality_smoke.py4.2 KB
03 SKILL.md 正文
Corpus Quality
Use this sub-skill when a Trafilatura task is about many-page corpus quality rather than one-page extraction mechanics: duplicate removal, stable fingerprints or file names, XML/TEI/CSV/JSON corpus outputs, metadata completeness, TEI/XML validation, benchmark context, or deciding which quality checks are safe to run.
Route by need
| Need | Use |
|---|---|
| Choose a corpus output format, validate JSON/CSV/XML/XML-TEI, or reason about metadata fields | references/data-formats-and-quality.md |
| Remove repeated boilerplate, detect exact duplicate segments, compute near-duplicate fingerprints, or use Simhash | references/deduplication.md |
| Decide whether to run the bundled smoke, safe native validation classes, the quality gate, or heavy benchmark comparisons | references/benchmarks-and-evaluation.md |
| Diagnose duplicate boilerplate, invalid XML/TEI, missing metadata, benchmark dependency gaps, or NLTK data issues | references/troubleshooting.md |
| Run a no-network executable check for this sub-skill's core assumptions | scripts/corpus_quality_smoke.py |
Operating boundaries
- For basic
extract(),bare_extraction(),html2txt(), metadata extraction, or one-page API snippets, route topython-extractionfirst and return here only for corpus-quality choices. - For command-line batching mechanics, input lists, output directories, backups, or parallel CLI operation, route to
cli-batch-processing; this sub-skill only explains the corpus-quality consequences of those outputs. - For live download, crawling, feeds, sitemaps, URL stores, or network throttling, route to
discovery-downloads. - Do not require the original repository checkout. Use the bundled references and script here; native benchmark/test labels in the references are selection guidance, not runtime dependencies.
Fast decision checklist
- Pick the output contract: TXT/Markdown for reading or simple NLP, JSON for flexible downstream analysis, CSV/TSV for tabular pipelines, XML for structured extraction trees, or XML-TEI for corpus-linguistics interchange and validation.
- Decide metadata strictness:
with_metadata=Trueenriches outputs;only_with_metadata=Truedrops documents missing title, date, or URL. - Enable exact duplicate filtering when repeated page sections or whole documents pollute a corpus:
deduplicate=TrueorExtractor(dedup=True). - Add document-level fingerprints for cross-run deduplication:
content_fingerprint()for content identity/similarity tracking,Simhashfor thresholded near-duplicate comparisons, and hash-based names when the output path should reflect content. - Validate a representative sample before scaling: parse JSON/CSV/XML outputs, call
validate_tei()for XML-TEI, and runscripts/corpus_quality_smoke.pyin an environment where Trafilatura is installed.
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).