This commit is contained in:
15
docs/snippets/python/utils/language_detection.md
Normal file
15
docs/snippets/python/utils/language_detection.md
Normal file
@@ -0,0 +1,15 @@
|
||||
```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())
|
||||
```
|
||||
Reference in New Issue
Block a user