This commit is contained in:
22
docs/snippets/ruby/config/advanced_config.md
Normal file
22
docs/snippets/ruby/config/advanced_config.md
Normal file
@@ -0,0 +1,22 @@
|
||||
```ruby title="Ruby"
|
||||
require 'kreuzberg'
|
||||
|
||||
config = Kreuzberg::ExtractionConfig.new(
|
||||
ocr: Kreuzberg::OcrConfig.new(
|
||||
backend: 'tesseract',
|
||||
language: 'eng+deu'
|
||||
),
|
||||
chunking: Kreuzberg::ChunkingConfig.new(
|
||||
max_characters: 1000,
|
||||
overlap: 100
|
||||
),
|
||||
language_detection: Kreuzberg::LanguageDetectionConfig.new,
|
||||
use_cache: true,
|
||||
enable_quality_processing: true
|
||||
)
|
||||
|
||||
result = Kreuzberg.extract_file_sync('document.pdf', config: config)
|
||||
|
||||
result.chunks&.each { |chunk| puts chunk[0..100] }
|
||||
puts "Languages: #{result.detected_languages.inspect}"
|
||||
```
|
||||
Reference in New Issue
Block a user