Core
This is where the core supermat parsing logic exists.
Core deals with Supermat's parser pydantic models to define structure to the parsed documents,
chunking strategies, and parser logic to convert documents into the ParsedDocument
model.
export_parsed_document(document, output_path, **kwargs)
Export given ParsedDocument to a json file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document |
ParsedDocumentType
|
The ParsedDocument to be dumped. |
required |
output_path |
Path | str
|
JSON file location. |
required |
Source code in supermat/core/models/parsed_document.py
249 250 251 252 253 254 255 256 257 258 |
|
load_parsed_document(path)
Load a json dumped ParsedDocument
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path | str
|
file path to the json file. |
required |
Returns:
Name | Type | Description |
---|---|---|
ParsedDocumentType |
ParsedDocumentType
|
ParsedDocument model loaded from json. |
Source code in supermat/core/models/parsed_document.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|