corpus-building

Extract, structure, and assess evidence quality from registered source objects: convert processed documents into searchable evidence cards, manage OCR and translation layers, run quality scoring, handle noise and recovery, and maintain the corpus index. Suitable for scenarios that require turning source documents into usable corpora or evidence sets.

Last repository push
GitHub Stars
139
Forks
0
Issues / PRs
0

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "corpus-building" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-020d9da25c6e1f3d8dcbfb1300bd7cbad131f30bf9c4f201e8ad9a7a7306fe9a. Verify the upstream source and version against https://github.com/scholay/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Extract, structure, and assess evidence quality from registered source objects: convert processed documents into searchable evidence cards, manage OCR and translation layers, run quality scoring, handle noise and recovery, and maintain the corpus index. Suitable for scenarios that require turning source documents into usable corpora or evidence sets.

0 Downloads

Introduction source: third_party · scholay · 0.0.1 Reference

SkillPi interpretation

Tasks
Extract, structure, and quality-check evidence from registered source objects. Use when converting processed documents into searchable evidence cards, managing OCR and translation layers, running quality scoring, handling noise and recovery, or maintaining a corpus index.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: corpus-building
description: Extract, structure, and quality-check evidence from registered source objects. Use when converting processed documents into searchable evidence cards, managing OCR and translation layers, running quality scoring, handling noise and recovery, or maintaining a corpus index.

Corpus Building

The core problem

A folder of PDFs is not a corpus. A corpus is a collection of addressable evidence units — each one traceable to a specific page of a specific source, with enough context to be used in writing without reopening the original document.

This skill covers the full path from source object to evidence card, including OCR, translation, quality scoring, and the noise problems that appear at scale.

Key concepts

Source card — one record per registered source. Holds metadata, processing status, and links to all derived evidence.

Text slice — one evidence unit extracted from a specific page range of a source. Stores the original text, cleaned OCR text, and working translation as separate layers. Never collapses them.

Image slice — one image evidence unit (a page scan, figure, plan, photograph, table, or diagram). Stores file path, description, and status.

The separation rule: a slice stores what the source says. AI annotations store what AI thinks about the slice. Do not mix them.

Workflow

1. Create the source card first

Before creating any slices, create a source card for the registered source object. Minimum fields: source ID, title, language, file path, topics, status fields for OCR and translation.

2. Run OCR

For each source, generate per-page text output.

Default path: use a local OCR engine (Tesseract or equivalent). For multilingual documents, set the language pack explicitly — running an incorrect language pack produces script-mismatch noise, not just bad quality.

Cloud OCR path (optional): use a cloud OCR API for higher fidelity on difficult scans. Reserve this for pages that local OCR consistently fails on, not as a default for all sources.

Output per page: raw OCR text file. Keep raw output separate from any cleaned version.

3. Slice into evidence cards

For each page (or logical text unit), create a text slice card with:

  • Slice ID (SLC-####-T###)
  • Source ID and page reference
  • Original text (from source)
  • OCR-cleaned text (if different)
  • Working translation (in your project's working language)
  • Status fields: OCR status, translation status, verification status

For each page image, create a baseline image slice card with:

  • Slice ID (SLC-####-I###)
  • Source ID and page number
  • Image file path
  • Image type (page scan, figure, plan, photo, table, diagram)
  • Description status

On image descriptions: use a multimodal model to inspect the actual image pixels. Do not use OCR output as a substitute for visual inspection. Label OCR-derived descriptions as ocr_assisted_draft — they are lower trust than a genuine visual description.

4. Run quality scoring

After slicing, score each page on:

  • OCR quality: are there repeated characters, symbol noise, script artifacts?
  • Translation quality: is the working language layer present and readable?

Assign a triage priority:

  • P1 — likely broken; inspect immediately before using
  • P2 — needs review; often image-heavy or missing translation
  • P3 — usable but worth spot-checking
  • OK — acceptable for browsing

Calibrate before scaling: after your first new source type, inspect all P1 pages plus a sample of P2 and OK. If the scoring looks wrong, fix the scorer before running 50 more sources.

5. Handle noise and blocked pages

At scale, some pages will have OCR artifacts severe enough to quarantine:

  • Repeated-character runs
  • Script mismatch (wrong language pack)
  • Symbol floods

Before bulk quarantine, sample the flagged pages visually. Common false positives:

  • Table-of-contents pages with dotted leaders (…………) — readable, just unusual
  • Pages in a different script than you expected — fix the language setting, not the page

For genuinely noisy pages, mark them excluded and log them in a blocked pages list with a reason code. Revisit after fixing the underlying cause (wrong language pack, poor scan quality, etc.) rather than leaving them permanently blocked.

6. Validate and rebuild

After every batch, validate that:

  • Every slice card in your folder has a row in your index
  • No duplicate slice IDs exist
  • No index rows reference missing files

Rebuild any downstream views (app data, search indexes) from the validated corpus, not from cached state.

Rules

  • Markdown/text cards are the source of truth. CSV/database indexes are rebuildable projections.
  • Never let a translation overwrite the original text or the OCR-cleaned text. Keep all three layers.
  • Never use OCR output as a substitute for visual inspection of images.
  • Do not create slices from unregistered source objects.
  • Do not run quality scoring and then ignore the results — calibrate the scorer and act on P1 pages.
  • Over-quarantine is as harmful as under-quarantine. Sample before bulk-blocking.
  • Auto-generated page slices are browsing inventory, not citation-ready evidence. Mark them accordingly.
  • Validate after every batch. Do not continue slicing when validation fails.

Status vocabulary

OCR status: not_started / in_progress / raw_ocr / cleaned / verified / blocked / not_needed

Translation status: not_started / machine_draft / agent_draft / pending_translation / reviewed / quote_ready / blocked / not_needed

Verification status: draft / checked / reviewed

Image description status: not_started / ocr_assisted_draft / visual_draft / reviewed / caption_ready

References

  • Read references/slice-schema.md for required fields, status vocabulary, and granularity rules.
  • Read references/quality-scoring.md for triage priority semantics, risk tags, and calibration guidance.
  • Read references/ocr-noise.md for common noise patterns, false-positive quarantine risks, and recovery steps.

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供完整的语料库构建端到端流程,涵盖OCR、翻译、质量评分和噪声处理
  • 适用于文档处理、证据卡片生成等明确场景,具有广泛实用价值
Trigger Precision92/100

Highlights

  • 触发描述精准完整,覆盖多种使用场景变体
  • 边界清晰,不易与其他Skill混淆
Structure and Standards75/100

Areas to improve

  • 缺少 When to Use/示例章节 Reported severity: Minor

    文档结构完整但缺少显式的使用场景说明章节和端到端示例

    Recommendation: 建议补充 When to Use 章节和具体使用示例以增强可读性

  • 文档过长 Reported severity: Minor

    主文档内容约1200行,超出建议的500行限制

    Recommendation: 考虑将部分详细说明移至参考文档或进行内容精简

Highlights

  • Phase/步骤清晰,有明确的出口条件和验证机制
  • frontmatter完整,状态词汇表规范
Execution Reliability88/100

Highlights

  • 工具来源明确(Tesseract等),参数建议合理
  • 覆盖主要异常情况并有采样验证机制
  • 强调校准和批量处理前的验证,可靠性高
Evidence Verifiability (mean of the first four)83/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.