opendatalab / MinerU-HTML-v1.1-compact

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: February 04 2026

Introduction of MinerU-HTML-v1.1-compact

Model Details of MinerU-HTML-v1.1-compact

MinerU-HTML

MinerU-HTML is an intelligent HTML main content extraction tool based on Large Language Models (LLM). It can accurately identify and extract main content from complex web page HTML, automatically filtering out auxiliary elements such as navigation bars, advertisements, and metadata.

โœจ Features
  • ๐ŸŽฏ LLM-Powered Extraction : Uses state-of-the-art language models to intelligently identify main content
  • โšก Compact Format : Now use compact format for the model instead of the original JSON format for faster inference speed
  • ๐Ÿ”„ Complete Processing Pipeline : Includes HTML simplification, prompt construction, LLM inference, result parsing, main content extraction, and other complete processes
  • ๐Ÿš€ Multiple Inference Backend Support : Supports three inference backends: VLLM, Transformers, and OpenAI API
  • ๐Ÿ›ก๏ธ Fault Tolerance : Supports fallback mechanism (trafilatura or bypass) to ensure content extraction even when processing fails
  • ๐Ÿ”Œ Modular Design : Clear architecture design, easy to extend and customize
  • ๐Ÿงช Complete Testing : Includes comprehensive unit tests and integration tests
๐Ÿ“‹ Directory Structure
MinerU-HTML/
โ”œโ”€โ”€ mineru_html/             # Core code package
โ”‚   โ”œโ”€โ”€ __init__.py          # Package initialization, exports main API
โ”‚   โ”œโ”€โ”€ api.py               # Main API interfaces (MinerUHTMLGeneric, MinerUHTMLConfig)
โ”‚   โ”œโ”€โ”€ base.py              # Base data class definitions
โ”‚   โ”œโ”€โ”€ constants.py         # Constant definitions
โ”‚   โ”œโ”€โ”€ exceptions.py        # Exception class definitions
โ”‚   โ”œโ”€โ”€ utils.py             # Utility functions
โ”‚   โ”œโ”€โ”€ implementations/     # Concrete implementation classes
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py      # implementations subpackage initialization file
โ”‚   โ”‚   โ”œโ”€โ”€ vllm_api.py      # VLLM API backend implementation (MinerUHTML)
โ”‚   โ”‚   โ”œโ”€โ”€ openai_api.py    # OpenAI API backend implementation (MinerUHTML_OpenAI)
โ”‚   โ”‚   โ””โ”€โ”€ transformers_api.py  # Transformers API backend implementation (MinerUHTML_Transformers)
โ”‚   โ”œโ”€โ”€ inference/           # Inference backend abstraction layer
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py      # inference subpackage initialization file
โ”‚   โ”‚   โ”œโ”€โ”€ base_backend.py  # Inference backend base class (InferenceBackend)
โ”‚   โ”‚   โ”œโ”€โ”€ factory.py       # Backend factory functions
โ”‚   โ”‚   โ”œโ”€โ”€ vllm_backend.py  # VLLM backend implementation (VLLMInferenceBackend)
โ”‚   โ”‚   โ”œโ”€โ”€ transformers_backend.py  # Transformers backend implementation (TransformersInferenceBackend)
โ”‚   โ”‚   โ””โ”€โ”€ openai_backend.py  # OpenAI API backend implementation (OpenaiAPIInferenceBackend)
โ”‚   โ””โ”€โ”€ process/             # Processing pipeline module
โ”‚       โ”œโ”€โ”€ __init__.py      # process subpackage initialization file
โ”‚       โ”œโ”€โ”€ build_prompt.py  # Prompt construction
โ”‚       โ”œโ”€โ”€ simplify_html.py # HTML simplification
โ”‚       โ”œโ”€โ”€ parse_result.py  # Result parsing
โ”‚       โ”œโ”€โ”€ map_to_main.py   # Main content extraction
โ”‚       โ””โ”€โ”€ html_utils.py    # HTML utility functions
โ”œโ”€โ”€ tests/                   # Test code
โ”œโ”€โ”€ benchmark/               # Benchmark test data
โ”œโ”€โ”€ eval_baselines/          # Benchmark evaluation code
โ”œโ”€โ”€ requirements/            # Dependency package lists (by module)
โ”‚   โ”œโ”€โ”€ core.txt            # Core dependencies
โ”‚   โ”œโ”€โ”€ openai.txt          # OpenAI related dependencies
โ”‚   โ””โ”€โ”€ vllm.txt            # VLLM related dependencies
โ”œโ”€โ”€ README.md                # Documentation
โ”œโ”€โ”€ run_eval.sh              # Benchmark test execution script
โ”œโ”€โ”€ baselines.txt            # Benchmark dependency package list
โ”œโ”€โ”€ eval_baselines.py        # Benchmark evaluation entry code
โ””โ”€โ”€ setup.py                # Installation configuration (supports optional dependencies)
๐Ÿš€ Quick Start
Installation
Basic Installation (Core Dependencies Only)
pip install .
# Or development mode
pip install -e .
Install Specific Backend Dependencies

