findinfinitelabs/chuuk

large-document-processing

Process large documents (200+ pages) with structure preservation, intelligent parsing, and memory-efficient handling.

First seen Mar 1, 2026

Installation

$ npx skills add findinfinitelabs/chuuk --skill large-document-processing

Summary

  • Process large documents (200+ pages) with structure preservation, intelligent parsing, and memory-efficient handling.
  • Also covers intelligent text chunking for AI training and RAG systems.
  • Use when working with complex formatted documents, multi-level hierarchies, or when splitting large content for AI pipelines.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from findinfinitelabs/chuuk · top by installs.

npx skills add findinfinitelabs/chuuk

Browse all from findinfinitelabs/chuuk

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Also listed on

Alternate registries and mirrors of this skill.

Repository health

Stars 1
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,996 B
  • docs SUMMARY.md 347 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 37 installs

SKILL.md

Large Document Processing & Intelligent Text Chunking

## ⚠️ Repo Reality Check (read this first)

The real components are:
- Top-level pipeline: [LargeDocumentProcessor](../../../src/pipeline/largedocumentprocessor.py#L43)
- Structure-aware parser: [AdvancedDocumentParser](../../../src/ocr/advanceddocumentparser.py#L66)
- Streaming OCR with progress: [EnhancedOCRProcessor](../../../src/ocr/enhancedocrprocessor.py#L34)
- Chunker: [IntelligentTextChunker](../../../src/utils/intelligent_chunker.py#L47) — see the [intelligent-text-chunking](../intelligent-text-chunking/SKILL.md) skill.
- Training data generation: [AITrainingDataGenerator](../../../src/training/aitraininggenerator.py#L39)
- Setup helper: [scripts/setuplargedocumentprocessing.py](../../../scripts/setuplargedocumentprocessing.py)

The NWT EPUB parser exposes only getverse(booknum, chapter, verse) ([nwtepubparser.py](../../../src/utils/nwtepubparser.py#L63)) — there is no getchapter / getbook. See the [bible-epub-processing](../bible-epub-processing/SKILL.md) skill.

Source data lives under [config/data/](../../../config/data/) (NOT a top-level data/).

Always wrap chunking calls with protectscripturereferences / restorescripturereferences from [src/utils/scriptureparser.py](../../../src/utils/scriptureparser.py#L77) when input may contain Bible references.

Overview

Two tightly related concerns combined here:

  1. Large document parsing — DOCX/PDF/EPUB ingestion with structure preservation
  2. Intelligent text chunking — splitting parsed text into semantically coherent pieces for AI training or RAG

Source Files

File Purpose
src/utils/nwtepubparser.py EPUB parser for NWT Bible (English + Chuukese)
scripts/extract_jwpub.py Extract JW publication .jwpub archives
scripts/setuplargedocument_processing.py One-time document pipeline setup
output/processed_document/ Output directory for processed content

Document Processing

Supported Formats

  • DOCX via python-docx
  • PDF via PyMuPDF (import as fitz) — note: fitz==0.0.1.dev2 is NOT in requirements; use PyMuPDF only
  • EPUB via ebooklib + NWTEpubParser
  • Plain text / CSV — direct read

EPUB Pattern (NWT Bible)

from src.utils.nwt_epub_parser import NWTEpubParser

parser = NWTEpubParser('data/bible/nwt_E.epub')
verse_text = parser.get_verse('John', 3, 16)
chapter_verses = parser.get_chapter('Genesis', 1)

PDF/DOCX Pattern

import fitz  # PyMuPDF — installed as PyMuPDF, exposed as fitz

doc = fitz.open('large_document.pdf')
for page_num, page in enumerate(doc):
    text = page.get_text()
    # process text...

Intelligent Text Chunking

Strategy Selection

Strategy Use case
Semantic AI training data — respect topic/paragraph boundaries
Structural Documents with clear headings/sections
Fixed-size RAG systems needing predictable chunk sizes
Sliding window QA tasks needing context overlap

Implementation Pattern

# Sentence-boundary-aware chunking
def chunk_text(text: str, max_chars: int = 1024, overlap: int = 100) -> list[str]:
    sentences = re.split(r'(?<=[.!?])\s+', text)
    chunks, current = [], ''
    for sent in sentences:
        if len(current) + len(sent) > max_chars and current:
            chunks.append(current.strip())
            current = current[-overlap:] + ' ' + sent  # overlap
        else:
            current += ' ' + sent
    if current.strip():
        chunks.append(current.strip())
    return chunks

Chuukese-aware chunking

# Chuukese uses the same sentence terminators as English
SENTENCE_ENDINGS = re.compile(r'(?<=[.!?])\s+')

def detect_language(text: str) -> str:
    has_accents = bool(re.search(r'[áéíóú]', text))
    return 'chuukese' if has_accents else 'english'

Memory Efficiency

  • Process large PDFs page-by-page, not loading the full DOM into memory
  • Stream EPUB chapters — do not load the entire book at once
  • Write chunk output incrementally to JSONL files rather than accumulating in RAM

Output Formats

  • JSONL: one JSON object per line — best for large training datasets
  • JSON array: for smaller batches consumed by the frontend
  • Plain text: cleaned extracted text for inspection

Dependencies

  • PyMuPDF==1.23.8 — PDF processing (do NOT add fitz==0.0.1.dev2)
  • python-docx>=1.2.0
  • ebooklib>=0.18
  • beautifulsoup4>=4.12.0