This commit is contained in:
18
docs/snippets/python/config/config_programmatic.md
Normal file
18
docs/snippets/python/config/config_programmatic.md
Normal file
@@ -0,0 +1,18 @@
|
||||
```python title="Python"
|
||||
from kreuzberg import (
|
||||
extract_file_sync,
|
||||
ExtractionConfig,
|
||||
OcrConfig,
|
||||
ChunkingConfig,
|
||||
)
|
||||
|
||||
config: ExtractionConfig = ExtractionConfig(
|
||||
use_cache=True,
|
||||
ocr=OcrConfig(backend="tesseract", language="eng"),
|
||||
chunking=ChunkingConfig(max_chars=1000, max_overlap=200),
|
||||
)
|
||||
|
||||
result = extract_file_sync("document.pdf", config=config)
|
||||
content_length: int = len(result.content)
|
||||
print(f"Content length: {content_length}")
|
||||
```
|
||||
Reference in New Issue
Block a user