Metadata-Version: 2.4
Name: esg-cid-plus
Version: 0.1.0
Summary: ESG-CID-Plus: A Stratified Benchmark for Disclosure Content Index Table Extraction from Corporate Sustainability Reports
Project-URL: Homepage, https://github.com/anomalyco/esg-cid-plus
Author-email: Rehan Ahmed <shafiuddin.r.ahmed@accenture.com>
License: MIT
Keywords: benchmark,content-index,esg,pdf-extraction,sustainability
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.13
Requires-Dist: camelot-py>=0.11.0
Requires-Dist: datasets>=2.0
Requires-Dist: img2table>=2.0
Requires-Dist: lunr>=0.7.0
Requires-Dist: opencv-python-headless>=4.8
Requires-Dist: pdfminer-six>=20231228
Requires-Dist: pdfplumber>=0.11.9
Requires-Dist: pillow>=10.0.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pypdfium2>=4.0.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: rapidocr-onnxruntime>=1.4
Description-Content-Type: text/markdown

# esg-cid-plus

Supporting code for the EMNLP 2026 paper:
**ESG-CID-Plus: A Stratified Benchmark for Disclosure Content Index Table Extraction from Corporate Sustainability Reports**

## Install

```bash
uv pip install -e .
```

## Modules

| Module | Purpose |
|--------|---------|
| `cid` | Data models (`CIRow`, `ContentIndex`, `FrameworkSpec`) and normalization helpers |
| `data` | HuggingFace loaders — `load_split`, `load_framework`, `resolve_pdf_path` |
| `pdf_toolkit` | `PDFSession` — text extraction, lunr search, camelot tables, page labels |
| `pdf_toolkit_ocr` | `OCRPDFSession` — extends above with image rendering, rapidocr, img2table |
| `extract` | Rule-based pipeline: S1 detect → S2/S3 draft → S4 resolve → `ContentIndex` |
| `eval` | Tuple-level P/R/F1 — `evaluate_predictions`, `format_feedback` |

## Quickstart

```python
from esg_cid_plus.data import load_split, load_framework, resolve_pdf_path
from esg_cid_plus.extract import extract
from esg_cid_plus.eval import evaluate_predictions

pdf_rows, cid_rows = load_split("train_small")
fw = load_framework("gri_2021")

pdf_path = resolve_pdf_path(pdf_rows[0])
ci = extract(pdf_path, fw)

gt = [r for r in cid_rows if r["report_name"] == pdf_rows[0]["report_name"]]
pred = [{"report_name": ci.report_name, "standard_id": r.standard_id,
         "page_location_indices": r.page_location_indices} for r in ci.rows]

_, overall = evaluate_predictions(gt, pred)
print(overall)
```

## Tests

```bash
uv run pytest              # fast (unit)
uv run pytest -m slow      # integration — requires HuggingFace access
```
