SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.12986 · 2019

Merging Weak and Active Supervision for Semantic Parsing

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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 7 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/1911.12986.json · badge: /api/ran/1911.12986.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
niansong1996/wassp canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
attn_sum_bahdanau Ran
ran on a synthesized input
niansong1996/wassp/nsm/tf_utils.py
code served (permissive licence) · get_code("c3104e5e2d8a40e4")
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 EagerTensor, ndim 2, dtype family float, shape (2, 3) 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 tensorflow as tf
import numpy as np

# Create small tensors for the Bahdanau attention mechanism
batch_size = 2
time_steps = 3
key_dim = 4

# v_attn: attention variable with shape (key_dim,)
v_attn = tf.constant(np.random.randn(key_dim).astype(np.float32))

# keys: shape (batch_size, time_steps, key_dim)
keys = tf.constant(np.random.randn(batch_size, time_steps, key_dim).astype(np.float32))

# query: shape (batch_size, key_dim)
query = tf.constant(np.random.randn(batch_size, key_dim).astype(np.float32))

ARGS = {
    "v_attn": v_attn,
    "keys": keys,
    "query": query,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
attn_sum_dot Ran
ran on a synthesized input
niansong1996/wassp/nsm/tf_utils.py
code served (permissive licence) · get_code("f1f2fe840e5c928e")
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 EagerTensor, ndim 2, dtype family float, shape (2, 3) 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
np.random.seed(0)
tf.random.set_seed(0)

# Create small tensors for the function
# keys shape: (batch_size, time_steps, key_dim)
keys = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))

# query shape: (batch_size, query_dim)
# Note: query_dim should match key_dim for the dot product to work
query = tf.constant(np.random.randn(2, 4).astype(np.float32))

