Skip to main content

Low-Cost Cross-Domain Web Structured Information Extraction using specialized LoRA adapters.

Project description

AXEtract Logo

AXEtract

Low-Cost Cross-Domain Web Structured Information Extraction

Documentation License: MIT GitHub


AXEtract is a high-performance, low-cost framework for extracting structured data from web pages. Based on the paper "AXE: Low-Cost Cross-Domain Web Structured Information Extraction", it optimizes the extraction pipeline by using specialized LoRA adapters for pruning and query-specific extraction, enabling state-of-the-art results with small models (e.g., Qwen3-0.6B).

🚀 Key Features

  • 🎯 Specialized LoRA Adapters: Uses task-specific adapters for DOM pruning and structured extraction, achieving high accuracy with minimal token overhead.
  • ✂️ Smart DOM Pruning: Classifies and prunes irrelevant HTML nodes before passing them to the extractor, significantly reducing context window usage and costs.
  • 📍 Grounded XPath Resolution (GXR): Automatically maps extracted JSON fields back to their original source XPaths in the DOM for verification and grounding.
  • ⚡ High-Throughput Pipeline: Built-in support for multiple LLM engines, including vLLM for production-grade serving and HuggingFace for local research.
  • 🌐 Cross-Domain Versatility: Designed to generalize across various web domains (e-commerce, real estate, listings) without needing domain-specific rules.

🛠️ Architecture

AXEtract follows a three-part decoupled pipeline for maximum efficiency:

  1. Preprocessor: Fetches raw HTML and chunks it into manageable, token-aware fragments.
  2. AI Extractor: Divided into two stages:
    • Pruner: A lightweight LLM (LoRA-powered) filters out noise and selects only relevant HTML chunks.
    • Extractor: A task-specific LLM maps the pruned HTML content directly to a structured JSON schema or natural language answer.
  3. Postprocessor: Validates the output and resolves source XPaths via Grounded XPath Resolution (GXR).

📦 Installation

# Install from PyPI
uv pip install axetract

# Or install from source
git clone https://github.com/abdo-Mansour/axetract.git
cd axetract
uv sync

🚥 Quick Start

from pydantic import BaseModel
from axetract.pipeline import AXEPipeline

# 1. Initialize the pipeline with default LoRA adapters
# (Automatically downloads adapters from HuggingFace Hub)
pipeline = AXEPipeline.from_config(use_vllm=False)

# 2. Define your desired extraction schema
class Product(BaseModel):
    name: str
    price: str
    rating: float

# 3. Extract from a URL or raw HTML
url = "https://example.com/item/12345"
result = pipeline.extract(url, schema=Product)

# 4. Access your structured data
print(f"Status: {result.status}")
print(f"Prediction: {result.prediction}")
print(f"Source XPaths: {result.xpaths}")

🌐 API Server

AXEtract includes a built-in FastAPI server for high-throughput serving. After installing the package, start it with the installed CLI entry point:

axe-server

Or via python -m for development installs:

python -m axetract.server

Configuration is done via environment variables:

Variable Default Description
AXE_USE_VLLM false Set to true to use vLLM backend
AXE_PORT 8000 Port to listen on
AXE_HOST 0.0.0.0 Host to bind to
AXE_LOG_FILE (stderr) Optional path to a log file

See axe_server/client_example.py for examples of interacting with the API via requests.

📝 Citation

If you use AXEtract in your research, please cite our paper:

@misc{mansour2026axe,
      title={AXE: Low-Cost Cross-Domain Web Structured Information Extraction}, 
      author={Abdelrahman Mansour and Khaled W. Alshaer and Moataz Elsaban},
      year={2026},
      eprint={2602.01838},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2602.01838}, 
}

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

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

axetract-0.1.1.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

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

axetract-0.1.1-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

Details for the file axetract-0.1.1.tar.gz.

File metadata

  • Download URL: axetract-0.1.1.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for axetract-0.1.1.tar.gz
Algorithm Hash digest
SHA256 be18f703f1fa392047b171cfc1bdb710f0036dbfd467633d741f221112acf9f0
MD5 6cab40163be6338ab71ef2256d8ed5bb
BLAKE2b-256 e49d0adb7d0896784a4e9087ec5f912be918ae96b7c539733555a6cd523dd004

See more details on using hashes here.

Provenance

The following attestation bundles were made for axetract-0.1.1.tar.gz:

Publisher: publish.yml on abdo-Mansour/axetract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file axetract-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: axetract-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 52.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for axetract-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 001156ea650262bca5213d233ee7b858e62869567b1edd3dce6234148d0d7264
MD5 ee356f73c2dc9c3654e2f86e5b8162e6
BLAKE2b-256 25de97ff8d78073cffd87bb508be9cdb826518af12c72ff01da41908c55b81c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for axetract-0.1.1-py3-none-any.whl:

Publisher: publish.yml on abdo-Mansour/axetract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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