| ---
|
| license: mit
|
| title: MitrAnlil Pilot3 |
| sdk: gradio
|
| emoji: 🏢
|
| colorFrom: yellow
|
| colorTo: yellow
|
| short_description: YOK Kanunlar için normatif AI asistanı
|
| sdk_version: 6.20.0
|
| ---
|
| # MitrAnlil MCKF v0.8 Multi-Document Corpus
|
|
|
| MitrAnlil, yükseköğretim mevzuatı için kaynak gösterimli normatif bilgi asistanıdır. Bu paket v0.7 pre-release mimarisini koruyarak 2547 tek belge yapısından üç belgeli MCKF corpus yapısına geçer.
|
|
|
| ## Indexed Documents
|
|
|
| - `TR-KANUN-2547` — 2547 sayılı Yükseköğretim Kanunu
|
| - `TR-KANUN-2914` — 2914 sayılı Yükseköğretim Personel Kanunu
|
| - `TR-KANUN-2809` — 2809 sayılı Yükseköğretim Kurumları Teşkilatı Kanunu
|
|
|
| Belge registry:
|
|
|
| ```text
|
| data/registry/legal_documents.json
|
| ```
|
|
|
| Runtime tek corpus kaynağını yükler:
|
|
|
| ```text
|
| data/mckf/corpus_mckf_ontology.json
|
| ```
|
|
|
| 2547 per-document çıktıları geriye dönük audit ve regresyon için korunur; legacy chunk/semantic-unit/canonical-concept dosyaları runtime’a geri sokulmamıştır.
|
|
|
| ## Build
|
|
|
| ```bash
|
| python tools/build_mckf_from_source.py --all
|
| python tools/build_mckf_from_source.py --document TR-KANUN-2914
|
| python tools/build_mckf_from_source.py --document TR-KANUN-2809
|
| ```
|
|
|
| No-arg legacy mode yalnız `TR-KANUN-2547` çıktısını yeniden üretir:
|
|
|
| ```bash
|
| python tools/build_mckf_from_source.py
|
| ```
|
|
|
| ## Runtime Flow
|
|
|
| ```text
|
| conversation_intent
|
| -> source_router
|
| -> corpus evidence retrieval with document/article scoring
|
| -> deterministic fallback or LLM synthesis from selected evidence only
|
| -> full article/source rendering
|
| -> feedback logging
|
| ```
|
|
|
| The source router scores candidate documents before retrieval. Returned candidates expose scoring details including source-router score, document-domain score, semantic-role score, norm-type score, lexical score, structure score, evidence-focus score, cross-document bonus, wrong-document penalty, and generic-article penalty.
|
|
|
| ## RDFox Pilot Layer
|
|
|
| Bu sürümde RDFox mimarisi MVP'ye harici RDFox servis bağımlılığı olmadan indirgenmiştir. `corpus_mckf_ontology.json` tek runtime kaynağı olarak kalır; RDFox uyumlu pilot katman bu kaynaktan üretilir:
|
|
|
| ```text
|
| data/mckf/rdfox_pilot_manifest.json
|
| data/mckf/rdfox_pilot_triples.nt
|
| data/mckf/rdfox_pilot_rules.dlog
|
| ```
|
|
|
| Pilot katman şu dar çekirdeği kapsar:
|
|
|
| - Document ingestion
|
| - Semantic Normative Unit parser
|
| - MCKF builder
|
| - Hybrid retrieval: semantic-role/dense-ready, BM25/lexical, concept-role
|
| - Evidence sufficiency gate
|
| - Source-locked generation
|
| - Citation renderer
|
|
|
| Runtime'da `rdfox_pilot.py` beş micro-rule sağlar: deadline priority, procedure chain, exception warning, cross-reference follow ve definition attach. Bu kurallar retrieval skor kırılımına `pilot_rule_score` ve `pilot_rule_hits` olarak yansır; RDFox/Datalog karşılığı `rdfox_pilot_rules.dlog` içinde tutulur.
|
|
|
| ## Verification
|
|
|
| Run from this package root:
|
|
|
| ```bash
|
| python -m compileall .
|
| python tools/build_mckf_from_source.py --all
|
| python tools/audit_mckf.py --all
|
| python tools/run_golden_checks.py
|
| python tools/run_multidoc_golden_checks.py
|
| python tools/runtime_health_check.py
|
| python tools/export_feedback_regression_candidates.py
|
| ```
|
|
|
| Local verification uses `..\.venv\Scripts\python.exe` when `python` is not on PATH.
|
|
|
| ## Known Limits
|
|
|
| - Local verification does not execute external Groq synthesis because `GROQ_API_KEY` is not present locally.
|
| - 2914 schedule sections are detected as separate `ScheduleUnit` source units and are retrievable; row-level table semantics are not yet normalized into typed cells.
|
| - The semantic role extractor remains heuristic.
|
| - The system is a source-grounded explanation assistant, not legal advice.
|
|
|