Adding Paraphrasing Option to Question Wording
Browse files
README.md
CHANGED
|
@@ -8,6 +8,9 @@ app_file: index.html
|
|
| 8 |
pinned: false
|
| 9 |
license: apache-2.0
|
| 10 |
short_description: Navigate Kinship and MQuAKE-ST graphs step by step
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
# KG Navigation Challenge · THESEUS
|
|
@@ -17,17 +20,22 @@ A **manual knowledge graph navigation challenge** in a free Hugging Face Static
|
|
| 17 |
## How to play
|
| 18 |
|
| 19 |
1. Choose **Kinship**, **MQuAKE-ST Single Answer**, or **MQuAKE-ST Multi Answer**.
|
| 20 |
-
2. Choose which released question split to sample from (Test by default)
|
|
|
|
|
|
|
|
|
|
| 21 |
3. Download the dataset's original directed knowledge graph when prompted. For MQuAKE-ST, this can be a **large download**. The graph is parsed in a Web Worker and stays in memory during the browser session. The two MQuAKE-ST modes reuse the same graph.
|
| 22 |
4. Read the question and starting entity. **The annotated hop count, answer(s), path, and relation chain are hidden during navigation.**
|
| 23 |
5. Expand a relation available from the current node, then select one of its target entities. Continue for as many steps as needed, up to a safety limit of 12. You can undo/restart your route at any time.
|
| 24 |
6. Press **Submit answer** whenever you believe the current entity answers the question, or **Reveal / give up**.
|
| 25 |
|
|
|
|
|
|
|
| 26 |
After submitting, the Space checks whether your terminal entity matches a released answer. When a reference path or relation chain exists, it reports whether your full chosen path agrees with the annotation. A correct endpoint along another valid route is still recorded as answer-correct. For Multi Answer, any released answer is accepted, while the annotated `Path-Key` is treated as a relation-chain reference, not as one known entity-level path.
|
| 27 |
|
| 28 |
## Data and implementation
|
| 29 |
|
| 30 |
-
- Questions: the [Hugging Face Dataset Viewer API](https://huggingface.co/docs/dataset-viewer/en/quick_start) from `HalcyonSolutions/Kinship` and `HalcyonSolutions/MQuAKE-ST`.
|
| 31 |
- Directed KG, loaded in the browser from the **published dataset files**:
|
| 32 |
- Kinship: `kg/orig/triplets.txt`
|
| 33 |
- MQuAKE-ST (both answer settings): `kg/triplets.txt`
|
|
@@ -44,7 +52,7 @@ After submitting, the Space checks whether your terminal entity matches a releas
|
|
| 44 |
|
| 45 |
- MQuAKE-ST is large (hundreds of thousands of graph triples). This **static** version downloads and indexes the full graph client-side **once per browser session** before navigation. On mobile or a limited connection, this may be slow or use substantial memory. Progress is displayed when browser/network permits. A future optional precomputed adjacency-shard index would reduce startup cost.
|
| 46 |
- An action list can be large. Relations are grouped, searchable, and target entities are paginated.
|
| 47 |
-
- Questions are drawn randomly from the selected mixed-hop QA collection. Hop counts are not exposed, and the chosen split can be changed. Some sampling methods can have provider constraints/rate limits.
|
| 48 |
- Ground-truth path agreement is based on **released annotations**, which are reference evidence, not exhaustive proof that an alternate trajectory is invalid.
|
| 49 |
- The dataset is public, so a user can inspect the source independently. This is an educational exercise, not a secure blinded benchmark.
|
| 50 |
|
|
@@ -73,3 +81,9 @@ Run `python -m http.server 8000` from this directory and open http://localhost:8
|
|
| 73 |
- [THESEUS](https://github.com/HalcyonSolutions/THESEUS)
|
| 74 |
|
| 75 |
The source datasets have their own terms and attribution requirements. Refer to their dataset cards when reusing data.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
pinned: false
|
| 9 |
license: apache-2.0
|
| 10 |
short_description: Navigate Kinship and MQuAKE-ST graphs step by step
|
| 11 |
+
datasets:
|
| 12 |
+
- HalcyonSolutions/Kinship
|
| 13 |
+
- HalcyonSolutions/MQuAKE-ST
|
| 14 |
---
|
| 15 |
|
| 16 |
# KG Navigation Challenge · THESEUS
|
|
|
|
| 20 |
## How to play
|
| 21 |
|
| 22 |
1. Choose **Kinship**, **MQuAKE-ST Single Answer**, or **MQuAKE-ST Multi Answer**.
|
| 23 |
+
2. Choose which released question split to sample from (Test by default), and a **Question wording** mode:
|
| 24 |
+
- **Canonical question** (default): use the released `Question` column.
|
| 25 |
+
- **Random paraphrase · harder**: sample a different wording from the released `Question-Paraphrased` list. Entries identical to the canonical question are excluded, so the alternative mode is genuinely different when available. A question with no alternative is skipped.
|
| 26 |
+
Press **Get random question**.
|
| 27 |
3. Download the dataset's original directed knowledge graph when prompted. For MQuAKE-ST, this can be a **large download**. The graph is parsed in a Web Worker and stays in memory during the browser session. The two MQuAKE-ST modes reuse the same graph.
|
| 28 |
4. Read the question and starting entity. **The annotated hop count, answer(s), path, and relation chain are hidden during navigation.**
|
| 29 |
5. Expand a relation available from the current node, then select one of its target entities. Continue for as many steps as needed, up to a safety limit of 12. You can undo/restart your route at any time.
|
| 30 |
6. Press **Submit answer** whenever you believe the current entity answers the question, or **Reveal / give up**.
|
| 31 |
|
| 32 |
+
The chosen wording is fixed throughout the attempt, including undo, restart, and retry. If you played using a paraphrase, the canonical question becomes visible with the reference evidence after submission.
|
| 33 |
+
|
| 34 |
After submitting, the Space checks whether your terminal entity matches a released answer. When a reference path or relation chain exists, it reports whether your full chosen path agrees with the annotation. A correct endpoint along another valid route is still recorded as answer-correct. For Multi Answer, any released answer is accepted, while the annotated `Path-Key` is treated as a relation-chain reference, not as one known entity-level path.
|
| 35 |
|
| 36 |
## Data and implementation
|
| 37 |
|
| 38 |
+
- Questions and paraphrases: the [Hugging Face Dataset Viewer API](https://huggingface.co/docs/dataset-viewer/en/quick_start) from `HalcyonSolutions/Kinship` and `HalcyonSolutions/MQuAKE-ST`.
|
| 39 |
- Directed KG, loaded in the browser from the **published dataset files**:
|
| 40 |
- Kinship: `kg/orig/triplets.txt`
|
| 41 |
- MQuAKE-ST (both answer settings): `kg/triplets.txt`
|
|
|
|
| 52 |
|
| 53 |
- MQuAKE-ST is large (hundreds of thousands of graph triples). This **static** version downloads and indexes the full graph client-side **once per browser session** before navigation. On mobile or a limited connection, this may be slow or use substantial memory. Progress is displayed when browser/network permits. A future optional precomputed adjacency-shard index would reduce startup cost.
|
| 54 |
- An action list can be large. Relations are grouped, searchable, and target entities are paginated.
|
| 55 |
+
- Questions are drawn randomly from the selected mixed-hop QA collection. Random paraphrases come directly from the `Question-Paraphrased` list, not machine-generated text. Hop counts are not exposed, and the chosen split can be changed. Some sampling methods can have provider constraints/rate limits.
|
| 56 |
- Ground-truth path agreement is based on **released annotations**, which are reference evidence, not exhaustive proof that an alternate trajectory is invalid.
|
| 57 |
- The dataset is public, so a user can inspect the source independently. This is an educational exercise, not a secure blinded benchmark.
|
| 58 |
|
|
|
|
| 81 |
- [THESEUS](https://github.com/HalcyonSolutions/THESEUS)
|
| 82 |
|
| 83 |
The source datasets have their own terms and attribution requirements. Refer to their dataset cards when reusing data.
|
| 84 |
+
|
| 85 |
+
## Question wording selection (v3)
|
| 86 |
+
|
| 87 |
+
Changing **Question wording** now immediately changes the displayed wording of the active question. You do not need to start a new challenge. The same question record, topic entity, answer set and navigation route are retained. In paraphrase mode, a randomly selected alternative is chosen from `Question-Paraphrased`, excluding the canonical wording and punctuation-only duplicates. A visible indicator confirms the selected alternative. If the active record contains no distinct paraphrases, the page retains the previous wording and explains why.
|
| 88 |
+
|
| 89 |
+
If you upload an updated `app.js`, also replace `index.html` because its versioned script link prevents stale browser caching.
|
app.js
CHANGED
|
@@ -10,7 +10,7 @@ const DATA={
|
|
| 10 |
const API='https://datasets-server.huggingface.co';
|
| 11 |
const MAX_STEPS=12;
|
| 12 |
const PAGE_SIZE=40;
|
| 13 |
-
const state={dataset:'kinship',question:null,source:'',current:'',route:[],finished:false,activeRel:null,neighborOffset:0,relationItems:[],neighborCount:0,task:0,split:'test',workerReq:0,pending:new Map(),graphReady:new Set(),loadingGraph:null,nodeLabels:new Map(),relationLabels:new Map(),metaReady:false};
|
| 14 |
const worker=new Worker('graph-worker.js');
|
| 15 |
const text=(el,val)=>{el.textContent=val==null?'':String(val);return el;};
|
| 16 |
const el=(tag,cls,content)=>{let n=document.createElement(tag);if(cls)n.className=cls;if(content!==undefined)text(n,content);return n;};
|
|
@@ -37,6 +37,50 @@ function asList(input){
|
|
| 37 |
const token=/^(None|True|False|-?\d+(?:\.\d+)?)/.exec(s.slice(i));if(!token)throw Error('Unrecognized literal');i+=token[0].length;return token[0]==='None'?null:token[0]==='True'?true:token[0]==='False'?false:Number(token[0]);}
|
| 38 |
try{const out=parse(0);ws();return i===s.length&&Array.isArray(out)?out:[];}catch(_){return [];}
|
| 39 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
function referencePaths(row){const p=asList(row.Paths);if(!p.length)return[];if(Array.isArray(p[0])&&p[0].length===3&&!Array.isArray(p[0][0]))return [p];if(Array.isArray(p[0])&&Array.isArray(p[0][0]))return p.filter(path=>Array.isArray(path)&&path.every(step=>Array.isArray(step)&&step.length===3));return[];}
|
| 41 |
function answers(row){const item=row['Answer-Entity'];return Array.isArray(item)?item.map(String):typeof item==='string'&&item.trim().startsWith('[')?asList(item).map(String):item!=null?[String(item).trim()]:[];}
|
| 42 |
function chainCandidates(row){
|
|
@@ -56,9 +100,9 @@ function chainCandidates(row){
|
|
| 56 |
}
|
| 57 |
function sampleSplit(row,desired){return desired==='all'||String(row.SplitLabel||'').trim().toLowerCase()===desired;}
|
| 58 |
async function configsFor(d){const data=await fetchJson(paramUrl('splits',{dataset:d.dataset}));if(!data.splits?.length)throw Error('Dataset Viewer returned no QA configurations');const named=data.splits.find(x=>x.config===d.config);if(named)return {config:named.config,split:named.split};const fallback=data.splits.find(x=>x.config?.toLowerCase()===d.config.toLowerCase());if(fallback)return {config:fallback.config,split:fallback.split};throw Error(`The ${d.config} configuration is not available from the Dataset Viewer.`);}
|
| 59 |
-
async function randomQuestion(d,split){
|
| 60 |
const config=await configsFor(d);const base={dataset:d.dataset,config:config.config,split:config.split};
|
| 61 |
-
const isValid=r=>r&&r.Question&&r['Source-Entity']&&answers(r).length>0&&sampleSplit(r,split);
|
| 62 |
if(split!=='all'){
|
| 63 |
try{
|
| 64 |
const where=`"SplitLabel"='${split}'`;
|
|
@@ -82,7 +126,7 @@ async function randomQuestion(d,split){
|
|
| 82 |
const candidates=(rows.rows||[]).map(x=>x.row).filter(isValid);
|
| 83 |
if(candidates.length)return candidates[Math.floor(Math.random()*candidates.length)];
|
| 84 |
}
|
| 85 |
-
throw Error(`No valid ${split} question found after sampling. Try “Any split” or another partition.`);
|
| 86 |
}
|
| 87 |
function parseCsv(str){let all=[],line=[],field='',q=false;for(let i=0;i<str.length;i++){const c=str[i];if(c==='"'){if(q&&str[i+1]==='"'){field+='"';i++;}else q=!q;}else if(c===','&&!q){line.push(field);field='';}else if((c==='\n'||c==='\r')&&!q){if(c==='\r'&&str[i+1]==='\n')i++;line.push(field);all.push(line);field='';line=[];}else field+=c;}if(field||line.length){line.push(field);all.push(line);}return all;}
|
| 88 |
async function fetchMetadata(){
|
|
@@ -97,18 +141,19 @@ worker.onmessage=(event)=>{
|
|
| 97 |
if(msg.type==='error')job.reject(Error(msg.message));else job.resolve(msg);
|
| 98 |
};
|
| 99 |
function askWorker(message,progress){return new Promise((resolve,reject)=>{const id=++state.workerReq;state.pending.set(id,{resolve,reject,progress});worker.postMessage({...message,id});});}
|
| 100 |
-
function toggleBusy(busy){$('new-question').disabled=busy;document.querySelectorAll('input[name=dataset],#split').forEach(e=>e.disabled=busy);}
|
| 101 |
async function launch(){
|
| 102 |
const myTask=++state.task;
|
| 103 |
const selected=document.querySelector('input[name=dataset]:checked').value;
|
| 104 |
-
state.dataset=selected;state.split=$('split').value;state.question=null;state.finished=false;state.route=[];state.activeRel=null;
|
| 105 |
$('play').classList.add('hidden');toggleBusy(true);status('Finding a random question from the published dataset…');
|
| 106 |
try{
|
| 107 |
-
const row=await randomQuestion(dataset(),state.split);
|
| 108 |
if(myTask!==state.task)return;
|
| 109 |
state.question=row;state.source=String(row['Source-Entity']).trim();state.current=state.source;
|
|
|
|
| 110 |
text($('dataset-chip'),dataset().title);text($('split-chip'),state.split==='all'?'Any split':`${state.split[0].toUpperCase()}${state.split.slice(1)} partition`);
|
| 111 |
-
|
| 112 |
$('play').classList.remove('hidden');$('result').classList.add('hidden');$('game-content').classList.add('hidden');
|
| 113 |
$('graph-prompt').classList.remove('hidden');
|
| 114 |
text($('graph-help'),state.dataset==='kinship'?'Kinship has a small directed graph. It loads quickly from the published dataset.':'MQuAKE-ST uses a large directed graph. The first download can take time and browser memory, especially on mobile. The two MQuAKE modes share this graph.');
|
|
@@ -235,7 +280,7 @@ function showResult(giveUp){
|
|
| 235 |
const target=$('result-answers');target.replaceChildren();gold.forEach((v,i)=>{if(i)target.append(el('span','',', '));named(target,'entity',v);});
|
| 236 |
const assess=$('path-assessment');text(assess,(!giveUp&&fidelity.possible)?fidelity.matched?`✓ Your route matches an annotated ${fidelity.kind}.`:`Your route does not exactly match the released ${fidelity.kind}. That does not prove your path is invalid.`:fidelity.possible?`Released ${fidelity.kind} available below. No attempt was scored.`:'No reference path or relation chain is available for this question.');
|
| 237 |
const detail=$('reference-content');detail.replaceChildren();
|
| 238 |
-
const p=el('p','',`Annotated hop count: ${row.Hops??'not provided'}. You took ${state.route.length} step${state.route.length===1?'':'s'}.`);detail.append(p);
|
| 239 |
const paths=referencePaths(row),chains=chainCandidates(row);
|
| 240 |
if(paths.length){for(const [i,path] of paths.slice(0,5).entries()){const item=el('p','',`Reference ${i+1}: `);for(let j=0;j<path.length;j++){if(j===0)named(item,'entity',String(path[j][0]));append(item,el('span','',` —[${labelRelation(String(path[j][1]))}]→ `));named(item,'entity',String(path[j][2]));}detail.append(item);}}
|
| 241 |
else if(chains.length){for(const [i,chain]of chains.slice(0,5).entries()){let item=el('p','',`Annotated relation chain ${i+1}: `);chain.forEach((r,j)=>{if(j)item.append(el('span','',` → `));named(item,'relation',String(r));});detail.append(item);}if(state.dataset==='ma')detail.append(el('p','',`Multi Answer does not provide a single entity-level reference path. These are released relation-chain annotations.`));}
|
|
@@ -244,6 +289,12 @@ function showResult(giveUp){
|
|
| 244 |
$('result').scrollIntoView({block:'start',behavior:'smooth'});
|
| 245 |
}
|
| 246 |
async function retry(){state.finished=false;state.route=[];state.current=state.source;state.activeRel=null;$('result').classList.add('hidden');$('game-content').classList.remove('hidden');renderState();await showRelations();$('play').scrollIntoView({block:'start',behavior:'smooth'});}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 247 |
$('new-question').addEventListener('click',launch);
|
| 248 |
$('load-graph').addEventListener('click',loadGraph);
|
| 249 |
$('undo').addEventListener('click',undo);$('restart').addEventListener('click',restart);
|
|
|
|
| 10 |
const API='https://datasets-server.huggingface.co';
|
| 11 |
const MAX_STEPS=12;
|
| 12 |
const PAGE_SIZE=40;
|
| 13 |
+
const state={dataset:'kinship',question:null,source:'',current:'',route:[],finished:false,activeRel:null,neighborOffset:0,relationItems:[],neighborCount:0,task:0,split:'test',wording:'canonical',questionWording:'',workerReq:0,pending:new Map(),graphReady:new Set(),loadingGraph:null,nodeLabels:new Map(),relationLabels:new Map(),metaReady:false};
|
| 14 |
const worker=new Worker('graph-worker.js');
|
| 15 |
const text=(el,val)=>{el.textContent=val==null?'':String(val);return el;};
|
| 16 |
const el=(tag,cls,content)=>{let n=document.createElement(tag);if(cls)n.className=cls;if(content!==undefined)text(n,content);return n;};
|
|
|
|
| 37 |
const token=/^(None|True|False|-?\d+(?:\.\d+)?)/.exec(s.slice(i));if(!token)throw Error('Unrecognized literal');i+=token[0].length;return token[0]==='None'?null:token[0]==='True'?true:token[0]==='False'?false:Number(token[0]);}
|
| 38 |
try{const out=parse(0);ws();return i===s.length&&Array.isArray(out)?out:[];}catch(_){return [];}
|
| 39 |
}
|
| 40 |
+
/** Released Question-Paraphrased values are serialized Python-list literals (or arrays). */
|
| 41 |
+
function normalizedWording(value){
|
| 42 |
+
return String(value??'').normalize('NFKC').toLocaleLowerCase()
|
| 43 |
+
.replace(/[\p{P}\p{S}]+/gu,' ').replace(/\s+/g,' ').trim();
|
| 44 |
+
}
|
| 45 |
+
function alternateWordings(row){
|
| 46 |
+
const canonical=String(row?.Question??'').trim();
|
| 47 |
+
const raw=row?.['Question-Paraphrased'];
|
| 48 |
+
const variants=Array.isArray(raw)?raw:asList(raw);
|
| 49 |
+
// Favor genuinely different phrasing. Some released lists include the canonical string.
|
| 50 |
+
const seen=new Set([normalizedWording(canonical)]);
|
| 51 |
+
return variants.filter(v=>typeof v==='string').map(v=>v.trim()).filter(v=>{
|
| 52 |
+
const key=normalizedWording(v);if(!key||seen.has(key))return false;seen.add(key);return true;
|
| 53 |
+
});
|
| 54 |
+
}
|
| 55 |
+
function questionWording(row,mode){
|
| 56 |
+
if(mode!=='paraphrase')return String(row.Question).trim();
|
| 57 |
+
const variants=alternateWordings(row);
|
| 58 |
+
if(!variants.length)throw Error('No alternative paraphrased wording is available for this question.');
|
| 59 |
+
return variants[Math.floor(Math.random()*variants.length)];
|
| 60 |
+
}
|
| 61 |
+
/** Update the currently displayed question when the wording selector changes.
|
| 62 |
+
Keep the same QA record, start entity, answers, graph, and navigation route. */
|
| 63 |
+
function applyWording(mode,notify=false){
|
| 64 |
+
if(!state.question)return false;
|
| 65 |
+
let shown;
|
| 66 |
+
try{shown=questionWording(state.question,mode);}
|
| 67 |
+
catch(err){
|
| 68 |
+
if(notify)status('This question has no distinct paraphrase. Try Get random question to sample another.',true);
|
| 69 |
+
return false;
|
| 70 |
+
}
|
| 71 |
+
state.wording=mode;
|
| 72 |
+
state.questionWording=shown;
|
| 73 |
+
text($('question-text'),shown);
|
| 74 |
+
text($('wording-chip'),mode==='paraphrase'?'Random paraphrase':'Canonical');
|
| 75 |
+
if(mode==='paraphrase'){
|
| 76 |
+
const candidates=alternateWordings(state.question);
|
| 77 |
+
text($('wording-note'),`Paraphrase ${candidates.indexOf(shown)+1} of ${candidates.length} distinct alternative(s) · from Question-Paraphrased. The original wording appears after submission.`);
|
| 78 |
+
}else{
|
| 79 |
+
text($('wording-note'),'Original wording from the released Question column.');
|
| 80 |
+
}
|
| 81 |
+
if(notify)status(mode==='paraphrase'?'Showing a distinct paraphrased version of this question.':'Showing the original canonical question.');
|
| 82 |
+
return true;
|
| 83 |
+
}
|
| 84 |
function referencePaths(row){const p=asList(row.Paths);if(!p.length)return[];if(Array.isArray(p[0])&&p[0].length===3&&!Array.isArray(p[0][0]))return [p];if(Array.isArray(p[0])&&Array.isArray(p[0][0]))return p.filter(path=>Array.isArray(path)&&path.every(step=>Array.isArray(step)&&step.length===3));return[];}
|
| 85 |
function answers(row){const item=row['Answer-Entity'];return Array.isArray(item)?item.map(String):typeof item==='string'&&item.trim().startsWith('[')?asList(item).map(String):item!=null?[String(item).trim()]:[];}
|
| 86 |
function chainCandidates(row){
|
|
|
|
| 100 |
}
|
| 101 |
function sampleSplit(row,desired){return desired==='all'||String(row.SplitLabel||'').trim().toLowerCase()===desired;}
|
| 102 |
async function configsFor(d){const data=await fetchJson(paramUrl('splits',{dataset:d.dataset}));if(!data.splits?.length)throw Error('Dataset Viewer returned no QA configurations');const named=data.splits.find(x=>x.config===d.config);if(named)return {config:named.config,split:named.split};const fallback=data.splits.find(x=>x.config?.toLowerCase()===d.config.toLowerCase());if(fallback)return {config:fallback.config,split:fallback.split};throw Error(`The ${d.config} configuration is not available from the Dataset Viewer.`);}
|
| 103 |
+
async function randomQuestion(d,split,wording='canonical'){
|
| 104 |
const config=await configsFor(d);const base={dataset:d.dataset,config:config.config,split:config.split};
|
| 105 |
+
const isValid=r=>r&&r.Question&&r['Source-Entity']&&answers(r).length>0&&sampleSplit(r,split)&&(wording!=='paraphrase'||alternateWordings(r).length>0);
|
| 106 |
if(split!=='all'){
|
| 107 |
try{
|
| 108 |
const where=`"SplitLabel"='${split}'`;
|
|
|
|
| 126 |
const candidates=(rows.rows||[]).map(x=>x.row).filter(isValid);
|
| 127 |
if(candidates.length)return candidates[Math.floor(Math.random()*candidates.length)];
|
| 128 |
}
|
| 129 |
+
throw Error(`No valid ${split} ${wording==='paraphrase'?'paraphrased ':''}question found after sampling. Try “Any split” or another partition.`);
|
| 130 |
}
|
| 131 |
function parseCsv(str){let all=[],line=[],field='',q=false;for(let i=0;i<str.length;i++){const c=str[i];if(c==='"'){if(q&&str[i+1]==='"'){field+='"';i++;}else q=!q;}else if(c===','&&!q){line.push(field);field='';}else if((c==='\n'||c==='\r')&&!q){if(c==='\r'&&str[i+1]==='\n')i++;line.push(field);all.push(line);field='';line=[];}else field+=c;}if(field||line.length){line.push(field);all.push(line);}return all;}
|
| 132 |
async function fetchMetadata(){
|
|
|
|
| 141 |
if(msg.type==='error')job.reject(Error(msg.message));else job.resolve(msg);
|
| 142 |
};
|
| 143 |
function askWorker(message,progress){return new Promise((resolve,reject)=>{const id=++state.workerReq;state.pending.set(id,{resolve,reject,progress});worker.postMessage({...message,id});});}
|
| 144 |
+
function toggleBusy(busy){$('new-question').disabled=busy;document.querySelectorAll('input[name=dataset],#split,#wording').forEach(e=>e.disabled=busy);}
|
| 145 |
async function launch(){
|
| 146 |
const myTask=++state.task;
|
| 147 |
const selected=document.querySelector('input[name=dataset]:checked').value;
|
| 148 |
+
state.dataset=selected;state.split=$('split').value;state.wording=$('wording').value;state.question=null;state.questionWording='';state.finished=false;state.route=[];state.activeRel=null;
|
| 149 |
$('play').classList.add('hidden');toggleBusy(true);status('Finding a random question from the published dataset…');
|
| 150 |
try{
|
| 151 |
+
const row=await randomQuestion(dataset(),state.split,state.wording);
|
| 152 |
if(myTask!==state.task)return;
|
| 153 |
state.question=row;state.source=String(row['Source-Entity']).trim();state.current=state.source;
|
| 154 |
+
if(!applyWording(state.wording))throw Error('Selected question has no alternative paraphrase.');
|
| 155 |
text($('dataset-chip'),dataset().title);text($('split-chip'),state.split==='all'?'Any split':`${state.split[0].toUpperCase()}${state.split.slice(1)} partition`);
|
| 156 |
+
renderNamedOnly($('question-source'),'entity',state.source);
|
| 157 |
$('play').classList.remove('hidden');$('result').classList.add('hidden');$('game-content').classList.add('hidden');
|
| 158 |
$('graph-prompt').classList.remove('hidden');
|
| 159 |
text($('graph-help'),state.dataset==='kinship'?'Kinship has a small directed graph. It loads quickly from the published dataset.':'MQuAKE-ST uses a large directed graph. The first download can take time and browser memory, especially on mobile. The two MQuAKE modes share this graph.');
|
|
|
|
| 280 |
const target=$('result-answers');target.replaceChildren();gold.forEach((v,i)=>{if(i)target.append(el('span','',', '));named(target,'entity',v);});
|
| 281 |
const assess=$('path-assessment');text(assess,(!giveUp&&fidelity.possible)?fidelity.matched?`✓ Your route matches an annotated ${fidelity.kind}.`:`Your route does not exactly match the released ${fidelity.kind}. That does not prove your path is invalid.`:fidelity.possible?`Released ${fidelity.kind} available below. No attempt was scored.`:'No reference path or relation chain is available for this question.');
|
| 282 |
const detail=$('reference-content');detail.replaceChildren();
|
| 283 |
+
const p=el('p','',`Annotated hop count: ${row.Hops??'not provided'}. You took ${state.route.length} step${state.route.length===1?'':'s'}.`);detail.append(p);if(state.wording==='paraphrase')detail.append(el('p','',`Canonical question: ${row.Question}`));
|
| 284 |
const paths=referencePaths(row),chains=chainCandidates(row);
|
| 285 |
if(paths.length){for(const [i,path] of paths.slice(0,5).entries()){const item=el('p','',`Reference ${i+1}: `);for(let j=0;j<path.length;j++){if(j===0)named(item,'entity',String(path[j][0]));append(item,el('span','',` —[${labelRelation(String(path[j][1]))}]→ `));named(item,'entity',String(path[j][2]));}detail.append(item);}}
|
| 286 |
else if(chains.length){for(const [i,chain]of chains.slice(0,5).entries()){let item=el('p','',`Annotated relation chain ${i+1}: `);chain.forEach((r,j)=>{if(j)item.append(el('span','',` → `));named(item,'relation',String(r));});detail.append(item);}if(state.dataset==='ma')detail.append(el('p','',`Multi Answer does not provide a single entity-level reference path. These are released relation-chain annotations.`));}
|
|
|
|
| 289 |
$('result').scrollIntoView({block:'start',behavior:'smooth'});
|
| 290 |
}
|
| 291 |
async function retry(){state.finished=false;state.route=[];state.current=state.source;state.activeRel=null;$('result').classList.add('hidden');$('game-content').classList.remove('hidden');renderState();await showRelations();$('play').scrollIntoView({block:'start',behavior:'smooth'});}
|
| 292 |
+
$('wording').addEventListener('change',()=>{
|
| 293 |
+
// A selection made before loading a challenge is applied by launch().
|
| 294 |
+
if(!state.question)return;
|
| 295 |
+
const prior=state.wording;
|
| 296 |
+
if(!applyWording($('wording').value,true))$('wording').value=prior;
|
| 297 |
+
});
|
| 298 |
$('new-question').addEventListener('click',launch);
|
| 299 |
$('load-graph').addEventListener('click',loadGraph);
|
| 300 |
$('undo').addEventListener('click',undo);$('restart').addEventListener('click',restart);
|
index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
<meta name="description" content="Try knowledge graph question answering yourself. Follow relation–entity edges on Kinship and MQuAKE-ST without being told the number of hops.">
|
| 8 |
<title>KG Navigation Challenge · THESEUS</title>
|
| 9 |
<link rel="stylesheet" href="style.css">
|
| 10 |
-
<script src="app.js" defer></script>
|
| 11 |
</head>
|
| 12 |
<body>
|
| 13 |
<header class="topbar"><div class="wrap nav-wrap">
|
|
@@ -28,13 +28,15 @@
|
|
| 28 |
<label class="dataset-card"><input type="radio" name="dataset" value="sa"><span class="tag">WIKIDATA KG</span><strong>MQuAKE-ST</strong><span>Single Answer · Wikidata</span></label>
|
| 29 |
<label class="dataset-card"><input type="radio" name="dataset" value="ma"><span class="tag">MULTIPLE VALID ANSWERS</span><strong>MQuAKE-ST</strong><span>Multi Answer · Wikidata</span></label>
|
| 30 |
</fieldset>
|
| 31 |
-
<div class="setup-bottom"><
|
| 32 |
-
<
|
|
|
|
|
|
|
| 33 |
<p id="setup-status" class="status" role="status" aria-live="polite">Choose a dataset, then start a challenge.</p>
|
| 34 |
</section>
|
| 35 |
<section class="panel play hidden" id="play" aria-labelledby="play-heading">
|
| 36 |
-
<div class="section-head play-head"><div><div class="kicker">02 / NAVIGATE</div><h2 id="play-heading">Your challenge</h2></div><div class="play-meta"><span class="chip" id="dataset-chip">Kinship</span><span class="chip" id="split-chip">Test partition</span><span class="chip" id="steps-chip">0 steps taken</span></div></div>
|
| 37 |
-
<div class="question-box"><span class="small muted">QUESTION</span><p id="question-text"></p><div class="start-note">Starting entity: <b id="question-source"></b></div></div>
|
| 38 |
<div class="download-box" id="graph-prompt"><div class="download-icon" aria-hidden="true">⇩</div><div class="download-copy"><strong>Prepare the navigation graph</strong><p id="graph-help">Loading a public directed graph into your browser enables edge-by-edge choices.</p></div><button id="load-graph" class="btn primary" type="button">Load graph</button></div>
|
| 39 |
<div id="game-content" class="hidden">
|
| 40 |
<div class="statebar"><div><span class="small muted">CURRENT ENTITY</span><div id="current-entity" class="current-entity"></div></div><div class="statebar-actions"><button class="btn secondary" id="undo" type="button">↶ Undo</button><button class="btn secondary" id="restart" type="button">Restart</button></div></div>
|
|
@@ -45,7 +47,7 @@
|
|
| 45 |
</div>
|
| 46 |
<div id="result" class="result hidden" aria-live="polite"><div class="result-top"><div><div class="kicker">03 / RESULTS</div><h3 id="result-heading"></h3></div><span id="answer-badge" class="result-badge"></span></div><p id="result-description"></p><div class="result-grid"><div><span class="small muted">YOUR TERMINAL ENTITY</span><div id="result-terminal" class="result-value"></div></div><div><span class="small muted">RELEASED ANSWER(S)</span><div id="result-answers" class="result-value"></div></div></div><div id="path-assessment" class="path-assessment"></div><details class="reference-details"><summary>Show released reference evidence and hop count</summary><div id="reference-content"></div></details><div class="result-footer"><button id="retry" class="btn secondary" type="button">Try again</button><button id="another" class="btn primary" type="button">Next random question →</button></div></div>
|
| 47 |
</section>
|
| 48 |
-
<section class="info-grid" id="instructions"><div class="info-card"><div class="kicker">HOW TO PLAY</div><h2>You are the navigator</h2><p>This challenge tests human navigation through a knowledge graph, not pretrained MINERVA. At each step, pick a relation and one of the entity neighbors reachable along that edge. Submit when you think the current node answers the question.</p><p>There is no required number of steps displayed. A 12-step safety limit prevents endless wandering.</p></div><div class="info-card"><div class="kicker">ABOUT THE DATA</div><h2>Real edges. Hidden references.</h2><p>The source graph is loaded directly from the published Hugging Face dataset. Kinship uses native names, while MQuAKE-ST displays Wikidata item and property labels when metadata is available.</p><p><strong>Note:</strong> MQuAKE-ST has a large graph. The first load may take time and memory, especially on mobile. Multi Answer and Single Answer share the same graph, which is reused while this page stays open.</p></div></section>
|
| 49 |
</main>
|
| 50 |
<footer class="footer"><div class="wrap footer-flex"><span>THESEUS · Question-conditioned KG navigation</span><div><a href="https://huggingface.co/spaces/muttsurini/Kinship-Quickstart" target="_blank" rel="noopener noreferrer">Kinship quickstart ↗</a><a href="https://huggingface.co/spaces/muttsurini/MQuAKE-ST-Quickstart" target="_blank" rel="noopener noreferrer">MQuAKE-ST quickstart ↗</a></div></div></footer>
|
| 51 |
</body>
|
|
|
|
| 7 |
<meta name="description" content="Try knowledge graph question answering yourself. Follow relation–entity edges on Kinship and MQuAKE-ST without being told the number of hops.">
|
| 8 |
<title>KG Navigation Challenge · THESEUS</title>
|
| 9 |
<link rel="stylesheet" href="style.css">
|
| 10 |
+
<script src="app.js?v=3" defer></script>
|
| 11 |
</head>
|
| 12 |
<body>
|
| 13 |
<header class="topbar"><div class="wrap nav-wrap">
|
|
|
|
| 28 |
<label class="dataset-card"><input type="radio" name="dataset" value="sa"><span class="tag">WIKIDATA KG</span><strong>MQuAKE-ST</strong><span>Single Answer · Wikidata</span></label>
|
| 29 |
<label class="dataset-card"><input type="radio" name="dataset" value="ma"><span class="tag">MULTIPLE VALID ANSWERS</span><strong>MQuAKE-ST</strong><span>Multi Answer · Wikidata</span></label>
|
| 30 |
</fieldset>
|
| 31 |
+
<div class="setup-bottom"><div class="setup-options">
|
| 32 |
+
<label class="split-field" for="split">Question partition <select id="split"><option value="test" selected>Test</option><option value="dev">Development</option><option value="train">Training</option><option value="all">Any split</option></select></label>
|
| 33 |
+
<label class="split-field" for="wording">Question wording <select id="wording"><option value="canonical" selected>Canonical question</option><option value="paraphrase">Random paraphrase · harder</option></select></label>
|
| 34 |
+
</div><button type="button" class="btn primary" id="new-question">Get random question <span aria-hidden="true">↗</span></button></div>
|
| 35 |
<p id="setup-status" class="status" role="status" aria-live="polite">Choose a dataset, then start a challenge.</p>
|
| 36 |
</section>
|
| 37 |
<section class="panel play hidden" id="play" aria-labelledby="play-heading">
|
| 38 |
+
<div class="section-head play-head"><div><div class="kicker">02 / NAVIGATE</div><h2 id="play-heading">Your challenge</h2></div><div class="play-meta"><span class="chip" id="dataset-chip">Kinship</span><span class="chip" id="split-chip">Test partition</span><span class="chip" id="wording-chip">Canonical</span><span class="chip" id="steps-chip">0 steps taken</span></div></div>
|
| 39 |
+
<div class="question-box"><span class="small muted">QUESTION</span><p id="question-text"></p><div class="wording-note" id="wording-note"></div><div class="start-note">Starting entity: <b id="question-source"></b></div></div>
|
| 40 |
<div class="download-box" id="graph-prompt"><div class="download-icon" aria-hidden="true">⇩</div><div class="download-copy"><strong>Prepare the navigation graph</strong><p id="graph-help">Loading a public directed graph into your browser enables edge-by-edge choices.</p></div><button id="load-graph" class="btn primary" type="button">Load graph</button></div>
|
| 41 |
<div id="game-content" class="hidden">
|
| 42 |
<div class="statebar"><div><span class="small muted">CURRENT ENTITY</span><div id="current-entity" class="current-entity"></div></div><div class="statebar-actions"><button class="btn secondary" id="undo" type="button">↶ Undo</button><button class="btn secondary" id="restart" type="button">Restart</button></div></div>
|
|
|
|
| 47 |
</div>
|
| 48 |
<div id="result" class="result hidden" aria-live="polite"><div class="result-top"><div><div class="kicker">03 / RESULTS</div><h3 id="result-heading"></h3></div><span id="answer-badge" class="result-badge"></span></div><p id="result-description"></p><div class="result-grid"><div><span class="small muted">YOUR TERMINAL ENTITY</span><div id="result-terminal" class="result-value"></div></div><div><span class="small muted">RELEASED ANSWER(S)</span><div id="result-answers" class="result-value"></div></div></div><div id="path-assessment" class="path-assessment"></div><details class="reference-details"><summary>Show released reference evidence and hop count</summary><div id="reference-content"></div></details><div class="result-footer"><button id="retry" class="btn secondary" type="button">Try again</button><button id="another" class="btn primary" type="button">Next random question →</button></div></div>
|
| 49 |
</section>
|
| 50 |
+
<section class="info-grid" id="instructions"><div class="info-card"><div class="kicker">HOW TO PLAY</div><h2>You are the navigator</h2><p>This challenge tests human navigation through a knowledge graph, not pretrained MINERVA. At each step, pick a relation and one of the entity neighbors reachable along that edge. Submit when you think the current node answers the question.</p><p>Select <strong>Canonical question</strong> for the original wording or <strong>Random paraphrase</strong> for a randomly chosen alternative from the released <code>Question-Paraphrased</code> column. The wording stays fixed for the entire attempt, including retries.</p><p>There is no required number of steps displayed. A 12-step safety limit prevents endless wandering.</p></div><div class="info-card"><div class="kicker">ABOUT THE DATA</div><h2>Real edges. Hidden references.</h2><p>The source graph is loaded directly from the published Hugging Face dataset. Kinship uses native names, while MQuAKE-ST displays Wikidata item and property labels when metadata is available.</p><p><strong>Note:</strong> MQuAKE-ST has a large graph. The first load may take time and memory, especially on mobile. Multi Answer and Single Answer share the same graph, which is reused while this page stays open.</p></div></section>
|
| 51 |
</main>
|
| 52 |
<footer class="footer"><div class="wrap footer-flex"><span>THESEUS · Question-conditioned KG navigation</span><div><a href="https://huggingface.co/spaces/muttsurini/Kinship-Quickstart" target="_blank" rel="noopener noreferrer">Kinship quickstart ↗</a><a href="https://huggingface.co/spaces/muttsurini/MQuAKE-ST-Quickstart" target="_blank" rel="noopener noreferrer">MQuAKE-ST quickstart ↗</a></div></div></footer>
|
| 53 |
</body>
|
style.css
CHANGED
|
@@ -1,3 +1,11 @@
|
|
| 1 |
:root{color-scheme:dark;--bg:#090f1d;--panel:#111a2b;--panel2:#172339;--edge:#2b3b56;--text:#eaf0ff;--sub:#a5b5cb;--blue:#7cacff;--accent:#597dfa;--good:#71e3aa;--bad:#ffa59e;font-family:Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif}
|
| 2 |
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(ellipse 65% 650px at 50% -140px,#203b73 0%,#101c37 36%,transparent 74%),var(--bg);color:var(--text);font-size:15px;line-height:1.6}.wrap{width:min(1100px,calc(100% - 42px));margin:auto}.topbar{border-bottom:1px solid #26355377;background:#090f1dbb}.nav-wrap{min-height:66px;display:flex;align-items:center;justify-content:space-between;gap:16px}.identity{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--text);font-weight:780;font-size:13px;letter-spacing:.06em}.identity small{font-weight:450;color:var(--sub);font-size:12px;letter-spacing:0}.brand-icon{display:grid;place-items:center;width:32px;height:32px;background:linear-gradient(120deg,#7fa6ff,#5779fa);color:#091123;border-radius:9px;font-size:21px}.topbar nav{display:flex;gap:22px}.topbar nav a,.footer a{color:var(--sub);font-size:13px;text-decoration:none}.topbar nav a:hover,.footer a:hover{color:var(--blue)}.hero{padding:66px 0 48px;max-width:920px}.eyebrow,.kicker{color:var(--blue);font-weight:740;letter-spacing:.17em;font-size:10px}.eyebrow{display:flex;align-items:center;gap:10px}.pulse{width:7px;height:7px;background:#69e1be;border-radius:50%;box-shadow:0 0 0 5px #69e1be20}h1{font-size:clamp(37px,5.2vw,66px);line-height:1.11;letter-spacing:-.055em;margin:22px 0 18px;font-weight:790}h1 span{color:#84abff}.hero p{color:var(--sub);font-size:17px;max-width:680px;margin:0}.hero-pills{display:flex;gap:9px;flex-wrap:wrap;margin-top:23px}.hero-pills span,.chip{border:1px solid var(--edge);background:#16243b8c;border-radius:99px;padding:5px 11px;color:#baccde;font-size:12px}.panel{border:1px solid var(--edge);border-radius:16px;background:linear-gradient(145deg,#15213a,#101827 70%);padding:27px;margin:0 0 27px;box-shadow:0 22px 50px #0000001e}.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:23px}h2{font-size:26px;line-height:1.25;letter-spacing:-.028em;margin:5px 0 0}h3{font-size:16px;letter-spacing:-.015em;margin:0}.small{font-size:12px}.muted{color:var(--sub)}.dataset-choice{border:0;padding:0;margin:0;display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.dataset-card{position:relative;display:flex;flex-direction:column;gap:4px;cursor:pointer;min-height:148px;padding:17px;border:1px solid var(--edge);border-radius:11px;background:#0e1829;transition:.15s}.dataset-card:hover{border-color:#6b96e7}.dataset-card:has(input:checked){background:#1a2d4f;border-color:#85abff;box-shadow:inset 0 0 0 1px #85abff44}.dataset-card input{position:absolute;top:15px;right:15px;accent-color:#9bbdff;width:15px;height:15px}.dataset-card .tag{font-size:9px;color:#9db6e7;letter-spacing:.09em;font-weight:750}.dataset-card strong{font-size:19px;letter-spacing:-.03em;margin-top:8px}.dataset-card>span:last-child{color:var(--sub);font-size:12px}.setup-bottom{display:flex;justify-content:space-between;align-items:flex-end;gap:15px;flex-wrap:wrap;margin-top:21px}.split-field{font-size:12px;color:var(--sub);display:flex;flex-direction:column;gap:7px}.split-field select{min-width:220px}select,input[type='search']{background:#0b1425;border:1px solid #334763;color:var(--text);border-radius:9px;padding:10px 12px;font:inherit;font-size:13px;outline:none}select:focus,input:focus{border-color:var(--blue);box-shadow:0 0 0 3px #7099e520}.btn{border:1px solid transparent;border-radius:9px;padding:11px 16px;font:inherit;font-size:13px;font-weight:710;cursor:pointer;transition:.16s;white-space:nowrap}.btn:hover:not(:disabled){filter:brightness(1.14)}.btn:disabled{opacity:.43;cursor:not-allowed}.btn.primary{background:#7da7ff;color:#091226}.btn.secondary{color:#d5e1fa;background:#18263d;border-color:#344764}.btn.compact{padding:6px 11px;font-size:12px}.status{font-size:12px;color:var(--sub);min-height:19px;margin:16px 0 0}.status.error{color:var(--bad)}.hidden{display:none!important}.play-meta{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.play-head{align-items:center}.question-box{background:#0e192c;border:1px solid #344766;border-radius:12px;padding:19px 21px}.question-box>p{font-size:20px;font-weight:670;line-height:1.5;letter-spacing:-.02em;margin:8px 0 14px}.start-note{font-size:13px;color:var(--sub)}.start-note b{color:#e4edff;font-weight:690}.download-box{display:flex;align-items:center;gap:16px;background:#112d48;border:1px solid #3f6a90;border-radius:11px;padding:20px;margin-top:18px}.download-icon{font-size:29px;line-height:1}.download-copy{flex:1}.download-copy strong{font-size:14px}.download-copy p{font-size:12px;color:var(--sub);margin:2px 0 0}.statebar{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:21px 0}.current-entity{font-size:21px;font-weight:780;letter-spacing:-.026em;word-break:break-word}.statebar-actions{display:flex;gap:7px}.play-columns{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:15px}.action-panel,.journey{background:#0d1728;border:1px solid var(--edge);border-radius:11px;padding:18px;min-height:300px}.subheading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}.action-panel input[type='search']{width:100%;margin-bottom:12px}.relation-list{display:flex;flex-direction:column;gap:7px;max-height:360px;overflow:auto;padding-right:3px}.rel-item{width:100%;background:#16243b;border:1px solid #304360;color:var(--text);border-radius:9px;display:flex;justify-content:space-between;gap:10px;padding:10px 12px;text-align:left;cursor:pointer;align-items:center;font-size:13px}.rel-item.active,.rel-item:hover{background:#24395b;border-color:#6c9cf4}.rel-item small{color:var(--sub);font-size:11px;white-space:nowrap}.rel-item .name{min-width:0;overflow-wrap:anywhere}.rel-item code,.nodeid{font-size:11px;color:#8eace2;font-family:ui-monospace,monospace}.neighbors{border:1px solid #5477ab;background:#121f34;border-radius:11px;padding:13px;margin-top:15px}.neighbors p{margin:0 0 12px}.plain{background:none;border:0;cursor:pointer;color:var(--sub);font-size:16px}.neighbor-list{display:grid;gap:7px;max-height:260px;overflow:auto}.neighbor-row{display:flex;gap:7px;align-items:stretch}.neighbor-row .neighbor{flex:1;min-width:0}.neighbor-external{display:grid;place-items:center;min-width:33px;border:1px solid #3b5071;background:#1c2a43;border-radius:8px;color:#b5cffe;text-decoration:none}.neighbor-external:hover{background:#274060}.neighbor{border:1px solid #3b5071;border-radius:8px;padding:10px 11px;background:#1c2a43;color:var(--text);cursor:pointer;text-align:left;display:flex;justify-content:space-between;align-items:center;gap:12px}.neighbor:hover{border-color:#7aabff;background:#274060}.pager{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-top:10px}.route-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}.route-step{position:relative;padding:10px 12px 10px 16px;border:1px solid #364862;background:#152239;border-radius:10px}.route-step:not(:last-child):after{content:'';position:absolute;width:1px;height:9px;background:#6c86b2;bottom:-9px;left:20px}.route-step .route-rel{display:block;color:#9ab8ec;font-size:11px}.route-step strong{font-size:13px;overflow-wrap:anywhere}.route-step .nodeid{margin-left:7px}.journey-hint{font-size:12px;color:var(--sub);border-top:1px solid #30405a;padding-top:14px;margin-top:17px}.finish-row{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:22px;flex-wrap:wrap}.finish-row .status{margin:0}.finish-buttons{display:flex;gap:8px;flex-wrap:wrap}.result{border:1px solid #536c95;border-radius:12px;background:#10223c;margin-top:22px;padding:22px}.result-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.result-top h3{font-size:24px;margin-top:5px}.result-badge{border:1px solid #5b82b3;color:#c4d9fa;border-radius:99px;padding:5px 11px;font-size:12px;white-space:nowrap}.result-badge.success{border-color:#367a61;background:#1e493e;color:var(--good)}.result-badge.fail{border-color:#88524f;background:#4a292f;color:var(--bad)}.result p{color:#bfcde0;font-size:13px}.result-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin:18px 0}.result-grid>div{background:#0b1729;border:1px solid #30425d;padding:13px;border-radius:9px}.result-value{font-size:15px;color:var(--text);font-weight:690;word-break:break-word;margin-top:4px}.path-assessment{padding:12px 14px;background:#1a2c43;border:1px solid #355171;border-radius:9px;font-size:13px;color:#d1def1}.reference-details{border-top:1px solid #3b4d68;margin-top:18px;padding-top:14px;font-size:13px}.reference-details summary{cursor:pointer;color:#a9c6fa;font-weight:700}.reference-details p{margin:8px 0}.reference-details code{font-size:12px}.result-footer{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:17px}.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0 0 56px}.info-card{border:1px solid var(--edge);background:#101a2c;border-radius:13px;padding:24px}.info-card h2{font-size:20px;margin:8px 0}.info-card p{color:var(--sub);font-size:13px;margin:10px 0 0}.footer{border-top:1px solid #263554;padding:25px 0 38px;color:var(--sub);font-size:12px}.footer-flex{display:flex;justify-content:space-between;gap:20px}.footer-flex div{display:flex;gap:17px;flex-wrap:wrap}.empty{color:var(--sub);font-size:13px;padding:15px 8px}.link{color:#a6c6ff;text-decoration:none}.link:hover{text-decoration:underline}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;border:0;clip:rect(0,0,0,0);overflow:hidden}
|
| 3 |
@media(max-width:720px){.hero{padding:42px 0 34px}.dataset-choice,.play-columns,.info-grid{grid-template-columns:1fr}.dataset-card{min-height:105px}.section-head,.play-head{flex-wrap:wrap}.play-meta{justify-content:flex-start}.panel{padding:18px}.download-box{flex-wrap:wrap}.statebar{flex-wrap:wrap}.finish-row{align-items:stretch}.finish-buttons{width:100%}.finish-buttons button{flex:1}.question-box>p{font-size:18px}.footer-flex{flex-direction:column;gap:8px}.topbar nav{gap:12px}.identity small{display:none}.result-grid{grid-template-columns:1fr}.hero p{font-size:15px}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
:root{color-scheme:dark;--bg:#090f1d;--panel:#111a2b;--panel2:#172339;--edge:#2b3b56;--text:#eaf0ff;--sub:#a5b5cb;--blue:#7cacff;--accent:#597dfa;--good:#71e3aa;--bad:#ffa59e;font-family:Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif}
|
| 2 |
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(ellipse 65% 650px at 50% -140px,#203b73 0%,#101c37 36%,transparent 74%),var(--bg);color:var(--text);font-size:15px;line-height:1.6}.wrap{width:min(1100px,calc(100% - 42px));margin:auto}.topbar{border-bottom:1px solid #26355377;background:#090f1dbb}.nav-wrap{min-height:66px;display:flex;align-items:center;justify-content:space-between;gap:16px}.identity{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--text);font-weight:780;font-size:13px;letter-spacing:.06em}.identity small{font-weight:450;color:var(--sub);font-size:12px;letter-spacing:0}.brand-icon{display:grid;place-items:center;width:32px;height:32px;background:linear-gradient(120deg,#7fa6ff,#5779fa);color:#091123;border-radius:9px;font-size:21px}.topbar nav{display:flex;gap:22px}.topbar nav a,.footer a{color:var(--sub);font-size:13px;text-decoration:none}.topbar nav a:hover,.footer a:hover{color:var(--blue)}.hero{padding:66px 0 48px;max-width:920px}.eyebrow,.kicker{color:var(--blue);font-weight:740;letter-spacing:.17em;font-size:10px}.eyebrow{display:flex;align-items:center;gap:10px}.pulse{width:7px;height:7px;background:#69e1be;border-radius:50%;box-shadow:0 0 0 5px #69e1be20}h1{font-size:clamp(37px,5.2vw,66px);line-height:1.11;letter-spacing:-.055em;margin:22px 0 18px;font-weight:790}h1 span{color:#84abff}.hero p{color:var(--sub);font-size:17px;max-width:680px;margin:0}.hero-pills{display:flex;gap:9px;flex-wrap:wrap;margin-top:23px}.hero-pills span,.chip{border:1px solid var(--edge);background:#16243b8c;border-radius:99px;padding:5px 11px;color:#baccde;font-size:12px}.panel{border:1px solid var(--edge);border-radius:16px;background:linear-gradient(145deg,#15213a,#101827 70%);padding:27px;margin:0 0 27px;box-shadow:0 22px 50px #0000001e}.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:23px}h2{font-size:26px;line-height:1.25;letter-spacing:-.028em;margin:5px 0 0}h3{font-size:16px;letter-spacing:-.015em;margin:0}.small{font-size:12px}.muted{color:var(--sub)}.dataset-choice{border:0;padding:0;margin:0;display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.dataset-card{position:relative;display:flex;flex-direction:column;gap:4px;cursor:pointer;min-height:148px;padding:17px;border:1px solid var(--edge);border-radius:11px;background:#0e1829;transition:.15s}.dataset-card:hover{border-color:#6b96e7}.dataset-card:has(input:checked){background:#1a2d4f;border-color:#85abff;box-shadow:inset 0 0 0 1px #85abff44}.dataset-card input{position:absolute;top:15px;right:15px;accent-color:#9bbdff;width:15px;height:15px}.dataset-card .tag{font-size:9px;color:#9db6e7;letter-spacing:.09em;font-weight:750}.dataset-card strong{font-size:19px;letter-spacing:-.03em;margin-top:8px}.dataset-card>span:last-child{color:var(--sub);font-size:12px}.setup-bottom{display:flex;justify-content:space-between;align-items:flex-end;gap:15px;flex-wrap:wrap;margin-top:21px}.split-field{font-size:12px;color:var(--sub);display:flex;flex-direction:column;gap:7px}.split-field select{min-width:220px}select,input[type='search']{background:#0b1425;border:1px solid #334763;color:var(--text);border-radius:9px;padding:10px 12px;font:inherit;font-size:13px;outline:none}select:focus,input:focus{border-color:var(--blue);box-shadow:0 0 0 3px #7099e520}.btn{border:1px solid transparent;border-radius:9px;padding:11px 16px;font:inherit;font-size:13px;font-weight:710;cursor:pointer;transition:.16s;white-space:nowrap}.btn:hover:not(:disabled){filter:brightness(1.14)}.btn:disabled{opacity:.43;cursor:not-allowed}.btn.primary{background:#7da7ff;color:#091226}.btn.secondary{color:#d5e1fa;background:#18263d;border-color:#344764}.btn.compact{padding:6px 11px;font-size:12px}.status{font-size:12px;color:var(--sub);min-height:19px;margin:16px 0 0}.status.error{color:var(--bad)}.hidden{display:none!important}.play-meta{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.play-head{align-items:center}.question-box{background:#0e192c;border:1px solid #344766;border-radius:12px;padding:19px 21px}.question-box>p{font-size:20px;font-weight:670;line-height:1.5;letter-spacing:-.02em;margin:8px 0 14px}.start-note{font-size:13px;color:var(--sub)}.start-note b{color:#e4edff;font-weight:690}.download-box{display:flex;align-items:center;gap:16px;background:#112d48;border:1px solid #3f6a90;border-radius:11px;padding:20px;margin-top:18px}.download-icon{font-size:29px;line-height:1}.download-copy{flex:1}.download-copy strong{font-size:14px}.download-copy p{font-size:12px;color:var(--sub);margin:2px 0 0}.statebar{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:21px 0}.current-entity{font-size:21px;font-weight:780;letter-spacing:-.026em;word-break:break-word}.statebar-actions{display:flex;gap:7px}.play-columns{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:15px}.action-panel,.journey{background:#0d1728;border:1px solid var(--edge);border-radius:11px;padding:18px;min-height:300px}.subheading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}.action-panel input[type='search']{width:100%;margin-bottom:12px}.relation-list{display:flex;flex-direction:column;gap:7px;max-height:360px;overflow:auto;padding-right:3px}.rel-item{width:100%;background:#16243b;border:1px solid #304360;color:var(--text);border-radius:9px;display:flex;justify-content:space-between;gap:10px;padding:10px 12px;text-align:left;cursor:pointer;align-items:center;font-size:13px}.rel-item.active,.rel-item:hover{background:#24395b;border-color:#6c9cf4}.rel-item small{color:var(--sub);font-size:11px;white-space:nowrap}.rel-item .name{min-width:0;overflow-wrap:anywhere}.rel-item code,.nodeid{font-size:11px;color:#8eace2;font-family:ui-monospace,monospace}.neighbors{border:1px solid #5477ab;background:#121f34;border-radius:11px;padding:13px;margin-top:15px}.neighbors p{margin:0 0 12px}.plain{background:none;border:0;cursor:pointer;color:var(--sub);font-size:16px}.neighbor-list{display:grid;gap:7px;max-height:260px;overflow:auto}.neighbor-row{display:flex;gap:7px;align-items:stretch}.neighbor-row .neighbor{flex:1;min-width:0}.neighbor-external{display:grid;place-items:center;min-width:33px;border:1px solid #3b5071;background:#1c2a43;border-radius:8px;color:#b5cffe;text-decoration:none}.neighbor-external:hover{background:#274060}.neighbor{border:1px solid #3b5071;border-radius:8px;padding:10px 11px;background:#1c2a43;color:var(--text);cursor:pointer;text-align:left;display:flex;justify-content:space-between;align-items:center;gap:12px}.neighbor:hover{border-color:#7aabff;background:#274060}.pager{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-top:10px}.route-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}.route-step{position:relative;padding:10px 12px 10px 16px;border:1px solid #364862;background:#152239;border-radius:10px}.route-step:not(:last-child):after{content:'';position:absolute;width:1px;height:9px;background:#6c86b2;bottom:-9px;left:20px}.route-step .route-rel{display:block;color:#9ab8ec;font-size:11px}.route-step strong{font-size:13px;overflow-wrap:anywhere}.route-step .nodeid{margin-left:7px}.journey-hint{font-size:12px;color:var(--sub);border-top:1px solid #30405a;padding-top:14px;margin-top:17px}.finish-row{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:22px;flex-wrap:wrap}.finish-row .status{margin:0}.finish-buttons{display:flex;gap:8px;flex-wrap:wrap}.result{border:1px solid #536c95;border-radius:12px;background:#10223c;margin-top:22px;padding:22px}.result-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.result-top h3{font-size:24px;margin-top:5px}.result-badge{border:1px solid #5b82b3;color:#c4d9fa;border-radius:99px;padding:5px 11px;font-size:12px;white-space:nowrap}.result-badge.success{border-color:#367a61;background:#1e493e;color:var(--good)}.result-badge.fail{border-color:#88524f;background:#4a292f;color:var(--bad)}.result p{color:#bfcde0;font-size:13px}.result-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin:18px 0}.result-grid>div{background:#0b1729;border:1px solid #30425d;padding:13px;border-radius:9px}.result-value{font-size:15px;color:var(--text);font-weight:690;word-break:break-word;margin-top:4px}.path-assessment{padding:12px 14px;background:#1a2c43;border:1px solid #355171;border-radius:9px;font-size:13px;color:#d1def1}.reference-details{border-top:1px solid #3b4d68;margin-top:18px;padding-top:14px;font-size:13px}.reference-details summary{cursor:pointer;color:#a9c6fa;font-weight:700}.reference-details p{margin:8px 0}.reference-details code{font-size:12px}.result-footer{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:17px}.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0 0 56px}.info-card{border:1px solid var(--edge);background:#101a2c;border-radius:13px;padding:24px}.info-card h2{font-size:20px;margin:8px 0}.info-card p{color:var(--sub);font-size:13px;margin:10px 0 0}.footer{border-top:1px solid #263554;padding:25px 0 38px;color:var(--sub);font-size:12px}.footer-flex{display:flex;justify-content:space-between;gap:20px}.footer-flex div{display:flex;gap:17px;flex-wrap:wrap}.empty{color:var(--sub);font-size:13px;padding:15px 8px}.link{color:#a6c6ff;text-decoration:none}.link:hover{text-decoration:underline}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;border:0;clip:rect(0,0,0,0);overflow:hidden}
|
| 3 |
@media(max-width:720px){.hero{padding:42px 0 34px}.dataset-choice,.play-columns,.info-grid{grid-template-columns:1fr}.dataset-card{min-height:105px}.section-head,.play-head{flex-wrap:wrap}.play-meta{justify-content:flex-start}.panel{padding:18px}.download-box{flex-wrap:wrap}.statebar{flex-wrap:wrap}.finish-row{align-items:stretch}.finish-buttons{width:100%}.finish-buttons button{flex:1}.question-box>p{font-size:18px}.footer-flex{flex-direction:column;gap:8px}.topbar nav{gap:12px}.identity small{display:none}.result-grid{grid-template-columns:1fr}.hero p{font-size:15px}}
|
| 4 |
+
|
| 5 |
+
/* Question wording selector and variation note. */
|
| 6 |
+
.setup-options{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap}
|
| 7 |
+
.setup-options .split-field{flex:1 1 210px}
|
| 8 |
+
#wording{min-width:230px}
|
| 9 |
+
.wording-note{font-size:12px;color:var(--sub);margin:-6px 0 11px}
|
| 10 |
+
.wording-note:empty{display:none}
|
| 11 |
+
@media(max-width:610px){.setup-options{width:100%}.setup-options .split-field{flex:1 1 100%}.setup-options select,#wording{width:100%;min-width:0}.setup-bottom>.btn{width:100%}}
|