SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.07470 · 2019

Graph Transformer for Graph-to-Sequence Learning

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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; 3 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.07470.json · badge: /api/ran/1911.07470.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
jcyk/gtos canonical (classifier label)
classifier basis: census
7 ran · 3 no recorded run
FunctionStatusWhere it lives
ListsToTensor Ran
ran on a synthesized input
jcyk/gtos/generator/data.py
code served (permissive licence) · get_code("c5f882c733635c4e")
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 Tensor, ndim 2, dtype family int, shape (3, 2) 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
import random

torch.manual_seed(0)

class SimpleVocab:
    def __init__(self):
        self.padding_idx = 0
        self.unk_idx = 1
        self.word_to_idx = {
            "hello": 2,
            "world": 3,
            "foo": 4,
            "bar": 5
        }
    
    def token2idx(self, token):
        return self.word_to_idx.get(token, self.unk_idx)

vocab = SimpleVocab()

local_vocab_1 = {"hello": 10, "world": 11}
local_vocab_2 = {"foo": 20, "bar": 21}
local_vocabs = [local_vocab_1, local_vocab_2]

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

ARGS = {
    "xs": xs,
    "vocab": vocab,
    "local_vocabs": local_vocabs,
    "unk_rate": 0.0
}
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 Tensor, ndim 2, dtype family int, shape (3, 2) — shape (3, 2) 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
is_attr_or_abs_form Ran
ran on a synthesized input
jcyk/gtos/generator/AMRGraph.py
code served (permissive licence) · get_code("5846e0e199be3a49")
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 bool, 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 re

number_regexp = re.compile('^-?(\\d)+(\\.\\d+)?$')

abstract_regexp0 = re.compile('^([A-Z]+_)+\\d+$')

abstract_regexp1 = re.compile('^\\d0*$')

attr_value_set = set(['-', '+', 'interrogative', 'imperative', 'expressive'])

def _is_attr_form(x):
    return x in attr_value_set or x.endswith('_') or number_regexp.match(x) is not None

def _is_abs_form(x):
    return abstract_regexp0.match(x) is not None or abstract_regexp1.match(x) is not None

def is_attr_or_abs_form(x):
    return _is_attr_form(x) or _is_abs_form(x)

# Test cases that should return True or False
ARGS = {
    'x': 'ABC_123'  # matches abstract_regexp0: ([A-Z]+_)+\d+
}
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 bool, 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
make_vocab Ran
ran on a synthesized input
jcyk/gtos/generator/extract.py
code served (permissive licence) · get_code("5d147ec91127fd39")
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 Counter. 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
from collections import Counter

# Test case 1: word-level vocabulary
batch_seq_1 = [
    ['hello', 'world', 'hello'],
    ['foo', 'bar', 'world']
]

# Test case 2: character-level vocabulary
batch_seq_2 = [
    ['cat', 'dog', 'cat'],
    ['bird', 'dog']
]

ARGS = {
    'batch_seq': batch_seq_1,
    'char_level': False
}
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 Counter — a Counter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Counter 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
need_an_instance Ran
ran on a synthesized input
jcyk/gtos/generator/AMRGraph.py
code served (permissive licence) · get_code("53445cbd60ba3b37")
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 bool, 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 re
import torch

number_regexp = re.compile('^-?(\\d)+(\\.\\d+)?$')
abstract_regexp0 = re.compile('^([A-Z]+_)+\\d+$')
attr_value_set = set(['-', '+', 'interrogative', 'imperative', 'expressive'])

def _is_attr_form(x):
    return x in attr_value_set or x.endswith('_') or number_regexp.match(x) is not None

def need_an_instance(x):
    return not _is_attr_form(x) or abstract_regexp0.match(x) is not None

# Test cases for the function
test_cases = [
    # attr_value_set members - should return False
    '-',
    '+',
    'interrogative',
    'imperative',
    'expressive',
    # strings ending with underscore - should return False
    'hello_',
    'test_',
    # numbers (matching number_regexp) - should return False
    '42',
    '-42',
    '3.14',
    '-2.5',
    '0',
    '-0.001',
    # abstract_regexp0 matches (e.g., "ABC_123") - should return True (not attr_form)
    'ABC_123',
    'XYZ_456',
    'A_B_1',
    # regular strings that don't match any pattern - should return True
    'hello',
    'world',
    'some_instance',
    'MyClass',
]

