This commit is contained in:
17
docs/snippets/r/config/keyword_extraction_config.md
Normal file
17
docs/snippets/r/config/keyword_extraction_config.md
Normal file
@@ -0,0 +1,17 @@
|
||||
```r title="R"
|
||||
library(kreuzberg)
|
||||
|
||||
config <- list(
|
||||
keywords = list(enabled = TRUE)
|
||||
)
|
||||
|
||||
json <- extract_file_sync("document.pdf", "application/pdf", config)
|
||||
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
|
||||
|
||||
cat(sprintf("Extracted %d keywords\n", length(result$keywords)))
|
||||
if (length(result$keywords) > 0) {
|
||||
for (i in seq_len(min(5L, length(result$keywords)))) {
|
||||
cat(sprintf(" - %s\n", result$keywords[[i]]))
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user