This commit is contained in:
23
docs/snippets/rust/config/pdf_hierarchy_config.md
Normal file
23
docs/snippets/rust/config/pdf_hierarchy_config.md
Normal file
@@ -0,0 +1,23 @@
|
||||
```rust title="Rust"
|
||||
use kreuzberg::{extract_file_sync, ExtractionConfig, PdfConfig, HierarchyConfig};
|
||||
|
||||
fn main() -> kreuzberg::Result<()> {
|
||||
let config = ExtractionConfig {
|
||||
pdf_options: Some(PdfConfig {
|
||||
hierarchy: Some(HierarchyConfig {
|
||||
enabled: true,
|
||||
detection_threshold: Some(0.75),
|
||||
ocr_coverage_threshold: Some(0.8),
|
||||
min_level: Some(1),
|
||||
max_level: Some(5),
|
||||
}),
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let result = extract_file_sync("document.pdf", None::<&str>, &config)?;
|
||||
println!("Hierarchy levels: {}", result.hierarchy.len());
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user