aussie-1k / scripts /prepare_v62.py
aleks-wordcab's picture
Publish Aussie-1k v6.2: 1000 questions, dataset card and provenance
92210b9 verified
Raw History Blame Contribute Delete
3.54 kB
#!/usr/bin/env python3
"""Append a frozen, sourced 16-question supplement to unchanged v6.1."""
import hashlib
import json
import unicodedata
from collections import Counter
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
BASE_SHA = '233c03f9ae542404494f049a3a12886663706aabb6e616d8de44dc0503dab566'
def sha(data):
return hashlib.sha256(data).hexdigest()
def build():
base = ROOT / 'data/v6.1/test.jsonl'
assert sha(base.read_bytes()) == BASE_SHA
rows = [json.loads(s) for s in base.read_text().splitlines()]
extra = ROOT / 'source/v6.2-additions.jsonl'
source = [json.loads(s) for s in extra.read_text().splitlines()]
assert len(source) == 16
audit = []
for line, item in enumerate(source, 1):
question = unicodedata.normalize('NFC', item['question']).strip()
qid = 'aussieqa-' + sha(question.encode())[:20]
rows.append({'id': qid, 'question': question, 'answers': [item['answer']]})
audit.append({'id': qid, 'source_version': '6.2-additions', 'source_line': line,
'topic': item['topic'], 'difficulty_estimate': item['difficulty_estimate'],
'source_url': item['source_url'], 'author': 'OpenAI Codex assistant',
'authored_date': '2026-10-14', 'answer_source_checked_date': '2026-10-14',
'selection': 'Fixed before either evaluated model answered these additions; no performance-based item selection'})
assert len(rows) == len({r['id'] for r in rows}) == len({r['question'].casefold() for r in rows}) == 1000
for path, data in [('data/v6.2/test.jsonl', rows), ('metadata/v6.2/additions.jsonl', audit)]:
p = ROOT / path
p.parent.mkdir(parents=True, exist_ok=True)
p.write_text(''.join(json.dumps(r, ensure_ascii=False, separators=(',', ':'))+'\n' for r in data))
assert (ROOT/'data/v6.2/test.jsonl').read_bytes().startswith(base.read_bytes())
manifest = {'dataset': 'Aussie-1k', 'version': '6.2', 'release_date': '2026-10-14',
'base_version': '6.1', 'unchanged_base_questions': 984, 'new_questions': 16,
'test_records': 1000, 'reference_answers': sum(len(r['answers']) for r in rows),
'answer_count_distribution': dict(Counter(len(r['answers']) for r in rows)),
'addition_topic_counts': dict(Counter(r['topic'] for r in source)),
'addition_difficulty_estimates': dict(sorted(Counter(r['difficulty_estimate'] for r in source).items())),
'sampling_rationale': 'Near-even supplement across six existing coverage areas (3/3/3/3/2/2); no measured source topic proportions exist. Difficulty estimates 2/7/6/1 at levels 1/2/3/4 approximately match rounded source proportions. Estimates are editorial, not empirical.',
'duplicate_review': 'Exact and case-insensitive uniqueness checked; existing questions inspected for each new subject/entity. No claim of exhaustive semantic deduplication.',
'ordering': 'Unchanged v6.1 questions followed by 16 additions in frozen source order',
'files': {}}
for name in ['data/v6.1/test.jsonl','source/v6.2-additions.jsonl','data/v6.2/test.jsonl','metadata/v6.2/additions.jsonl']:
b=(ROOT/name).read_bytes();manifest['files'][name]={'sha256':sha(b),'bytes':len(b)}
(ROOT/'metadata/v6.2/manifest.json').write_text(json.dumps(manifest,indent=2)+'\n')
print(json.dumps(manifest,indent=2))
if __name__ == '__main__':
build()