Skip to main content

Structured delivery toolkit for converting MinerU parses into full_text, datamining, and multimodal outputs.

Project description

PorosData-Designer

PorosData-Designer converts MinerU-generated document parses into three stable deliverables: full_text, datamining, and multimodal.

It is designed for scientific data processing, structure-aware training preparation, and atomic document design centered on paragraphs, formulas, chemical expressions, and figure assets.

What It Does

  • Builds a structure-aware full-text view from *_content_list.json.
  • Maps document sections, formulas, chemical expressions, and asset references into a datamining view.
  • Extracts image-caption-mention relationships into a multimodal view with copied assets and Markdown outputs.

Install

pip install porosdata-designer

Quick Start

--input_dir should point to a directory tree that contains MinerU outputs. In practice, Designer expects:

  • one or more *_content_list.json files
  • image assets that remain resolvable relative to those input files

For package usage, it is recommended to pass explicit output and log directories.

Run the full pipeline:

porosdata-designer run all --input_dir "path/to/input_dir" --output_dir "path/to/output_dir" --log_dir "path/to/log_dir"

Equivalent module mode:

python -m porosdata_designer run all --input_dir "path/to/input_dir" --output_dir "path/to/output_dir" --log_dir "path/to/log_dir"

Stage Commands

Run text structuring only:

porosdata-designer run text --input_dir "path/to/input_dir" --output_dir "path/to/output_dir"

Run multimodal extraction only:

porosdata-designer run multimodal --input_dir "path/to/input_dir" --output_dir "path/to/output_dir"

Outputs

Designer produces three delivery views by default:

  • full_text: for structure-aware training and human review.
  • datamining: for retrieval, extraction, indexing, and downstream storage.
  • multimodal: for image-text linking, multimodal indexing, and asset delivery.

Typical output layout:

path/to/output_dir/
├── full_text/{doc_id}/
│   ├── {doc_id}_structured.json
│   └── {doc_id}_structured.txt
├── datamining/{doc_id}/
│   └── {doc_id}_datamining.json
└── multimodal/{doc_id}/
    ├── {doc_id}_index.json
    ├── fig_n.md
    └── assets/

Validation

Audit structured outputs:

porosdata-designer audit structured --root_dir "path/to/output_dir"

Validate text outputs:

porosdata-designer validate structured --output_dir "path/to/output_dir/full_text"

Validate multimodal outputs:

porosdata-designer validate multimodal --output_dir "path/to/output_dir/multimodal"

Run final acceptance validation:

porosdata-designer validate acceptance --output_dir "path/to/output_dir/multimodal"

Python Usage

You can also use the package directly in Python:

from porosdata_designer import DataMiningMapper, MultimodalInterleaver, TextAggregator

aggregator = TextAggregator()
mapper = DataMiningMapper()
interleaver = MultimodalInterleaver()

A more complete text-side example:

from porosdata_designer import DataMiningMapper, TextAggregator

content_list = [
    {"type": "text", "text_level": 1, "text": "Abstract", "page_idx": 0},
    {"type": "text", "text": "This work studies a Cu-Zr metallic glass system.", "page_idx": 0},
    {"type": "text", "text_level": 1, "text": "Results and Discussion", "page_idx": 1},
    {"type": "text", "text": "Figure 1 shows the microstructure evolution at 700 K.", "page_idx": 1},
]

aggregator = TextAggregator()
structured_text = aggregator.aggregate(content_list)

mapper = DataMiningMapper()
datamining_view = mapper.map(structured_text, {"doc_id": "demo-0001"})

print(structured_text)
print(datamining_view.pure_text_stream)
print(datamining_view.structured_json["sections"])

Expected outcome:

  • structured_text contains Poros tags such as <poros_doc>, <poros_section_*>, and <poros_paragraph>.
  • pure_text_stream removes the structure tags while keeping readable text.
  • structured_json exposes mined fields such as sections, formulas, chemical_formulas, and asset_refs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

porosdata_designer-0.1.0.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

porosdata_designer-0.1.0-py3-none-any.whl (62.5 kB view details)

Uploaded Python 3

File details

Details for the file porosdata_designer-0.1.0.tar.gz.

File metadata

  • Download URL: porosdata_designer-0.1.0.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for porosdata_designer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b9289675bec0579a1aebd3256e8467d98db32f5599a0c3a707ab4823977d86f
MD5 688391e5a36de5ce833c613d0083f4bc
BLAKE2b-256 63aeaf0ddeb3a39d6c84406c560a7ddf7b02d0b221d94fcc5b1d43448c82efa4

See more details on using hashes here.

File details

Details for the file porosdata_designer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for porosdata_designer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f9a82ac6bc3d4341f63906dfb4cfdda46b6bb6bd637bc29669045ff8d993e3e
MD5 cf2535c844ee6f6902a2a3c44dc1390c
BLAKE2b-256 abcaf32383e48709996d083d00c28818e061996254561c520fa3960168b46f0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page