dragon-okinawa / docling-ocr-pdf

docling-ocr-pdf model leverages Docling's document parsing to perform OCR on various document formats, streamlining text extraction for AI tasks

  • Public
  • 65 runs
  • L40S
  • GitHub
  • License
Iterate in playground

Input

Run this model in Node.js with one line of code:

npx create-replicate --model=dragon-okinawa/docling-ocr-pdf
or set up a project from scratch
npm install replicate
Set the REPLICATE_API_TOKEN environment variable:
export REPLICATE_API_TOKEN=<paste-your-token-here>

Find your API token in your account settings.

Import and set up the client:
import Replicate from "replicate";
import fs from "node:fs";

const replicate = new Replicate({
  auth: process.env.REPLICATE_API_TOKEN,
});

Run dragon-okinawa/docling-ocr-pdf using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

const output = await replicate.run(
  "dragon-okinawa/docling-ocr-pdf:26632288fc0a29e51b1ca75b6ad9fd00d1fe6f14bd1add083eb4d0ec96ceec3d",
  {
    input: {
      timeout: 120,
      to_format: "md",
      from_format: "any"
    }
  }
);

// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"

// To write the file to disk:
fs.writeFile("my-image.png", output[0]);

To learn more, take a look at the guide on getting started with Node.js.

Output

No output yet! Press "Submit" to start a prediction.

Run time and cost

This model runs on Nvidia L40S GPU hardware. We don't yet have enough runs of this model to provide performance information.

Readme

The docling-ocr-pdf model utilizes the document processing capabilities from the Docling project to perform Optical Character Recognition (OCR) on a variety of document formats, including but not limited to PDFs.

It enables efficient document preprocessing, making textual data ready for generative AI tasks.