Depending on your use case, you can choose to install different backend dependencies:

# Install OpenAI backend dependencies
pip install .[openai]

# Install VLLM backend dependencies
pip install .[vllm]

# Install all dependencies
pip install .[all]
Basic Usage
Using VLLM Backend
from mineru_html import MinerUHTML, MinerUHTMLConfig

# Create configuration
config = MinerUHTMLConfig(
    use_fall_back='trafilatura',  # or 'bypass'
    prompt_version='compact',     # recommend using compact
    early_load=True
)

# Initialize MinerUHTML (using local model)
extractor = MinerUHTML(
    model_path='path/to/your/model',   # The model used must correspond to the prompt_version in MinerUHTMLConfig
    config=config
)

# Process single HTML
html_content = '<html>...</html>'
result = extractor.process(html_content)
print(result[0].main_html)

# Process multiple HTML
html_list = ['<html>...</html>', '<html>...</html>']
results = extractor.process(html_list)
for result in results:
    print(result.main_html)
    print(result.case_id)
Using OpenAI API Backend
from mineru_html import MinerUHTML_OpenAI, MinerUHTMLConfig

# Create configuration
config = MinerUHTMLConfig(
    use_fall_back='trafilatura',
    prompt_version='v2',          # Recommend using v2
    early_load=True
)

# Initialize MinerUHTML_OpenAI
extractor = MinerUHTML_OpenAI(
    base_url='https://api.openai.com/v1',
    sk='your-api-key',
    model='gpt-5',
    config=config,
    retry_times=3
)

# Process HTML
html_content = '<html>...</html>'
result = extractor.process(html_content)
print(result[0].main_html)
Using Transformers Backend
from mineru_html import MinerUHTML_Transformers, MinerUHTMLConfig

# Create configuration
config = MinerUHTMLConfig(
    use_fall_back='trafilatura',
    prompt_version='v2',
    early_load=True
)

# Initialize MinerUHTML_Transformers
extractor = MinerUHTML_Transformers(
    model_path='path/to/your/model',   # The model used must correspond to the prompt_version in MinerUHTMLConfig
    config=config,
    model_init_kwargs={
        'device_map': 'auto',
        'dtype': 'auto',
    },
    model_gen_kwargs={
        'max_new_tokens': 8192,
    }
)

# Process HTML
html_content = '<html>...</html>'
result = extractor.process(html_content)
print(result[0].main_html)
๐Ÿ“– Core Concepts
Processing Pipeline

The MinerU-HTML processing pipeline includes the following steps:

  1. HTML Simplification ( simplify_html ): Simplifies raw HTML into a structured format, assigning a unique _item_id attribute to each element
  2. Prompt Construction ( build_prompt ): Constructs LLM prompts based on simplified HTML to guide the model in content classification
  3. LLM Inference ( inference ): Uses LLM to classify each element, marking them as "main" (main content) or "other" (auxiliary content)
  4. Result Parsing ( parse_result ): Parses the classification results returned by LLM
  5. Main Content Extraction ( extract_main_html ): Extracts main content from original HTML based on classification results
  6. Fallback Processing : If the above process fails, uses fallback mechanism (trafilatura or bypass) for content extraction
Configuration Options

MinerUHTMLConfig supports the following configurations:

  • use_fall_back : Fallback type, optional 'trafilatura' or 'bypass'
  • early_load : Whether to load the model early (default True )
  • prompt_version : Prompt version, optional 'v2' , 'compact' . The MinerUHTML interface and MinerUHTML_Transformers interface can use 'compact' , the MinerUHTML_OpenAI interface can use 'v2'
