Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

INFINI-NEWS FM-Index

FM-index files for the INFINI-NEWS corpus, enabling fast full-text search and n-gram queries over 5 years of news articles (2021-2025).

Overview

This dataset contains pre-built FM-indexes (based on the Burrows-Wheeler Transform) that enable:

  • Substring search: Find any text pattern in the corpus
  • N-gram counting: Count occurrences of any n-gram
  • Document retrieval: Get full context around matches
  • Metadata queries: Search article metadata (titles, URLs, dates)

Structure

ruggsea/infini-news-index/
β”œβ”€β”€ 2021/
β”‚   β”œβ”€β”€ 01/                # January 2021
β”‚   β”‚   β”œβ”€β”€ data.fm9       # FM-index for article text
β”‚   β”‚   β”œβ”€β”€ meta.fm9       # FM-index for metadata
β”‚   β”‚   β”œβ”€β”€ data_offset    # Document boundaries (text)
β”‚   β”‚   └── meta_offset    # Document boundaries (metadata)
β”‚   β”œβ”€β”€ 02/                # February 2021
β”‚   β”‚   └── ...
β”‚   └── 12/
β”œβ”€β”€ 2022/
β”‚   └── ...                # 12 monthly shards
β”œβ”€β”€ 2023/
β”‚   β”œβ”€β”€ 01/ ... 10/        # Regular monthly shards
β”‚   β”œβ”€β”€ 11_part1/          # November 2023 (sub-sharded)
β”‚   β”œβ”€β”€ 11_part2/
β”‚   β”œβ”€β”€ 11_part3/
β”‚   β”œβ”€β”€ 11_part4/
β”‚   └── 12/
β”œβ”€β”€ 2024/
β”‚   β”œβ”€β”€ 01/ ... 10/
β”‚   β”œβ”€β”€ 11_part1/          # November 2024 (sub-sharded)
β”‚   β”œβ”€β”€ 11_part2/
β”‚   β”œβ”€β”€ 11_part3/
β”‚   β”œβ”€β”€ 11_part4/
β”‚   └── 12/
└── 2025/
    β”œβ”€β”€ 01/ ... 11/
    β”œβ”€β”€ 12_part1/          # December 2025 (sub-sharded into 10 parts)
    β”œβ”€β”€ 12_part2/
    └── ... 12_part10/

Each month is indexed separately as a "shard". Some large months (Nov 2023, Nov 2024, Dec 2025) are split into multiple sub-shards due to their size. The engine queries across all shards seamlessly.

Installation

# Install the infini-gram-mini engine
pip install infini-gram-mini

# Or install from source for latest features
git clone https://github.com/xuhaoxh/infini-gram-mini.git
cd infini-gram-mini
pip install -e .

Usage

Download Indexes

from huggingface_hub import snapshot_download

# Download all indexes (~2.3 TB total)
snapshot_download(
    repo_id="ruggsea/infini-news-index",
    repo_type="dataset",
    local_dir="./infini-news-index"
)

# Or download specific year
snapshot_download(
    repo_id="ruggsea/infini-news-index",
    repo_type="dataset",
    local_dir="./infini-news-index",
    allow_patterns=["2022/**"]
)

Query the Index

from pathlib import Path
from infini_gram_mini import InfiniGramMiniEngine

# Collect all shard directories (handles both regular and sub-sharded months)
index_dir = Path("./infini-news-index")
shard_dirs = []
for year_dir in sorted(index_dir.glob("20*")):
    for month_dir in sorted(year_dir.iterdir()):
        if month_dir.is_dir() and (month_dir / "data.fm9").exists():
            shard_dirs.append(str(month_dir))

# Initialize engine
engine = InfiniGramMiniEngine(
    index_dirs=shard_dirs,
    load_to_ram=False,  # Memory-map for large indexes
    get_metadata=True
)

# Count occurrences of a term
result = engine.find("climate change")
print(f"'climate change' appears {result['cnt']:,} times")

# Get document context around a match
if result['cnt'] > 0:
    for shard_idx, segment in enumerate(result['segment_by_shard']):
        if segment:
            doc = engine.get_doc_by_rank(
                s=shard_idx,
                rank=segment[0],
                needle_len=len("climate change".encode('utf-8')),
                max_ctx_len=500
            )
            print(f"Context: {doc['text'][:200]}")
            break

Query Specific Time Periods

# Load only 2022 indexes for faster queries on that year
shard_dirs_2022 = [
    str(p) for p in sorted(Path("./infini-news-index/2022").iterdir())
    if p.is_dir() and (p / "data.fm9").exists()
]

engine_2022 = InfiniGramMiniEngine(
    index_dirs=shard_dirs_2022,
    load_to_ram=False,
    get_metadata=True
)

result = engine_2022.find("covid-19")
print(f"'covid-19' in 2022: {result['cnt']:,} occurrences")

Index Statistics

Year Shards Index Size Articles
2021 12 283 GB 160.5M
2022 12 437 GB 213.9M
2023 15 484 GB 201.6M
2024 15 439 GB 151.8M
2025 21 628 GB 125.0M
Total 75 2.27 TB 852.8M

Note: Some months are split into multiple sub-shards (Nov 2023: 4 parts, Nov 2024: 4 parts, Dec 2025: 10 parts) due to their large size.

Technical Details

  • Index type: FM-index (Ferragina-Manzini index)
  • Implementation: infini-gram-mini
  • Compression: SDSL-lite with RRR vectors
  • Query complexity: O(m) for pattern of length m
  • Space: ~30-40% of original text size
  • Query speed: 2-4 seconds across all 75 shards (memory-mapped)

Authors

  • Ruggero Lazzaroni
  • Kirill Solovev

Citation

If you use this index in your research, please cite:

@dataset{infini_news_2025,
  author = {Lazzaroni, Ruggero and Solovev, Kirill},
  title = {INFINI-NEWS: Large-Scale News Corpus with FM-Index},
  year = {2025},
  publisher = {Hugging Face},
  url = {https://huggingface.co/datasets/ruggsea/infini-news-index}
}

License

CC-BY-4.0

Related

Downloads last month
543