ARGS = {
    'x': 'hello'
}
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 bool, 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
ngram_counts Ran
ran on a synthesized input
jcyk/gtos/generator/chrF++.py
code served (permissive licence) · get_code("3a4c43adbea21ba8")
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 defaultdict. 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
from collections import defaultdict

# Construct arguments for ngram_counts function
# The function takes:
# 1. wordList: a list of words (strings or tokens)
# 2. order: an integer specifying the maximum n-gram order

wordList = ["the", "quick", "brown", "fox", "jumps"]
order = 3

ARGS = {
    "wordList": wordList,
    "order": order
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
separate_characters Ran
ran on a synthesized input
jcyk/gtos/generator/chrF++.py
code served (permissive licence) · get_code("7433cd65c050cff7")
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.

import torch

torch.manual_seed(0)

# The function separate_characters takes a single parameter 'line'
# which should be a string. It strips whitespace, removes spaces, and returns a list of characters.

line = "hello world"

ARGS = {
    "line": line
}
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 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
separate_punctuation Ran
ran on a synthesized input
jcyk/gtos/generator/chrF++.py
code served (permissive licence) · get_code("df31e08a070ba2fb")
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.

import string

def separate_punctuation(line):
    words = line.strip().split()
    tokenized = []
    for w in words:
        if len(w) == 1:
            tokenized.append(w)
        else:
            lastChar = w[-1]
            firstChar = w[0]
            if lastChar in string.punctuation:
                tokenized += [w[:-1], lastChar]
            elif firstChar in string.punctuation:
                tokenized += [firstChar, w[1:]]
            else:
                tokenized.append(w)
    return tokenized

ARGS = {
    "line": "Hello, world! This is a test."
}
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 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
ArraysToTensor Not yet run
unverified (harvested, no recorded run)
jcyk/gtos/generator/data.py
code served (permissive licence) · get_code("fe61bad3dddd0eec")
How it ran

no invocation recorded.

ListsofStringToTensor Not yet run
unverified (harvested, no recorded run)
jcyk/gtos/generator/data.py
code served (permissive licence) · get_code("87fc425b3f5fde1f")
How it ran

no invocation recorded.

search_by_batch Not yet run
unverified (harvested, no recorded run)
jcyk/gtos/generator/search.py
code served (permissive licence) · get_code("2d5fc1b136ce1835")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
is_attr_or_abs_form 1 other paper
1 later
2004.05572 (2020-04)
AMR Parsing via Graph Sequence Iterative Inference *
make_vocab 1 other paper
1 later
2004.05572 (2020-04)
AMR Parsing via Graph Sequence Iterative Inference *
need_an_instance 1 other paper
1 later
2004.05572 (2020-04)
AMR Parsing via Graph Sequence Iterative Inference *

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

The dominant graph-to-sequence transduction models employ graph neural networks for graph representation learning, where the structural information is reflected by the receptive field of neurons. Unlike graph neural networks that restrict the information exchange between immediate neighborhood, we propose a new model, known as Graph Transformer, that uses explicit relation encoding and allows direct communication between two distant nodes. It provides a more efficient way for global graph structure modeling. Experiments on the applications of text generation from Abstract Meaning Representation (AMR) and syntax-based neural machine translation show the superiority of our proposed model. Specifically, our model achieves 27.4 BLEU on LDC2015E86 and 29.7 BLEU on LDC2017T10 for AMR-to-text generation, outperforming the state-of-the-art results by up to 2.2 points. On the syntax-based translation tasks, our model establishes new single-model state-of-the-art BLEU scores, 21.3 for English-to-German and 14.1 for English-to-Czech, improving over the existing best results, including ensembles, by over 1 BLEU.

For agents

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

get_harvested_code_for_paper("1911.07470")
get_code_for_paper("1911.07470")
have("1911.07470")

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

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

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

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

Connect an agent — have() is free.