This commit is contained in:
16
docs/snippets/python/ocr/ocr_paddleocr.md
Normal file
16
docs/snippets/python/ocr/ocr_paddleocr.md
Normal file
@@ -0,0 +1,16 @@
|
||||
```python title="Python"
|
||||
from kreuzberg import extract_file_sync, ExtractionConfig, OcrConfig
|
||||
|
||||
config: ExtractionConfig = ExtractionConfig(
|
||||
ocr=OcrConfig(backend="paddleocr", language="en") # model_tier="server" for max accuracy
|
||||
)
|
||||
|
||||
result = extract_file_sync("scanned.pdf", config=config)
|
||||
|
||||
content: str = result.content
|
||||
preview: str = content[:100]
|
||||
total_length: int = len(content)
|
||||
|
||||
print(f"Extracted content (preview): {preview}")
|
||||
print(f"Total characters: {total_length}")
|
||||
```
|
||||
Reference in New Issue
Block a user