H-ROTS
Semantic table preprocessing for retrieval-augmented generation (RAG)
H-ROTS transforms complex HTML tables into semantic records and retrieval-ready text. It resolves hierarchical headers, merged cells, row labels and supported contextual transitions before indexing. No LLM calls, model training, GPU or embedding service are needed.
- FullPath: explicit hierarchical semantic paths.
- Compact: shared-prefix serialization with reconstruction of supported intermediate records.
- Python API and command-line interface; CPU-only preprocessing.
This main branch contains the installable Python library and command-line interface.
Architecture
H-ROTS converts HTML tables into ordered intermediate semantic records before serialization. FullPath and Compact are two representations of these same records.
flowchart TD
A["Complex HTML table"] --> B["Structural inference"]
B --> C["Semantic context integration"]
C --> D["Intermediate semantic records"]
D --> E["FullPath"]
D --> F["Compact"]
F --> G["Compact decoder"]
G -.-> D
E --> H["Downstream RAG"]
F --> H
H-ROTS runs on the CPU without LLM calls or model training. Retrieval and answer generation are outside the library's scope. Compact decoding reconstructs supported intermediate records, not the original HTML or visual layout.
Installation
Requires Python 3.10 or newer.
Install or upgrade from PyPI when the package is available:
python -m pip install --upgrade h-rots
To install this exact version after it has been published to PyPI:
python -m pip install h-rots==0.1.1
For the current development checkout, install directly from GitHub:
python -m pip install "h-rots @ git+https://github.com/hallymgitoslab/H-ROTS.git@main"
Check the installed version:
h-rots --version
See the release history and changelog.
Quick start
from h_rots import parse, serialize, decode, convert
html = """
<table>
<thead>
<tr><th rowspan="2">Department</th><th colspan="2">2026</th></tr>
<tr><th>Applications</th><th>Admissions</th></tr>
</thead>
<tbody>
<tr><th>Computer Science</th><td>120</td><td>40</td></tr>
<tr><th>Mathematics</th><td>90</td><td>30</td></tr>
</tbody>
</table>
"""
records = parse(html)
print(serialize(records, mode="fullpath"))
compact = serialize(records, mode="compact")
print(compact)
assert decode(compact) == records
# Direct HTML-to-text conversion (also retains supported captions).
text = convert(html, mode="compact")
CLI
h-rots table.html --mode fullpath
h-rots table.html --mode compact -o table.compact.txt
h-rots table.compact.txt --mode decode -o records.json
h-rots table.html --mode json
python -m h_rots table.html --mode fullpath
Use - or omit the input path to read UTF-8 from stdin. The CLI's Compact mode serializes intermediate records without a caption so it can be decoded directly.
API
| Function | Purpose |
|---|---|
parse(html) |
Parse the first table to ordered semantic records. |
serialize(records, mode="fullpath") |
Serialize records as FullPath or Compact. |
decode(text) |
Reconstruct supported intermediate records from Compact. |
convert(html, mode="fullpath") |
Convert the first table to text, including supported captions. |
html_tables_to_markdown_text(html) |
Render multiple top-level tables with the research FullPath convenience function. |
Original research entry points are also exported from h_rots for migration. See API documentation and examples.
Design and scope
The library does not implement retrieval, answer generation or general table reasoning. Heuristic inference can be ambiguous; Compact reconstructs supported intermediate records, not original HTML or visual layout. Token savings depend on the input. Process untrusted HTML with appropriate input size and resource limits in your application.
Research and citation
A research manuscript accompanying H-ROTS is in preparation for publication. The manuscript, formal citation, and detailed research findings will be announced after acceptance, when disclosure is appropriate. No acceptance or publication status is claimed at this time.
Development and release
python -m pip install -e .
python -m unittest discover -s tests -v
python -m pip install build twine
python -m build
python -m twine check dist/*
See release guide for PyPI Trusted Publishing. Research-only experiment scripts are not included in the installable package.
Project contributors
| GitHub | Role |
|---|---|
| @hallymgitoslab | Lead Developer |
| @hero707 | Project Support |
| @Iamjunseok | Development Support |
| @waitinghm-creator | Development Support |
These are project contribution roles, not a declaration of manuscript authorship or author contributions.
Acknowledgments
This research was supported by the ANCHOR program(Glocal University30) through the Gangwon ANCHOR Center, funded by the Ministry of Education(MOE) and the Gangwon State(G.S.),Republic of Korea.(2026-ANCHOR-10-009)
The authors also acknowledge Hallym University for its support.
License
Original H-ROTS software and documentation are licensed under Apache-2.0. Third-party dependencies and datasets retain their respective licenses. Research data is not distributed in this package.
Metadata
Release files for h-rots 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| h_rots-0.1.1.tar.gz | 41.5 kB | With provenance | Details for h_rots-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| h_rots-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for h_rots-0.1.1-py3-none-any.whl |
Total release size: 72.3 kB
Release files / h_rots-0.1.1.tar.gz
| Download URL | h_rots-0.1.1.tar.gz |
|---|---|
| Size | 41.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d8e2cc0e1f10c44a9a9cbe59c87d6f11926f1157ee00cef007fd44a4c75d51b
|
|
BLAKE2b-256 checksum How to use checksums |
cf1422cb6dc3c6ef9b82e73d2e97e29e72ee2c8a17a1e294c0b1b542e17a4777
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logRelease files / h_rots-0.1.1-py3-none-any.whl
| Download URL | h_rots-0.1.1-py3-none-any.whl |
|---|---|
| Size | 30.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97dc423871a85d70410e999a7226b440158b05c2a907414cb50b95b1915d0e8d
|
|
BLAKE2b-256 checksum How to use checksums |
5cdaa79c915730729aded1046b03883cac1416a1d66cfb36c66f39145f3863fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logSecurity for h-rots 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for h_rots-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.