Files
fil/docs/snippets/python/utils/language_detection.md

16 lines
470 B
Markdown
Raw Normal View History

2026-06-01 23:40:55 +02:00
```python title="Python"
import asyncio
from kreuzberg import ExtractionConfig, LanguageDetectionConfig, extract_file
async def main() -> None:
config: ExtractionConfig = ExtractionConfig(
language_detection=LanguageDetectionConfig(
enabled=True, min_confidence=0.9, detect_multiple=True
)
)
result = await extract_file("document.pdf", config=config)
print(f"Languages: {result.detected_languages}")
asyncio.run(main())
```