typefile
{
"document": "https://replicate.delivery/pbxt/K0onIKM1Wn5xTzan7ua67mqePVrRf6feas4sfTjbbAROkrcL/The%20Tell-Tale%20Heart.pdf",
"dpi": 400,
"enable_editor": false,
"lang": "English",
"parallel_factor": 10
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_aQG**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run cuuupid/marker using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cuuupid/marker:9c67051309f6d10ca139489f15fcb5ebc4866a3734af537c181fb13bc719d280",
{
input: {
document: "https://replicate.delivery/pbxt/K0onIKM1Wn5xTzan7ua67mqePVrRf6feas4sfTjbbAROkrcL/The%20Tell-Tale%20Heart.pdf",
dpi: 400,
enable_editor: false,
lang: "English",
parallel_factor: 10
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_aQG**********************************
This is your API token. Keep it to yourself.
import replicate
Run cuuupid/marker using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cuuupid/marker:9c67051309f6d10ca139489f15fcb5ebc4866a3734af537c181fb13bc719d280",
input={
"document": "https://replicate.delivery/pbxt/K0onIKM1Wn5xTzan7ua67mqePVrRf6feas4sfTjbbAROkrcL/The%20Tell-Tale%20Heart.pdf",
"dpi": 400,
"enable_editor": False,
"lang": "English",
"parallel_factor": 10
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_aQG**********************************
This is your API token. Keep it to yourself.
Run cuuupid/marker using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "cuuupid/marker:9c67051309f6d10ca139489f15fcb5ebc4866a3734af537c181fb13bc719d280",
"input": {
"document": "https://replicate.delivery/pbxt/K0onIKM1Wn5xTzan7ua67mqePVrRf6feas4sfTjbbAROkrcL/The%20Tell-Tale%20Heart.pdf",
"dpi": 400,
"enable_editor": false,
"lang": "English",
"parallel_factor": 10
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Object output with 2 properties
{"language": "English", "filetype": "pdf", "toc": [], "pages": 4, "ocr_stats": {"ocr_pages": 0, "ocr_failed": 0, "ocr_success": 0}, "block_stats": {"header_footer": 0, "code": 0, "table": 0, "equations": {"successful_ocr": 0, "unsuccessful_ocr": 0, "equations": 0}}, "postprocess_stats": {"edit": {}}}{
"id": "cnquwkdbsger34wp4pepsvni6m",
"model": "cuuupid/marker",
"version": "9c67051309f6d10ca139489f15fcb5ebc4866a3734af537c181fb13bc719d280",
"input": {
"document": "https://replicate.delivery/pbxt/K0onIKM1Wn5xTzan7ua67mqePVrRf6feas4sfTjbbAROkrcL/The%20Tell-Tale%20Heart.pdf",
"dpi": 400,
"enable_editor": false,
"lang": "English",
"parallel_factor": 10
},
"logs": "Extracting fromExtracting from 11 blocks 9 blocks\nExtracted block 0 with 15 lines\nExtracted block 0 with Extracted block 1 with 1 lines\nExtracted block 2 with 1 lines28Extracting from 17 blocks\nExtracted block 0 with 28 lines\nExtracting from 9Extracted block 1 blocks\nExtracted block 0 with 15 with lines\nExtracted block lines3 lines\nExtracted block Extracted block 1\n1 Extracted block 3 with 2 withwith 2 115 lineslines\nExtracted block 4 lines\nExtracted block 2 with 1 lines\nExtracted block 3 with 1with 2 with 1 lines\nlines\nExtracted block 5 Extracted block 2 with 1 withlinesExtracted block\nExtracted block 12 lines\nExtracted block 6 with 1lines\nExtracted block 4 3 with3 with 5 lines\nExtracted block lines\nExtracted block 7 4with 1 lineswith 6 lines\n15\nExtracted block 8 withExtracted block 5 with 8 1 lineslineslines\nwith 1 lines\nExtracted block 6\nExtracted 9 blocks\nExtracted block 5 with 4 Extracted block 4 with with 1 lineslines\nExtracted block\nExtracted block 7 1 lines\nExtracted block 5 with6 2 lines\nExtracted block 6 withwith 1with 2 lines\nExtracted block 8 with 11 lines\nExtracted block 9 with lines\nExtracted block 7 with 8 lines lines\n3 lines\nExtracted block 10\nExtracted block 7 withExtracted block 8 with with 1 lines\n1 linesExtracted block\n9Extracted block 11 6 lines with\nExtracted block 8 with5 with 5 lines\nlines\nExtracted block 10 1 lines\nExtracted 9Extracted block 12 with blocks with 11 lines\nExtracted block 13 with 5\nlines\nlines\nExtracted block 14 withExtracted 11 blocks\n1 lines\nExtracted block 15 with 3 lines\nExtracted block 16 with 1 lines\nExtracted 17 blocks",
"output": {
"markdown": "https://replicate.delivery/pbxt/8UKRTTBKhe3uTi3sEFdYdfK9YWAvoDC50dU2NibKOSVKVJASA/out.md",
"metadata": "{\"language\": \"English\", \"filetype\": \"pdf\", \"toc\": [], \"pages\": 4, \"ocr_stats\": {\"ocr_pages\": 0, \"ocr_failed\": 0, \"ocr_success\": 0}, \"block_stats\": {\"header_footer\": 0, \"code\": 0, \"table\": 0, \"equations\": {\"successful_ocr\": 0, \"unsuccessful_ocr\": 0, \"equations\": 0}}, \"postprocess_stats\": {\"edit\": {}}}"
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-08T09:35:05.638249Z",
"started_at": "2023-12-08T09:35:05.674931Z",
"completed_at": "2023-12-08T09:35:07.459913Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/cnquwkdbsger34wp4pepsvni6m/cancel",
"get": "https://api.replicate.com/v1/predictions/cnquwkdbsger34wp4pepsvni6m"
},
"metrics": {
"predict_time": 1.784982,
"total_time": 1.821664
}
}