How hamdilaziz/tableseq works
TableSeq turns table images into one autoregressive sequence containing HTML structure, cell text, and coordinate tokens. The main user workflow is single-image inference: the CLI loads a checkpoint and tokenizer, preprocesses an image, generates a sequence, then writes cleaned HTML, boxes, metadata, and a visual report. The repository also supports dataset-based training and split evaluation with structure and box metrics. The graph reflects documented workflows and source-index references; unsampled implementation details are not inferred.
Main entry points: eval_tableseq.py Evaluation entrypoint · inference.py Image inference · modeling.py TableSeq model · train_tableseq.py Training entrypoint
Components 21
User workflows
- Inference CLI
scripts/infer_tableseq.py - Inference runner
tableseq/run_tableseq.py - Image inference
tableseq/inference.py - Prediction report
tableseq/inference.py - Inference artifacts
Data and coordinates
- Dataset loader
tableseq/data.py - Coordinate scaling
tableseq/coordinates.py - Training dataset
- Evaluation split
Generation model
- TableSeq model
tableseq/modeling.py - Visual encoder
tableseq/models/encoder.py - TableSeq decoder
tableseq/models/decoder.py - mBART implementation
tableseq/models/modeling_mbart.py
Training and evaluation
- Training entrypoint
scripts/train_tableseq.py - Trainer
tableseq/training/trainer.py - Evaluation entrypoint
scripts/eval_tableseq.py - Sequence metrics
tableseq/training/fast_metrics.py - HTML metrics
metrics_utils/html_metrics.py - Box metrics
tableseq/training/box_metrics.py - Metric HTML cleanup
tableseq/training/metrics.py
Other components
- User
Connections 25
- User → Inference CLI: runs inference
README.md - Inference CLI → Inference runner: invokes runner
scripts/infer_tableseq.py - Inference runner → Image inference: calls inference
tableseq/run_tableseq.py - Image inference → TableSeq model: generates sequence
tableseq/inference.py - Image inference → Coordinate scaling: decodes boxes
tableseq/inference.py - Image inference → Prediction report: builds report
README.md - Image inference → Inference artifacts: writes artifacts
README.md - TableSeq model → Visual encoder: uses encoder
tableseq/modeling.py - TableSeq model → TableSeq decoder: uses decoder
tableseq/modeling.py - TableSeq decoder → mBART implementation: wraps implementation
tableseq/models/decoder.py - User → Training entrypoint: starts training
README.md - Training entrypoint → Dataset loader: loads samples
scripts/train_tableseq.py - Training entrypoint → Trainer: starts trainer
scripts/train_tableseq.py - Trainer → TableSeq model: trains and generates
tableseq/training/trainer.py - Dataset loader → Coordinate scaling: scales labels
tableseq/data.py - User → Evaluation entrypoint: runs evaluation
README.md - Evaluation entrypoint → Dataset loader: loads split
scripts/eval_tableseq.py - Evaluation entrypoint → TableSeq model: loads model
scripts/eval_tableseq.py - Evaluation entrypoint → Trainer: uses evaluation routines
scripts/eval_tableseq.py - Evaluation entrypoint → Sequence metrics: scores structure
scripts/eval_tableseq.py - Evaluation entrypoint → Box metrics: scores boxes
scripts/eval_tableseq.py - Evaluation entrypoint → Metric HTML cleanup: cleans generated HTML
tableseq/training/metrics.py - Sequence metrics → HTML metrics: optional TEDS
- User → Training dataset: provides dataset
README.md - User → Evaluation split: selects split
README.md