This commit is contained in:
15
docs/snippets/r/utils/token_reduction.md
Normal file
15
docs/snippets/r/utils/token_reduction.md
Normal file
@@ -0,0 +1,15 @@
|
||||
```r title="R"
|
||||
library(kreuzberg)
|
||||
|
||||
config <- list(
|
||||
token_reduction = list(
|
||||
mode = "moderate",
|
||||
preserve_important_words = TRUE
|
||||
)
|
||||
)
|
||||
|
||||
json <- extract_file_sync("document.pdf", "application/pdf", config)
|
||||
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
|
||||
|
||||
cat(result$content)
|
||||
```
|
||||
Reference in New Issue
Block a user