This commit is contained in:
24
docs/snippets/swift/advanced/keyword_extraction_config.md
Normal file
24
docs/snippets/swift/advanced/keyword_extraction_config.md
Normal file
@@ -0,0 +1,24 @@
|
||||
```swift title="Swift"
|
||||
import Foundation
|
||||
import Kreuzberg
|
||||
import RustBridge
|
||||
|
||||
let configJson = """
|
||||
{
|
||||
"keywords": {
|
||||
"algorithm": "yake",
|
||||
"max_keywords": 10,
|
||||
"min_score": 0.3,
|
||||
"ngram_range": [1, 3],
|
||||
"language": "en"
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
let config = try extractionConfigFromJson(configJson)
|
||||
let result = try extractFileSync("document.pdf", nil, config)
|
||||
|
||||
if let keywords = result.extracted_keywords() {
|
||||
print("Extracted \(keywords.count) keywords")
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user