Usage instructions for different prompt_version:
  • 'compact' : Used for local model inference, it returns more concise results (only keeping the key and value in the JSON dictionary). It is recommended to use the 'compact' model for faster inference speed.
  • 'v2' : Used for OpenAI API inference, it is the result after prompt optimization.
๐Ÿ”ง Advanced Usage
Using Factory Functions to Create Backends

You can also directly use factory functions to create backends and then pass them to MinerUHTMLGeneric :

from mineru_html import MinerUHTMLGeneric, MinerUHTMLConfig
from mineru_html.inference.factory import create_vllm_backend, create_openai_backend, create_transformers_backend

# Create VLLM backend using factory function
llm = create_vllm_backend(
    model_path='path/to/model',
    response_format='compact',
    max_context_window=32 * 1024,
    model_init_kwargs={'tensor_parallel_size': 1}
)

# Create Transformers backend using factory function
llm = create_transformers_backend(
    model_path='path/to/model',
    max_context_window=32 * 1024,
    model_init_kwargs={
        'device_map': 'auto',
        'dtype': 'auto',
    },
    model_gen_kwargs={
        'max_new_tokens': 8192,
    }
)

# Create OpenAI backend using factory function
llm = create_openai_backend(
    base_url='https://api.openai.com/v1',
    sk='your-api-key',
    model='gpt-5',
    max_context_window=128 * 1000
)

# Use the created backend
config = MinerUHTMLConfig()
extractor = MinerUHTMLGeneric(llm=llm, config=config)
Error Handling
from mineru_html.exceptions import MinerUHTMLError

try:
    result = extractor.process(html_content)
except MinerUHTMLError as e:
    print(f"Processing failed: {e}")
    print(f"Case ID: {e.case_id}")
Backend Selection Recommendations
  • VLLM Backend ( MinerUHTML ): Suitable for local deployment, requires GPU, best performance
  • Transformers Backend ( MinerUHTML_Transformers ): Suitable for local deployment, supports CPU/GPU, high flexibility
  • OpenAI API Backend ( MinerUHTML_OpenAI ): Suitable for cloud services, no local model required, simple to use
๐Ÿงช Testing

Run unit tests and integration tests:

pytest tests/

Runs of opendatalab MinerU-HTML-v1.1-compact on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About MinerU-HTML-v1.1-compact huggingface.co Model

MinerU-HTML-v1.1-compact huggingface.co

MinerU-HTML-v1.1-compact huggingface.co is an AI model on huggingface.co that provides MinerU-HTML-v1.1-compact's model effect (), which can be used instantly with this opendatalab MinerU-HTML-v1.1-compact model. huggingface.co supports a free trial of the MinerU-HTML-v1.1-compact model, and also provides paid use of the MinerU-HTML-v1.1-compact. Support call MinerU-HTML-v1.1-compact model through api, including Node.js, Python, http.

MinerU-HTML-v1.1-compact huggingface.co Url

https://huggingface.co/opendatalab/MinerU-HTML-v1.1-compact

opendatalab MinerU-HTML-v1.1-compact online free

MinerU-HTML-v1.1-compact huggingface.co is an online trial and call api platform, which integrates MinerU-HTML-v1.1-compact's modeling effects, including api services, and provides a free online trial of MinerU-HTML-v1.1-compact, you can try MinerU-HTML-v1.1-compact online for free by clicking the link below.

opendatalab MinerU-HTML-v1.1-compact online free url in huggingface.co:

https://huggingface.co/opendatalab/MinerU-HTML-v1.1-compact

MinerU-HTML-v1.1-compact install

MinerU-HTML-v1.1-compact is an open source model from GitHub that offers a free installation service, and any user can find MinerU-HTML-v1.1-compact on GitHub to install. At the same time, huggingface.co provides the effect of MinerU-HTML-v1.1-compact install, users can directly use MinerU-HTML-v1.1-compact installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

MinerU-HTML-v1.1-compact install url in huggingface.co:

https://huggingface.co/opendatalab/MinerU-HTML-v1.1-compact

Url of MinerU-HTML-v1.1-compact

MinerU-HTML-v1.1-compact huggingface.co Url

Provider of MinerU-HTML-v1.1-compact huggingface.co

opendatalab
ORGANIZATIONS

Other API from opendatalab

huggingface.co

Total runs: 724
Run Growth: -487
Growth Rate: -67.27%
Updated:December 03 2025