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
- INFINI-NEWS Corpus - Raw article data in Parquet format
- infini-gram - Original infini-gram project
- infini-gram-mini - Lightweight FM-index engine
- Downloads last month
- 543