mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-04-24 23:56:21 +02:00
Restructure examples directory and improve document storage (#189)
* Consolidate tests/ into examples/documents/ * Add line_count and reorder structure keys * Lazy-load documents with _meta.json index * Update demo script and add pre-shipped workspace * Extract shared helpers for JSON reading and meta entry building
This commit is contained in:
parent
74e549a23a
commit
77722838e1
26 changed files with 430 additions and 61 deletions
|
|
@ -1095,11 +1095,13 @@ def page_index_main(doc, opt=None):
|
|||
# Create a clean structure without unnecessary fields for description generation
|
||||
clean_structure = create_clean_structure_for_description(structure)
|
||||
doc_description = generate_doc_description(clean_structure, model=opt.model)
|
||||
structure = format_structure(structure, order=['title', 'node_id', 'start_index', 'end_index', 'summary', 'text', 'nodes'])
|
||||
return {
|
||||
'doc_name': get_pdf_name(doc),
|
||||
'doc_description': doc_description,
|
||||
'structure': structure,
|
||||
}
|
||||
structure = format_structure(structure, order=['title', 'node_id', 'start_index', 'end_index', 'summary', 'text', 'nodes'])
|
||||
return {
|
||||
'doc_name': get_pdf_name(doc),
|
||||
'structure': structure,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue