headroomlabs-ai/headroom · error · ImportError
HuggingFace datasets required. Install with: pip install dat
Error message
HuggingFace datasets required. Install with: pip install datasets
What it means
Error "HuggingFace datasets required. Install with: pip install datasets" thrown in headroomlabs-ai/headroom.
Source
Thrown at headroom/evals/html_oss_benchmarks.py:147
This benchmark measures how well we extract article body text from HTML.
The established baseline (trafilatura) achieves 0.958 F1.
Args:
extractor: HTMLExtractor instance (creates one if None)
max_samples: Limit number of samples (for quick testing)
Returns:
ExtractionBenchmarkResult with precision, recall, F1 scores
Example:
result = evaluate_scrapinghub_benchmark(max_samples=50)
print(f"F1: {result.avg_f1:.3f} (baseline: {result.baseline_f1})")
"""
try:
from datasets import load_dataset
except ImportError:
raise ImportError(
"HuggingFace datasets required. Install with: pip install datasets"
) from None
if extractor is None:
from headroom.transforms.html_extractor import HTMLExtractor
extractor = HTMLExtractor()
# Load the benchmark dataset
logger.info("Loading Scrapinghub article extraction benchmark...")
dataset = load_dataset("allenai/scrapinghub-article-extraction-benchmark")
samples = dataset["train"]
if max_samples:
samples = samples.select(range(min(max_samples, len(samples))))
logger.info(f"Evaluating {len(samples)} samples...")
View on GitHub (pinned to 322425c43b)
Solutions
- Install the datasets package: pip install datasets
- Or install the evals extra: pip install headroom-ai[evals]
When it happens
Trigger: Raised when an HTML OSS benchmark needs the HuggingFace `datasets` library but it is not installed.
Common situations: See trigger scenarios.
AI-assisted analysis of headroomlabs-ai/headroom@322425c43b (2026-08-15).
Data as JSON: /api/errors/325cb470241c6e75.
Report an issue: GitHub.