What problem does it solve?
Extracts strictly mathematical terms (Definitions, Theorems, Lemmas, Propositions, Proofs) from documents, handling PDF conversion and AI-based cleaning. Use when the user wants to extract math content from a file.
Core Features & Use Cases
- Robust PDF Conversion: Uses MinerU for high-quality PDF to Markdown conversion.
- Smart Chunking: Splits text by paragraphs to avoid breaking math formulas.
- Cost Optimization: Heuristically filters out non-math chunks to save tokens.
- Math Protection: Whitelists safe HTML tags to prevent accidental deletion of math inequalities (e.g., a < b).
- Encoding Fallback: Automatically tries UTF-8, GBK, and Latin-1 encodings.
- Retry Logic: Built-in retries for API calls to handle network instability.
- Use Case: Imagine you have a scanned thesis in PDF or a collection of lecture notes; run this skill to extract all mathematical terms and compile them into a clean Markdown file.
Quick Start
Run the Python script with a document path and an output directory to produce a file named <filename>_extracted.md.