How digital-go-jp/lawqa_jp works
Project type and purpose
• This is not a traditional source‐code project but a structured dataset repository for multiple‐choice QA on Japanese law.
• The dataset supports tasks such as information retrieval, RAG pipelines, LLM fine-tuning, evaluation, and ground-truth curation.
File structure
• Top-level: LICENSE.md, README.md, and a single data/ directory.
• data/ contains:
• law_list.json – list of statutes referenced in questions
• selection.json – original Q&A JSON
• selection.csv – tabular CSV export
• selection_randomized.json – randomized‐option variants
• selection_with_reference_randomized.json – filtered + randomized for reference‐heavy items
• No code, build scripts, or deployment descriptors are present; this is a pure data asset.
README for additional insights
• Describes intended use cases (QA system training/evaluation, RAG pipeline tests, LLM aggregation).
• Documents file formats, fields, and markdown conventions for headings and external legal references.
Main components
a. Data Storage Layer
• Raw files in data/ (JSON, CSV) housed in a versioned data‐repository (e.g., Git/LFS or object storage).
b. Preprocessing Module
• Scripts or services that load selection.json ➔ validate schema ➔ produce CSV or randomized JSON variants.
c. Knowledge Base Index
• law_list.json feeds into a search index (Elasticsearch, vector DB) for RAG or retrieval tasks.
d. Inference & Evaluation Layer
• External LLM APIs (e.g., OpenAI, local LLM) receive context + question ➔ generate candidate answers.
• Evaluation service compares outputs against ‘output’ field in the dataset.
e. Aggregation & Curation Service
• Aggregates multiple LLM responses, applies heuristics to build ground truth or vote-based labels.
f. Frontend/UI (optional)
• A dashboard for exploring questions, reviewing references, sampling randomized sets.
Relationships & interactions
• Data Repository ➔ Preprocessing ➔ outputs variants stored back.
• Preprocessing + law_list.json ➔ index builder ➔ Search/Vector DB.
• Inference Layer pulls questions + context from data store and hits Search/Vector DB for retrieval‐augmented context.
• LLM API calls return responses to Evaluation Layer.
• Evaluation results feed into Curation Service and analytics dashboards.
Architectural patterns & design principles
• Pipeline pattern: clear stages (ingest → preprocess → index → infer → evaluate → curate).
• Separation of concerns:
• Data at rest vs. data in motion
• Storage vs. compute vs. external services
• Extensibility: plug in new LLMs, swap vector DBs, add new data variants.
Relevant technologies (examples)
• Object storage/Git LFS for dataset
• Python or Node.js preprocessing scripts
• Elasticsearch, FAISS, or Pinecone for RAG index
• External LLM services (OpenAI, Cohere)
• Evaluation via PyTest or custom metrics modules
• Web dashboard: React or Streamlit
Final advice
• Be meticulous in labeling every field or artifact that participates in the pipeline.
• Dataset variants as separate nodes if they serve different use cases.