ARGS = {
    "keys": keys,
    "query": query,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
bleu_score Ran
ran on a synthesized input
niansong1996/wassp/nsm/nlp_utils.py
code served (permissive licence) · get_code("9073ba6a227f3a75")
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 float, ndim 0, dtype family float, 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 nltk
import torch

torch.manual_seed(0)

# The function expects:
# - sentence: a list of tokens (words)
# - gold_sentence: a list of tokens (words)

# These are passed to nltk.translate.bleu_score.sentence_bleu
# which expects references (a list of reference sentences) and a hypothesis sentence

sentence = ['the', 'cat', 'sat', 'on', 'the', 'mat']
gold_sentence = ['the', 'cat', 'is', 'sitting', 'on', 'the', 'mat']

ARGS = {
    'sentence': sentence,
    'gold_sentence': gold_sentence
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, 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
create_lm_inputs_labels Ran
ran on a synthesized input
niansong1996/wassp/nsm/data_utils.py
code served (permissive licence) · get_code("ba6719f38bfb57e9")
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 tuple. 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

class MockVocab:
    def __init__(self):
        self.decode_id = 10
        self.end_id = 11
        self._word_to_id = {
            'hello': 1,
            'world': 2,
            'foo': 3,
            'bar': 4,
            'baz': 5
        }
    
    def lookup(self, seq):
        """Convert sequence of words to list of ids."""
        return [self._word_to_id.get(word, 0) for word in seq]

vocab = MockVocab()
dataset = [
    ['hello', 'world'],
    ['foo', 'bar', 'baz']
]

ARGS = {
    'dataset': dataset,
    'vocab': vocab
}
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 tuple — a tuple output has no array shape of its own; none is 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
create_seq2seq_inputs Ran
ran on a synthesized input
niansong1996/wassp/nsm/data_utils.py
code served (permissive licence) · get_code("451d8aadbc0755dd")
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 tuple, ndim 3, dtype family int; 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.

import torch
import numpy as np

torch.manual_seed(0)

class Vocab:
    def __init__(self, start_id=1, decode_id=2, end_id=3):
        self.start_id = start_id
        self.decode_id = decode_id
        self.end_id = end_id
        self.word_to_id = {"hello": 10, "world": 11, "foo": 12, "bar": 13}
    
    def lookup(self, seq):
        """Convert sequence of words to list of ids"""
        return [self.word_to_id.get(word, 0) for word in seq]

en_vocab = Vocab(start_id=1, decode_id=2, end_id=3)
de_vocab = Vocab(start_id=1, decode_id=2, end_id=3)

en_dataset = [
    ["hello", "world"],
    ["foo", "bar"]
]

de_dataset = [
    ["hello", "world"],
    ["foo", "bar"]
]

ARGS = {
    "en_dataset": en_dataset,
    "en_vocab": en_vocab,
    "de_dataset": de_dataset,
    "de_vocab": de_vocab
}
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 tuple, ndim 3, dtype family int — a tuple 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
tensormul Ran
ran on a synthesized input
niansong1996/wassp/nsm/tf_utils.py
code served (permissive licence) · get_code("cc1113db8b905bd0")
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 EagerTensor, ndim 3, dtype family float, shape (2, 3, 5) 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 tensorflow as tf

# Create two tensors for matrix multiplication
# t1 shape: (2, 3, 4) - batch of 2, 3 rows, 4 columns
# t2 shape: (4, 5) - 4 rows, 5 columns
# Result will be (2, 3, 5) after tensormul

t1 = tf.constant([
    [[1.0, 2.0, 3.0, 4.0],
     [5.0, 6.0, 7.0, 8.0],
     [9.0, 10.0, 11.0, 12.0]],
    [[13.0, 14.0, 15.0, 16.0],
     [17.0, 18.0, 19.0, 20.0],
     [21.0, 22.0, 23.0, 24.0]]
], dtype=tf.float32)

t2 = tf.constant([
    [1.0, 2.0, 3.0, 4.0, 5.0],
    [6.0, 7.0, 8.0, 9.0, 10.0],
    [11.0, 12.0, 13.0, 14.0, 15.0],
    [16.0, 17.0, 18.0, 19.0, 20.0]
], dtype=tf.float32)

ARGS = {
    "t1": t1,
    "t2": t2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (2, 3, 5) — shape (2, 3, 5) 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
with_graph_variable_scope Ran
ran on a synthesized input
niansong1996/wassp/nsm/graph_factory.py
code served (permissive licence) · get_code("d34fbdeb6f1be262")
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 function. 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 os
import tensorflow as tf

class MockSelf:
    def __init__(self):
        self._graph = tf.Graph()
        self.vs = "test_scope"

def mock_func(self):
    return "result"

def with_graph_variable_scope(func):
    def func_wrapper(*args, **kwargs):
        self = args[0]
        with self._graph.as_default():
            pid = os.getpid()
            container_name = 'worker{}'.format(pid)
            with self._graph.container(container_name):
                with tf.variable_scope(self.vs):
                    return func(*args, **kwargs)
    return func_wrapper

mock_self = MockSelf()
decorated_func = with_graph_variable_scope(mock_func)

ARGS = {
    "func": mock_func
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
create_multilayer_fnn Not yet run
unverified (harvested, no recorded run)
niansong1996/wassp/nsm/graph_factory.py
code served (permissive licence) · get_code("42891135110a96ff")
How it ran

no invocation recorded.

create_seq_mse_loss Not yet run
unverified (harvested, no recorded run)
niansong1996/wassp/nsm/graph_factory.py
code served (permissive licence) · get_code("ee764e83c41c8784")
How it ran

no invocation recorded.

edit_distance Not yet run
unverified (harvested, no recorded run)
niansong1996/wassp/nsm/nlp_utils.py
code served (permissive licence) · get_code("54fb9ba175e6c08b")
How it ran

no invocation recorded.

tokenize Not yet run
unverified (harvested, no recorded run)
niansong1996/wassp/nsm/nlp_utils.py
code served (permissive licence) · get_code("4fb20ccedc18c760")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 11 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 0 the same month, 0 later) and 0 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.

FunctionAlso present inEarliest-datedOthers named
attn_sum_bahdanau 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
attn_sum_dot 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
bleu_score 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
create_lm_inputs_labels 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
create_multilayer_fnn 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
create_seq2seq_inputs 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
create_seq_mse_loss 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
edit_distance 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
tensormul 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
tokenize 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
with_graph_variable_scope 1 other paper
1 dated earlier
1807.02322 (2018-07)
Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing

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-23.

Repositories linked to this paper

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

Abstract

A semantic parser maps natural language commands (NLs) from the users to executable meaning representations (MRs), which are later executed in certain environment to obtain user-desired results. The fully-supervised training of such parser requires NL/MR pairs, annotated by domain experts, which makes them expensive to collect. However, weakly-supervised semantic parsers are learnt only from pairs of NL and expected execution results, leaving the MRs latent. While weak supervision is cheaper to acquire, learning from this input poses difficulties. It demands that parsers search a large space with a very weak learning signal and it is hard to avoid spurious MRs that achieve the correct answer in the wrong way. These factors lead to a performance gap between parsers trained in weakly- and fully-supervised setting. To bridge this gap, we examine the intersection between weak supervision and active learning, which allows the learner to actively select examples and query for manual annotations as extra supervision to improve the model trained under weak supervision. We study different active learning heuristics for selecting examples to query, and various forms of extra supervision for such queries. We evaluate the effectiveness of our method on two different datasets. Experiments on the WikiSQL show that by annotating only 1.8% of examples, we improve over a state-of-the-art weakly-supervised baseline by 6.4%, achieving an accuracy of 79.0%, which is only 1.3% away from the model trained with full supervision. Experiments on WikiTableQuestions with human annotators show that our method can improve the performance with only 100 active queries, especially for weakly-supervised parsers learnt from a cold start.

For agents

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

get_harvested_code_for_paper("1911.12986")
get_code_for_paper("1911.12986")
have("1911.12986")

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

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

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

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

Connect an agent — have() is free.