SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1906.07510 · 2019

Attention Guided Graph Convolutional Networks for Relation Extraction

arXiv · PDF · Open in the Atlas

Code that ran

13 of 13 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 10 have no contract verdict; 3 failures of our instrument; 0 no recorded run), measured 2026-11-21; 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/1906.07510.json · badge: /api/ran/1906.07510.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
Cartus/AGGCN_TACRED canonical (classifier label)
classifier basis: census
12 ran · 0 no recorded run
Cartus/AGGCN community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
attention Ran
ran; our contract draft was wrong, not the code
Cartus/AGGCN_TACRED/model/aggcn.py
code served (permissive licence) · get_code("d29688d33b9aa937")
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 3, dtype family float, shape (2, 3, 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 torch
import torch.nn as nn
import math

torch.manual_seed(0)

# Create small tensors for query and key
# query shape: (batch=2, seq_len_q=3, d_k=4)
# key shape: (batch=2, seq_len_k=3, d_k=4)
query = torch.randn(2, 3, 4)
key = torch.randn(2, 3, 4)

# Create a mask tensor (batch=2, seq_len_q=3, seq_len_k=3)
# 1 means attend, 0 means mask out
mask = torch.ones(2, 3, 3)

# Create a dropout layer
dropout = nn.Dropout(p=0.1)

ARGS = {
    "query": query,
    "key": key,
    "mask": mask,
    "dropout": dropout
}
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 3, dtype family float, shape (2, 3, 3) — shape (2, 3, 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
batched_index_select Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Cartus/AGGCN_TACRED/semeval/model/aggcn.py
code served (permissive licence) · get_code("f091cdd21c103f22")
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 3, dtype family float, shape (2, 8, 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 torch

torch.manual_seed(0)

# Create a small input tensor with shape (batch=2, dim1=4, dim2=3)
input_tensor = torch.randn(2, 4, 3)

# Create index tensor for selecting along dim=1
# Index should have compatible shape for gathering
index_tensor = torch.tensor([[[0, 2], [1, 1], [2, 0], [3, 2]],
                             [[1, 0], [2, 1], [0, 3], [3, 1]]])

# The function performs batched index selection
# input: the tensor to gather from
# dim: the dimension along which to gather
# index: the indices to use for gathering

ARGS = {
    "input": input_tensor,
    "dim": 1,
    "index": index_tensor
}
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 3, dtype family float, shape (2, 8, 3) — shape (2, 8, 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
clones Ran
ran; our contract draft was wrong, not the code
Cartus/AGGCN_TACRED/PubMed/Binary/model/aggcn.py
pointer only (licence: MIT); the stored copy get_code serves, from fudanvi/fudanocr, is pointer only (licence: NONE) · get_code("6cdff690e29fd5e2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from fudanvi/fudanocr, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

head_to_tree Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/model/tree.py
code served (permissive licence) · get_code("66027a712727c031")
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 Tree. 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 Tree(object):
    """
    Reused tree object from stanfordnlp/treelstm.
    """

    def __init__(self):
        self.parent = None
        self.num_children = 0
        self.children = list()

    def add_child(self, child):
        child.parent = self
        self.num_children += 1
        self.children.append(child)

    def size(self):
        if getattr(self, '_size', None):
            return self._size
        count = 1
        for i in range(self.num_children):
            count += self.children[i].size()
        self._size = count
        return self._size

    def depth(self):
        if getattr(self, '_depth', None):
            return self._depth
        count = 0
        if self.num_children > 0:
            for i in range(self.num_children):
                child_depth = self.children[i].depth()
                if child_depth > count:
                    count = child_depth
            count += 1
        self._depth = count
        return self._depth

    def __iter__(self):
        yield self
        for c in self.children:
            for x in c:
                yield x

def head_to_tree(head, len_):
    """
    Convert a sequence of head indexes into a tree object.
    """
    head = head[:len_].tolist()
    root = None
    nodes = [Tree() for _ in head]
    for i in range(len(nodes)):
        h = head[i]
        nodes[i].idx = i
        nodes[i].dist = -1
        if h == 0:
            root = nodes[i]
        else:
            nodes[h - 1].add_child(nodes[i])
    assert root is not None
    return root

torch.manual_seed(0)

head = torch.tensor([0, 1, 2, 3, 1], dtype=torch.long)
len_ = 5

ARGS = {
    "head": head,
    "len_": len_
}
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 Tree — a Tree output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Tree 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
load_tokens Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/prepare_vocab.py
code served (permissive licence) · get_code("ebfa4cdc3d3f34b8")
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 json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_file = os.path.join(temp_dir, 'test_tokens.json')

# Create sample data matching the expected format
test_data = [
    {
        'token': ['the', 'cat', 'sat', 'on', 'the', 'mat'],
        'subj_start': 0,
        'subj_end': 1,
        'obj_start': 3,
        'obj_end': 5
    },
    {
        'token': ['a', 'dog', 'ran', 'fast'],
        'subj_start': 0,
        'subj_end': 1,
        'obj_start': 2,
        'obj_end': 3
    }
]

# Write the test data to the temporary file
with open(test_file, 'w') as outfile:
    json.dump(test_data, outfile)

ARGS = {
    'filename': test_file
}
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
load_tokens Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/semeval/prepare_vocab.py
code served (permissive licence) · get_code("83e7bab03dc7c999")
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 json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_tokens.json")

# Create test data matching the function's expected structure
test_data = [
    {
        "token": ["The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"],
        "subj_start": 0,
        "subj_end": 2,
        "obj_start": 5,
        "obj_end": 7
    },
    {
        "token": ["Hello", "world", "test", "example"],
        "subj_start": 0,
        "subj_end": 1,
        "obj_start": 2,
        "obj_end": 3
    }
]

# Write test data to JSON file
with open(temp_file, 'w') as f:
    json.dump(test_data, f)

# Define arguments for the load_tokens function
ARGS = {
    "filename": temp_file,
    "data_dir": "dataset/tacred"
}
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
rnn_zero_state Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/model/aggcn.py
code served (permissive licence) · get_code("f5b0ce312a47a4cf")
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 4, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.autograd import Variable

torch.manual_seed(0)

ARGS = {
    "batch_size": 2,
    "hidden_dim": 4,
    "num_layers": 3,
    "bidirectional": True,
}
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 tuple, ndim 4, dtype family float — 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
score Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/utils/scorer.py
code served (permissive licence) · get_code("9cb44938e773d88b")
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 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 sys
from collections import Counter

NO_RELATION = 'no_relation'

# Create simple test data for the score function
# The function expects two lists of equal length containing relation labels

# Create a key (ground truth) list with various relations and no_relation labels
key = [
    'person:knows',
    'person:knows',
    NO_RELATION,
    'org:founded',
    'org:founded',
    NO_RELATION,
    'person:knows',
    'org:based_in'
]

# Create a prediction list with some correct and incorrect predictions
prediction = [
    'person:knows',      # correct
    'org:founded',       # incorrect
    NO_RELATION,         # correct (both no_relation)
    'org:founded',       # correct
    NO_RELATION,         # incorrect (should be org:founded)
    'person:knows',      # incorrect (should be no_relation)
    'person:knows',      # correct
    'org:based_in'       # correct
]

ARGS = {
    'key': key,
    'prediction': prediction,
    'verbose': True
}
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 tuple, ndim 1, dtype family float — 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
score Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/semeval/utils/scorer.py
code served (permissive licence) · get_code("c4b42e34eb5cc2e9")
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 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 numpy as np

# The function expects:
# - key: a list/array of gold standard relation labels
# - prediction: a list/array of predicted relation labels
# - verbose: boolean flag for verbosity (optional, defaults to False)

# Create simple test data with relation labels
# Using 'Other' as the NO_RELATION sentinel value
key = [
    'Other',
    'Located_In',
    'Located_In',
    'Works_For',
    'Other',
    'Works_For',
    'Located_In',
]

prediction = [
    'Other',
    'Located_In',
    'Works_For',  # Wrong prediction
    'Works_For',
    'Located_In',  # Wrong prediction
    'Works_For',
    'Located_In',
]

ARGS = {
    'key': key,
    'prediction': prediction,
    'verbose': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — 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
tree_to_adj Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/model/tree.py
code served (permissive licence) · get_code("e47b743b525d74fe")
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 ndarray, ndim 2, dtype family float, shape (4, 4) 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 numpy as np

class TreeNode:
    def __init__(self, idx, children=None):
        self.idx = idx
        self.children = children if children is not None else []

# Create a simple tree structure
# Tree with 4 nodes:
#     0
#    / \
#   1   2
#  /
# 3
node3 = TreeNode(idx=3, children=[])
node1 = TreeNode(idx=1, children=[node3])
node2 = TreeNode(idx=2, children=[])
root = TreeNode(idx=0, children=[node1, node2])

sent_len = 4
tree = root
directed = True

ARGS = {
    "sent_len": sent_len,
    "tree": tree,
    "directed": directed,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) 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
tree_to_dist Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/model/tree.py
code served (permissive licence) · get_code("b836539d7a29d214")
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 ndarray, ndim 1, dtype family int, shape (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 numpy as np

class TreeNode:
    def __init__(self, idx, dist):
        self.idx = idx
        self.dist = dist

sent_len = 5
tree = [
    TreeNode(idx=0, dist=0),
    TreeNode(idx=1, dist=1),
    TreeNode(idx=2, dist=2),
    TreeNode(idx=3, dist=1),
    TreeNode(idx=4, dist=3),
]

ARGS = {
    "sent_len": sent_len,
    "tree": tree,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (5,) — shape (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
unpack_batch Ran
ran on a synthesized input
Cartus/AGGCN_TACRED/model/trainer.py
code served (permissive licence) · get_code("24ca48b2ae4c7be9")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.autograd import Variable

torch.manual_seed(0)

# The function expects batch to be a list/tuple where:
# - batch[0:10] are tensors (inputs)
# - batch[10] is a tensor (labels)
# - batch[5] is head data
# - batch[6] is subj_pos data
# - batch[7] is obj_pos data
# - batch[1] is a tensor that supports .eq(0).long().sum(1).squeeze()

# Create small tensors for inputs
input_tensors = [torch.randn(2, 4) for _ in range(10)]

# Create a label tensor
label_tensor = torch.randint(0, 5, (2,))

# Create head, subj_pos, obj_pos tensors
head_tensor = torch.randint(0, 3, (2, 4))
subj_pos_tensor = torch.randint(0, 4, (2,))
obj_pos_tensor = torch.randint(0, 4, (2,))

# Create tokens (batch[0])
tokens_tensor = torch.randint(0, 100, (2, 5))

# Create a tensor for batch[1] that supports .eq(0).long().sum(1)
# This needs to be 2D so .sum(1) makes sense
lens_tensor = torch.tensor([[0, 1, 2, 3, 4], [0, 0, 1, 2, 3]], dtype=torch.long)

# Construct the batch as a list
batch = [
    tokens_tensor,      # batch[0]
    lens_tensor,        # batch[1]
    torch.randn(2, 4),  # batch[2]
    torch.randn(2, 4),  # batch[3]
    torch.randn(2, 4),  # batch[4]
    head_tensor,        # batch[5]
    subj_pos_tensor,    # batch[6]
    obj_pos_tensor,     # batch[7]
    torch.randn(2, 4),  # batch[8]
    torch.randn(2, 4),  # batch[9]
    label_tensor,       # batch[10]
]

ARGS = {
    "batch": batch,
    "cuda": 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 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
unpack_batch Ran
ran on a synthesized input
Cartus/AGGCN/semeval/model/trainer.py
code served (permissive licence) · get_code("80ad2c5df3e82bb4")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.autograd import Variable

torch.manual_seed(0)

# The function expects batch to be a list/tuple where:
# - batch[0] = tokens (used as-is)
# - batch[1] = tensor with 0s (used with .eq(0).long().sum(1).squeeze())
# - batch[2:7] = 5 tensors (used as inputs)
# - batch[7] = labels tensor

# Create minimal tensors with distinct shapes for different dimensions
batch_size = 2
seq_len = 4

# batch[0]: tokens (can be any tensor, used as-is)
tokens = torch.randint(0, 100, (batch_size, seq_len))

# batch[1]: tensor where we check for 0s, needs to be 2D for sum(1).squeeze() to work
# Shape: (batch_size, seq_len)
padding_mask = torch.randint(0, 2, (batch_size, seq_len))

# batch[2:7]: 5 input tensors (each should be a tensor)
input_2 = torch.randn(batch_size, 3)
input_3 = torch.randn(batch_size, 5)
input_4 = torch.randn(batch_size, 6)
input_5 = torch.randn(batch_size, 7)  # batch[4] = head
input_6 = torch.randn(batch_size, 8)  # batch[5] = subj_pos
input_7 = torch.randn(batch_size, 9)  # batch[6] = obj_pos

# batch[7]: labels
labels = torch.randint(0, 10, (batch_size,))

# Construct the batch as a list
batch = [
    tokens,      # batch[0]
    padding_mask,  # batch[1]
    input_2,     # batch[2]
    input_3,     # batch[3]
    input_4,     # batch[4] - head
    input_5,     # batch[5] - subj_pos
    input_6,     # batch[6] - obj_pos
    labels       # batch[7]
]

ARGS = {
    'batch': batch,
    'cuda': 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 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

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 4 later) and 9 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
clones 79 other papers
11 dated earlier, 1 the same month, 67 later · 11 only as an assembly brick
1411.4555 (2014-11)
Show and Tell: A Neural Image Caption Generator
1612.00563 (2016-12)
Self-critical Sequence Training for Image Captioning
1706.03762 (2017-06)
Attention Is All You Need
and 76 more not named here
batched_index_select 2 other papers
2 later
2108.04024 (2021-08)
Image Retrieval on Real-life Images with Pre-trained Vision-and-Language Models
2201.12296 (2022-01)
Benchmarking Robustness of 3D Point Cloud Recognition Against Common Corruptions
attention 1 other paper
1 later
2303.10975 (2023-03)
VIMI: Vehicle-Infrastructure Multi-view Intermediate Fusion for Camera-based 3D Object Detection
score 1 other paper
1 later
2109.04711 (2021-09)
Pre-train or Annotate? Domain Adaptation with a Constrained Budget

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

Repositories linked to this paper

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

Abstract

Dependency trees convey rich structural information that is proven useful for extracting relations among entities in text. However, how to effectively make use of relevant information while ignoring irrelevant information from the dependency trees remains a challenging research question. Existing approaches employing rule based hard-pruning strategies for selecting relevant partial dependency structures may not always yield optimal results. In this work, we propose Attention Guided Graph Convolutional Networks (AGGCNs), a novel model which directly takes full dependency trees as inputs. Our model can be understood as a soft-pruning approach that automatically learns how to selectively attend to the relevant sub-structures useful for the relation extraction task. Extensive results on various tasks including cross-sentence n-ary relation extraction and large-scale sentence-level relation extraction show that our model is able to better leverage the structural information of the full dependency trees, giving significantly better results than previous approaches.

For agents

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

get_harvested_code_for_paper("1906.07510")
get_code_for_paper("1906.07510")
have("1906.07510")

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

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

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

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

Connect an agent — have() is free.