Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Wikipedia Articles (Spanish)

This dataset contains segmented articles from the Spanish Wikipedia. Each example includes structural and textual information designed for tasks such as text classification, segmentation, and sentence similarity.

The dataset is divided into three subsets:

  • wikipedia-es-A000: Suggested train dataset; 26510 groups of articles.
  • wikipedia-es-A001: Suggested validation dataset; 3336 groups of articles.
  • wikipedia-es-A002: Suggested test dataset; 6557 groups of articles.

Each record contains the following fields:

Field Description
title Title or subtitle of the article (List[str])
text Paragraphs or sentences in the segment (List[str])
id Unique segment ID
paragraphs Number of paragraphs
articles Number of articles spanned
words Total word count

πŸ” The train.parquet file is a flattened version (for visualization only), where title and text have been converted to plain strings.


πŸ“¦ How to Use

πŸ”Ή Load the full dataset (with structured fields)

To load the dataset for training or processing:

git lfs install
git clone https://huggingface.co/datasets/Alverciito/wikipedia_articles_es
from datasets import load_from_disk

ds = load_from_disk("wikipedia-es-A000")  # or A001 / A002

πŸ”§ Dataset Construction Pipeline

This dataset was generated in two main stages:

1️⃣ Wikipedia Article Extraction (ZIM-based)

Raw articles are extracted directly from an offline Wikipedia ZIM file using a custom extractor. Download the Spanish Wikipedia ZIM file here.

The extraction process:

  • Randomly samples Wikipedia articles by internal index
  • Parses HTML content using BeautifulSoup
  • Extracts clean paragraph-level text
  • Optionally follows internal Wikipedia links (relation recursion)
  • Assigns unique document IDs

Each extracted article contains:

  • title
  • text (list of paragraphs)
  • internal references (used only during extraction)

This approach ensures:

  • No dependency on the live Wikipedia API
  • Full reproducibility from a fixed ZIM snapshot
  • High-throughput extraction suitable for large-scale datasets

2️⃣ Segmentation into Multi-Article Samples

Extracted articles are converted into segmented documents using a controlled aggregation strategy.

Segmentation rules:

  • Each sample contains 1 to 10 articles
  • Articles are concatenated until a maximum paragraph limit is reached
  • Paragraphs are preserved as coherent textual units
  • Metadata is accumulated per segment

Resulting metadata per sample:

  • paragraphs: total number of paragraphs
  • words: total word count
  • articles: number of Wikipedia articles combined
  • title: list of article titles
  • text: list of paragraph blocks (order preserved)

This structure is designed for:

  • document-level classification
  • segmentation boundary detection
  • long-context language modeling
  • sentence and paragraph similarity tasks

πŸ“Š Dataset Statistics

Each sample provides both local and global structural information:

  • Document length in paragraphs and words
  • Number of source articles per segment
  • Explicit title grouping for multi-article samples

This enables models to reason about structure and scale, not just raw text.


πŸ” Article Overlap & Data Leakage Analysis

To assess potential cross-split contamination, we measure the article-level overlap rate between dataset splits.
Overlap is defined as the percentage of unique Wikipedia article titles that appear in more than one split, regardless of segmentation or grouping.

Methodology

  • Titles are extracted from the title field (List[str]) of each sample.
  • Titles are flattened and deduplicated per split.
  • Overlap is computed as the set intersection between splits, normalized by the size of the compared split.

Results

 (A000) ∩  (A001):      1.64%
 (A000) ∩  (A002):      3.26%
 (A001) ∩  (A002):      1.77%

πŸ§ͺ Visualization & Exploration

A Gradio-based dataset explorer is included for interactive inspection.

Features:

  • Browse samples by index
  • View full segmented text with paragraph numbering
  • Inspect per-sample statistics
  • Visualize global distributions:
    • Paragraph counts
    • Word counts
    • Articles per segment

Typical use cases:

  • Dataset sanity checking
  • Length distribution analysis
  • Manual validation of segmentation quality

▢️ Running the data Visualizer

python bin/visualizer.py

You will be prompted for the dataset path, for example:

Enter dataset path: /home/example_user/data/wikipedia-es-A000

πŸ” Reproducibility Notes

Dataset generation is fully reproducible given:

  • the same Wikipedia ZIM file
  • the same random seed

No heuristic filtering is applied beyond:

  • HTML parsing
  • whitespace normalization
  • reference deduplication during extraction

This makes the dataset suitable for:

  • research benchmarks
  • controlled experiments
  • regeneration with alternative segmentation policies

⚠️ Known Limitations

  • Some articles may be short or partially extracted due to Wikipedia formatting
  • Titles are stored as lists (one per article) rather than flattened strings
  • Internal references are not included in the final dataset (used only during extraction)

πŸ“œ License & Attribution

  • License: MIT
  • Source: Spanish Wikipedia (offline ZIM snapshot)
  • Author: Alberto Palomo Alonso
  • Institution: Universidad de AlcalΓ‘ – Escuela PolitΓ©cnica Superior

Wikipedia content is redistributed under its original license terms.

Downloads last month
15

Collection including Alverciito/wikipedia_articles_es