| docling_convert | R Documentation |
Runs Docling's document-understanding pipeline over local file paths or URLs
and returns lightweight R handles around the resulting DoclingDocuments.
Each handle can be exported to Markdown or JSON (as_markdown(),
as_json()), mined for tables (docling_tables()), or split into chunks
for RAG (docling_chunk()).
docling_convert(
source,
ocr = TRUE,
table_mode = c("accurate", "fast"),
device = c("auto", "cpu", "cuda", "mps"),
num_threads = NULL,
images = FALSE,
images_scale = 1,
...
)
source |
A character vector of file paths and/or URLs. A single source
returns one |
ocr |
Logical; run OCR on the document. Defaults to |
table_mode |
Table-structure model mode, one of |
device |
Accelerator device for the deep-learning models: |
num_threads |
Optional integer number of CPU threads for the
accelerator. |
images |
Logical; generate and retain page and picture images so they
can be saved later with |
images_scale |
Image resolution scale relative to 72 DPI when |
... |
Reserved for future pipeline options; currently ignored with a warning if supplied. |
Supported inputs include PDF, DOCX, PPTX, XLSX, HTML, Markdown, AsciiDoc and common image formats, as determined by the installed Docling version.
For a single source, an object of class docling_document (a list
with the underlying Python document and the original source). For
multiple sources, a docling_document_list: a list of docling_document
objects named by source.
as_markdown(), docling_tables(), docling_chunk()
## Not run:
doc <- docling_convert("https://arxiv.org/pdf/2408.09869")
as_markdown(doc)
# Batch, OCR off, fast tables
docs <- docling_convert(c("a.pdf", "b.pdf"), ocr = FALSE, table_mode = "fast")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.