Files
Mohd KaifandClaude Sonnet 4.6 b282487b17 docs: rewrite and polish documentation site (#413)
- Rewrote index.md to match README (tagline, badges, Problem/Solution text)
- Improved getting-started, concepts, quickstart, installation, faq, use-cases, contributing, glossary, learning-more, examples, modules, architecture, cookbook, deep-dive pages: tighter prose, fixed headings/bullets, removed inconsistencies and duplicate sections
- Removed overuse of emojis from headings in integration pages (docling, snowflake)
- Fixed change_management reference page: closed unclosed JSON code block that broke the right TOC, demoted noisy sub-headings to bold text
- CSS layout: widened content area (max-width 1440px grid, left sidebar 11rem, right TOC narrowed to 11rem for broader content), tightened TOC spacing and font size, fixed word-wrap/overflow on TOC links
- Added mkdocs_local.yml for local serving without mkdocs-jupyter plugin

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 18:38:21 +05:30

108 lines
3.5 KiB
Markdown

# Docling Integration
Semantica features a native integration with **Docling**, the powerful document parsing library that excels at extracting structured data from complex documents like PDFs, DOCX, and PPTX.
## Overview
Docling is integrated into Semantica's `parse` module via the `DoclingParser`. This allows you to seamlessly convert unstructured documents into semantic structures that can be indexed, searched, and analyzed within the Semantica framework.
- 📖 **Semantica Docling Integration Docs**: [Reference Guide](../reference/parse.md)
- 💻 **Semantica Docling Integration GitHub**: [Source Code](https://github.com/Hawksight-AI/semantica/blob/main/semantica/parse/docling_parser.py)
- 🧑🏽‍🍳 **Semantica Docling Integration Example**: [Docling Clear Code Example](../CodeExamples.md#docling-clear-code-example)
- 📦 **Semantica Docling Integration PyPI**: [Installation Guide](../installation.md)
---
## Integration Documentation
The `DoclingParser` provides a high-level interface for document processing. It supports:
* **Multi-format support**: PDF, DOCX, PPTX, HTML, and more.
* **Table Extraction**: High-fidelity table extraction with header detection.
* **OCR Support**: Built-in Optical Character Recognition for scanned documents.
* **Markdown Export**: Clean markdown output optimized for LLM consumption.
### Basic Usage
```python
from semantica.parse import DoclingParser
# Initialize with OCR enabled
parser = DoclingParser(enable_ocr=True)
# Parse a complex document
result = parser.parse("financial_report.pdf")
# Access the structured data
print(f"Content: {result['full_text'][:200]}...")
print(f"Found {len(result['tables'])} tables")
```
For more details, see the [Parse Reference](../reference/parse.md).
---
## Integration Example
We provide a detailed cookbook and clear code examples to help you get started quickly.
### Docling Clear Code Example
```python
from semantica.parse import DoclingParser
import json
# 1. Initialize the Docling Parser with advanced config
parser = DoclingParser(
enable_ocr=True,
export_format="markdown"
)
# 2. Parse a complex document (PDF, DOCX, etc.)
result = parser.parse("complex_invoice.pdf")
# 3. Access the clean Markdown text
print(f"--- Document Content ---\n{result['full_text']}")
# 4. Iterate through extracted tables
for i, table in enumerate(result['tables']):
print(f"\nTable {i+1} headers: {table.get('headers', [])}")
# Access table rows as a list of lists
for row in table.get('rows', [])[:3]: # Print first 3 rows
print(f" Row: {row}")
# 5. Get document metadata
metadata = result['metadata']
print(f"\n--- Metadata ---\nTitle: {metadata.get('title')}")
print(f"Total Pages: {result.get('total_pages')}")
```
See more in our [Code Examples](../CodeExamples.md).
---
## GitHub Source
The integration is open-source and available on GitHub. You can explore the implementation, contribute improvements, or report issues.
- [docling_parser.py](https://github.com/Hawksight-AI/semantica/blob/main/semantica/parse/docling_parser.py) - The core implementation of the Docling integration.
---
## PyPI & Installation
Docling is an optional but highly recommended dependency for Semantica. You can install it along with Semantica or as a separate requirement.
### Install via Semantica
```bash
pip install semantica
```
### Install Docling manually
If you are working in a custom environment:
```bash
pip install docling
```
For full installation details, see the [Installation Guide](../installation.md).