This commit is contained in:
15
docs/snippets/r/utils/quality_processing_example.md
Normal file
15
docs/snippets/r/utils/quality_processing_example.md
Normal file
@@ -0,0 +1,15 @@
|
||||
```r title="R"
|
||||
library(kreuzberg)
|
||||
|
||||
config <- list(enable_quality_processing = TRUE)
|
||||
json <- extract_file_sync("scanned_document.pdf", "application/pdf", config)
|
||||
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
|
||||
|
||||
cat(sprintf("Content length: %d characters\n", nchar(result$content)))
|
||||
if (!is.null(result$quality_score)) {
|
||||
cat(sprintf("Quality score: %.2f\n", result$quality_score))
|
||||
if (result$quality_score < 0.5) {
|
||||
cat("Warning: low quality extraction\n")
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user