SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.13956 · AAAI · 2020

SPARQA: Skeleton-Based Semantic Parsing for Complex Questions over Knowledge Bases

Yuzhong Qu, Gong Cheng, Yawei Sun, Lingling Zhang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2003.13956.json · badge: /api/ran/2003.13956.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
nju-websoft/SPARQA canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
findPath Ran
ran on a synthesized input
nju-websoft/SPARQA/code/common_structs/find_path.py
code served (permissive licence) · get_code("a14a18b3b64cf58c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from nltk.tree import Tree

# Create a parse tree
ptree = Tree.fromstring('(VP (VERB saw) (NP (DET the) (NOUN dog)))')

# Define arguments for findPath function
# The function takes three parameters: ptree, text1, text2
# text1 and text2 should be leaf values from the tree

ARGS = {
    "ptree": ptree,
    "text1": "saw",
    "text2": "dog"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_gold_entity_or_class Ran
ran on a synthesized input
nju-websoft/SPARQA/code/common/utils.py
code served (permissive licence) · get_code("dfcbed3d1e891f85")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned set. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class Node:
    def __init__(self, node_id, node_type):
        self.id = node_id
        self.node_type = node_type


class Graph:
    def __init__(self, nodes):
        self.nodes = nodes


# Create test nodes
node1 = Node("entity_1", "entity")
node2 = Node("entity_2", "entity")
node3 = Node("class_1", "class")
node4 = Node("class_2", "class")

# Create a graph with mixed node types
gold_grounded_graph = Graph([node1, node2, node3, node4])

# Define arguments
ARGS = {
    "gold_grounded_graph": gold_grounded_graph,
    "node_type": "entity"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_gold_entity_or_class_by_json Ran
ran on a synthesized input
nju-websoft/SPARQA/code/common/utils.py
code served (permissive licence) · get_code("70615211dd730b38")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned set. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Construct a valid gold_grounded_graph
gold_grounded_graph = {
    'nodes': [
        {'node_type': 'entity', 'id': 'entity_1'},
        {'node_type': 'entity', 'id': 'entity_2'},
        {'node_type': 'class', 'id': 'class_1'},
        {'node_type': 'class', 'id': 'class_2'},
        {'node_type': 'relation', 'id': 'relation_1'},
    ]
}

ARGS = {
    'gold_grounded_graph': gold_grounded_graph,
    'node_type': 'entity'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_labels_from_lca Ran
ran on a synthesized input
nju-websoft/SPARQA/code/common_structs/find_path.py
code served (permissive licence) · get_code("1b12bbb3ef40478d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from nltk.tree import Tree

ptree = Tree.fromstring('(VP (VERB saw) (NP (DET the) (NOUN dog)))')

# The function iterates from lca_len to len(location)
# and accesses ptree[location[:i]].label() for each i
# So location needs to be a valid sequence of indices into the tree
# and lca_len needs to be less than len(location)

# location is used as a slice key, so it should be a list/tuple of indices
location = [0, 1]  # Valid path into the tree
lca_len = 1  # Start from index 1, so we get labels for indices [0:1] and [0:2]

ARGS = {
    "ptree": ptree,
    "lca_len": lca_len,
    "location": location
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_lca_length Ran
ran on a synthesized input
nju-websoft/SPARQA/code/common_structs/find_path.py
code served (permissive licence) · get_code("75d19bb288601604")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct arguments for get_lca_length
# The function takes two location sequences and finds the length of their longest common ancestor
# by comparing elements until they differ

location1 = [0, 1, 2, 3, 4]
location2 = [0, 1, 2, 5, 6]

ARGS = {
    "location1": location1,
    "location2": location2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_nid_by_id Ran
ran on a synthesized input
nju-websoft/SPARQA/code/common/utils.py
code served (permissive licence) · get_code("0f36a93246e54f11")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class Node:
    def __init__(self, nid, id):
        self.nid = nid
        self.id = id

nodes = [
    Node(nid=0, id="node_a"),
    Node(nid=1, id="node_b"),
    Node(nid=2, id="node_c"),
]

id = "node_b"

ARGS = {
    "nodes": nodes,
    "id": id,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_args Not yet run
unverified (harvested, no recorded run)
nju-websoft/SPARQA/code/common/globals_args.py
code served (permissive licence) · get_code("0681c15b3b982808")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Semantic parsing transforms a natural language question into a formal query over a knowledge base. Many existing methods rely on syntactic parsing like dependencies. However, the accuracy of producing such expressive formalisms is not satisfying on long complex questions. In this paper, we propose a novel skeleton grammar to represent the high-level structure of a complex question. This dedicated coarse-grained formalism with a BERT-based parsing algorithm helps to improve the accuracy of the downstream fine-grained semantic parsing. Besides, to align the structure of a question with the structure of a knowledge base, our multi-strategy method combines sentence-level and word-level semantics. Our approach shows promising performance on several datasets.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2003.13956")
get_code_for_paper("2003.13956")
have("2003.13956")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2003.13956.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2003.13956.svg)](https://syntology.ai/paper/2003.13956)

Connect an agent — have() is free.