SuperAPI AI Directory

protocol-entity-extraction

Coding & development

View repository

Updated 10-16 00:04

About this skill

Protocol Entity Extraction

Extract all key entities required by SAP from Protocol PDF/DOCX and output structured JSON.

Quick Start

from utils.document_parser import get_document_parser
parser = get_document_parser()
synopsis = await parser.parse(protocol_path, page_range=[1, 15])
stats = await parser.parse(protocol_path, page_range=[90, 115])

Parsing Strategy

Multi-section targeted parsing: Synopsis(p1-15, high table density) -> Design(p30-50) -> Statistics(p90-115, plain text) -> SAP Appendix(p240+)

Parsing Engine (four-level fallback)

DocumentParser automatically selects the optimal engine:

  1. Unstructured API (cloud) — requires UNSTRUCTURED_API_KEY, strongest for tables + OCR
  2. Docling (local AI) — IBM open source, uses vision + language models for table recognition, no API Key required, recommended local first choice
  3. pdfplumber (local) — text + simple tables
  4. PyPDF2 (local) — plain text fallback only

If UNSTRUCTURED_API_KEY is not configured and Docling is installed, Docling will be used automatically (table recognition accuracy is far higher than pdfplumber).

References