update load_from_doctags usage
Browse files
README.md
CHANGED
|
@@ -103,8 +103,7 @@ doctags = processor.batch_decode(
|
|
| 103 |
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
|
| 104 |
print(doctags)
|
| 105 |
# create a docling document
|
| 106 |
-
doc = DoclingDocument(
|
| 107 |
-
doc.load_from_doctags(doctags_doc)
|
| 108 |
|
| 109 |
# export as any format
|
| 110 |
# HTML
|
|
@@ -175,8 +174,7 @@ for idx, img_file in enumerate(image_files, 1):
|
|
| 175 |
|
| 176 |
# To convert to Docling Document, MD, HTML, etc.:
|
| 177 |
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
|
| 178 |
-
doc = DoclingDocument(
|
| 179 |
-
doc.load_from_doctags(doctags_doc)
|
| 180 |
# export as any format
|
| 181 |
# HTML
|
| 182 |
# output_path_html = Path(OUTPUT_DIR) / f"{img_fn}.html"
|
|
@@ -311,8 +309,7 @@ print(doctags)
|
|
| 311 |
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
|
| 312 |
print(doctags)
|
| 313 |
# create a docling document
|
| 314 |
-
doc = DoclingDocument(
|
| 315 |
-
doc.load_from_doctags(doctags_doc)
|
| 316 |
|
| 317 |
print(doc.export_to_markdown())
|
| 318 |
```
|
|
|
|
| 103 |
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
|
| 104 |
print(doctags)
|
| 105 |
# create a docling document
|
| 106 |
+
doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")
|
|
|
|
| 107 |
|
| 108 |
# export as any format
|
| 109 |
# HTML
|
|
|
|
| 174 |
|
| 175 |
# To convert to Docling Document, MD, HTML, etc.:
|
| 176 |
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
|
| 177 |
+
doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")
|
|
|
|
| 178 |
# export as any format
|
| 179 |
# HTML
|
| 180 |
# output_path_html = Path(OUTPUT_DIR) / f"{img_fn}.html"
|
|
|
|
| 309 |
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
|
| 310 |
print(doctags)
|
| 311 |
# create a docling document
|
| 312 |
+
doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")
|
|
|
|
| 313 |
|
| 314 |
print(doc.export_to_markdown())
|
| 315 |
```
|