id stringlengths 76 84 | doc_hash stringclasses 74
values | category stringclasses 5
values | messages listlengths 2 2 | window_hash stringclasses 272
values |
|---|---|---|---|---|
construction_58_Контракт___0321...___22635244194260010230002.bin__win0_chunk_0 | 51f11b599ddf1a91 | construction | [
{
"role": "user",
"content": "<document>\nКОНТРАКТ № 0321500001626000075\n\nОказание услуг по лабораторным испытаниям строительных материалов\n\nи контролируемых в них показателей на прочность (бетон тяжелый, мелкозернистый, легкий)\n\nИдентификационный код закупки в соответствии с планом-графиком\n\n262263... | f584f1726ebc9972 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win0_chunk_1 | 51f11b599ddf1a91 | construction | [
{
"role": "user",
"content": "<document>\nКОНТРАКТ № 0321500001626000075\n\nОказание услуг по лабораторным испытаниям строительных материалов\n\nи контролируемых в них показателей на прочность (бетон тяжелый, мелкозернистый, легкий)\n\nИдентификационный код закупки в соответствии с планом-графиком\n\n262263... | f584f1726ebc9972 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win0_chunk_2 | 51f11b599ddf1a91 | construction | [
{
"role": "user",
"content": "<document>\nКОНТРАКТ № 0321500001626000075\n\nОказание услуг по лабораторным испытаниям строительных материалов\n\nи контролируемых в них показателей на прочность (бетон тяжелый, мелкозернистый, легкий)\n\nИдентификационный код закупки в соответствии с планом-графиком\n\n262263... | f584f1726ebc9972 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win0_chunk_3 | 51f11b599ddf1a91 | construction | [{"role":"user","content":"<document>\nКОНТРАКТ № 0321500001626000075\n\nОказание (...TRUNCATED) | f584f1726ebc9972 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win0_chunk_4 | 51f11b599ddf1a91 | construction | [{"role":"user","content":"<document>\nКОНТРАКТ № 0321500001626000075\n\nОказание (...TRUNCATED) | f584f1726ebc9972 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win0_chunk_5 | 51f11b599ddf1a91 | construction | [{"role":"user","content":"<document>\nКОНТРАКТ № 0321500001626000075\n\nОказание (...TRUNCATED) | f584f1726ebc9972 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win0_chunk_6 | 51f11b599ddf1a91 | construction | [{"role":"user","content":"<document>\nКОНТРАКТ № 0321500001626000075\n\nОказание (...TRUNCATED) | f584f1726ebc9972 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win1_chunk_0 | 51f11b599ddf1a91 | construction | [{"role":"user","content":"<document>\n6.14. В случае неисполнения или нен(...TRUNCATED) | 2525174d6b6812f7 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win1_chunk_1 | 51f11b599ddf1a91 | construction | [{"role":"user","content":"<document>\n6.14. В случае неисполнения или нен(...TRUNCATED) | 2525174d6b6812f7 |
construction_58_Контракт___0321...___22635244194260010230002.bin__win1_chunk_2 | 51f11b599ddf1a91 | construction | [{"role":"user","content":"<document>\n6.14. В случае неисполнения или нен(...TRUNCATED) | 2525174d6b6812f7 |
Russian contextual chunks
Chunks of Russian business documents, each paired with the document window it was cut from and a one or two sentence context that places the chunk inside that document. Rows train and evaluate the contextual retrieval step of a RAG ingest pipeline, where the index stores a chunk together with its context instead of the chunk alone.
The set holds 3,134 rows from 82 documents across five categories: construction,
food, it, pharma and security. The contexts were written by an API teacher,
cline-pass/deepseek-v4.1-flash, with reasoning disabled.
Fields
| field | type | description |
|---|---|---|
id |
string | stable row id, {category}_{document}_{window}_chunk_{index} |
doc_hash |
string | document fingerprint, 16 hex characters |
category |
string | one of construction, food, it, pharma, security |
messages |
list | two turns, the labeling prompt for the user and the teacher context for the assistant |
window_hash |
string | window fingerprint, also the split key |
The user turn carries the full prompt, so a row can be handed to a chat model as is.
The assistant turn holds the context alone, with no wrapper text. The prompt passes
the document window between <document> tags and the chunk between <chunk> tags,
and the chunk is always an exact substring of that window.
Splits
| split | rows |
|---|---|
| train | 2,701 |
| validation | 433 |
The split key is window_hash, so two rows that share a window never land on
opposite sides. Duplicate material was removed before splitting: 5 duplicate
documents by doc_hash and 61 duplicate prompts by window_hash. This keeps the
validation slice free of leakage through near-duplicate text.
How it was built
Documents were chunked with the Qwen3 tokenizer rather than by character count, because Russian prose runs at about 2.85 characters per token while markdown tables reach 1.21. A chunk sits inside a window of at most 8,000 tokens and runs to at most 1,200 tokens itself. Tables are cut by rows, up to 8 rows or 1,500 tokens, so that the markdown structure survives. An audit script checks every stage and fails on a chunk that is not a substring of its window, on a prompt longer than 12,288 tokens or on an id that disagrees between stages.
Labeling the 3,134 rows cost USD 0.82. The windows are labeled in document order, so
each prompt after the first in a window hits the provider prefix cache, and 79.3% of
the 19.5M prompt tokens were served from it. provenance.json records the teacher,
the chunking parameters, dedup counts and totals. metadata.jsonl holds per-row
telemetry: window and chunk token counts, provider usage and cache hits, cost,
latency, finish reason and the generated context.
Usage
from datasets import load_dataset
ds = load_dataset("p4ulbr4dl3y/ru-contextual-chunks")
print(ds) # train 2701, validation 433
row = ds["train"][0]
print(row["category"], row["messages"][0]["content"][:200])
The assistant turn is the training target of a student model, and the user turn reproduces the exact prompt the teacher saw.
Notes and limitations
- Domain is Russian business documents, mostly contracts, procurement files and technical documentation. Nothing was measured outside it.
- The teacher contexts are the labels, so the dataset inherits the teacher's errors and blind spots. A student trained on it is expected to reproduce them.
- Category counts are uneven, so per-category comparisons are reliable for it and food and weak for the rest.
- An earlier export with truncated document windows remains at
ru-contextual-chunks-trunc-legacy. Do not mix it with this one.
Links
- Student model trained on this dataset: https://huggingface.co/p4ulbr4dl3y/qwen3-0.6b-contextual-chunks
- Technical report and pipeline code: https://github.com/p4ulbr4dl3y/contextual-chunks
- Downloads last month
- 94