File size: 969 Bytes
d6a0155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
AdaptaAI Migrant Onboarding Dataset — load examples
"""

# Option 1: Load via HuggingFace datasets library
# pip install datasets
from datasets import load_dataset

# Load the full Q&A dataset
dataset = load_dataset("adapta-ai/migrant-onboarding-qa", split="train")
print(f"Train size: {len(dataset)}")
print(dataset[0])

# Option 2: Manual JSONL read (no extra dependencies)
import json
from pathlib import Path

qa_path = Path("data/qa.jsonl")
with qa_path.open(encoding="utf-8") as f:
    records = [json.loads(line) for line in f if line.strip()]

print(f"Total Q&A records: {len(records)}")

# Filter by language
hindi_qs = [r for r in records if r["language"] in ("hi", "hi_roman")]
print(f"Hindi questions: {len(hindi_qs)}")

# Filter by category
docs_qs = [r for r in records if r["category"] == "documents"]
print(f"Documents category: {len(docs_qs)}")

# Show sample
print("\nSample record:")
print(json.dumps(records[0], ensure_ascii=False, indent=2))