You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed in document of V2 says there's a way to reload file (losslessly?).
Reload a DoclingDocument stored as JSON
You can save and reload a DoclingDocument to disk in JSON format using the following codes:
# Save to disk:
doc: DoclingDocument = conv_res.document # produced from conversion result...
with Path("./doc.json").open("w") as fp:
fp.write(json.dumps(doc.export_to_dict())) # use `export_to_dict` to ensure consistency
# Load from disk:
with Path("./doc.json").open("r") as fp:
doc_dict = json.loads(fp.read())
doc = DoclingDocument.model_validate(doc_dict) # use standard pydantic API to populate doc
I want to know if there is any method to reload doctags file from export_to_doctags() to do the same thing, for further processing using Docling (eg. convert to markdown)?
(I accept no images in this case, as the doctags file cannot contain images(?) using above export function)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed in document of V2 says there's a way to reload file (losslessly?).
I want to know if there is any method to reload doctags file from export_to_doctags() to do the same thing, for further processing using Docling (eg. convert to markdown)?
(I accept no images in this case, as the doctags file cannot contain images(?) using above export function)
Beta Was this translation helpful? Give feedback.
All reactions