SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1804.08199 · 2018

Linguistically-Informed Self-Attention for Semantic Role Labeling

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 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 9 have no contract verdict; 0 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/1804.08199.json · badge: /api/ran/1804.08199.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
strubell/LISA canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
FunctionStatusWhere it lives
accuracy_np Ran
ran on a synthesized input
strubell/LISA/src/evaluation_fns_np.py
code served (permissive licence) · get_code("e17ea0fc4873cd3e")
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 float64, ndim 0, 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

# Create small numpy arrays for predictions and targets
predictions = np.array([0, 1, 0, 1], dtype=np.int32)
targets = np.array([0, 1, 1, 1], dtype=np.int32)

# Create a mask (boolean array indicating which samples to count)
mask = np.array([1, 1, 1, 0], dtype=np.int32)

# Create an accumulator dictionary to track cumulative correct and total counts
accumulator = {
    'correct': 0,
    'total': 0
}

ARGS = {
    'predictions': predictions,
    'targets': targets,
    'mask': mask,
    'accumulator': accumulator
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
convert_conll Ran
ran on a synthesized input
strubell/LISA/src/evaluation_fns_np.py
code served (permissive licence) · get_code("03c2cf6d3b1daf1b")
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 map. 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

# Setup for convert_conll function
# The function takes predicted_roles (sequence of role labels)
# and converts them to CoNLL format

# Create a sequence of predicted role labels
# Mix of actual role strings and underscore strings
predicted_roles = ['ARG0', '_', 'ARG1', 'ARGM-TMP']

ARGS = {
    'predicted_roles': predicted_roles
}
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 map — a map output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a map 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_default Ran
ran on a synthesized input
strubell/LISA/src/constants.py
code served (permissive licence) · get_code("c2f375306505868b")
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 torch
import time

torch.manual_seed(0)

# The function get_default(name) takes a single string parameter 'name'
# and looks it up in the hparams dictionary, returning the value or exiting if not found.
# The only parameter is 'name' which should be a string key.

ARGS = {
    'name': 'learning_rate'
}
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 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
get_params Ran
ran on a synthesized input
strubell/LISA/src/attention_fns.py
code served (permissive licence) · get_code("0e84978dc1139b65")
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 dict. 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 torch.nn as nn

torch.manual_seed(0)

# Define mode
mode = "train"

# Define attn_map with params that reference labels, features, and layers
attn_map = {
    'params': {
        'param_from_label': {'label': 'loss'},
        'param_from_feature': {'feature': 'embedding'},
        'param_from_layer': {'layer': 0, 'output': 'logits'},
        'param_from_value': {'value': 42}
    }
}

# Define train_outputs - a dict mapping layer indices to dicts with output keys
train_outputs = {
    0: {
        'logits': torch.randn(2, 4),
        'hidden': torch.randn(2, 3)
    },
    1: {
        'logits': torch.randn(2, 5),
        'hidden': torch.randn(2, 6)
    }
}

# Define features - a dict mapping feature names to tensors
features = {
    'embedding': torch.randn(2, 8),
    'normalized': torch.randn(2, 4)
}

# Define labels - a dict mapping label names to tensors or values
labels = {
    'loss': torch.tensor(0.5),
    'accuracy': torch.tensor(0.85),
    'class_ids': torch.tensor([0, 1])
}

ARGS = {
    'mode': mode,
    'attn_map': attn_map,
    'train_outputs': train_outputs,
    'features': features,
    'labels': labels
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
int_to_str_lookup_table Ran
ran on a synthesized input
strubell/LISA/src/nn_utils.py
code served (permissive licence) · get_code("caca64fca95608c5")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

# Construct inputs as a TensorFlow tensor containing integer indices
inputs = tf.constant([0, 1, 2, 1, 0], dtype=tf.int32)

# Construct lookup_map as a dictionary mapping integers to string values
lookup_map = {
    0: "apple",
    1: "banana",
    2: "cherry",
    3: "date"
}

ARGS = {
    "inputs": inputs,
    "lookup_map": lookup_map
}
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 SymbolicTensor — a SymbolicTensor 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
lowercase_converter Ran
ran on a synthesized input
strubell/LISA/src/data_converters.py
code served (permissive licence) · get_code("413d686580cb441b")
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)

split_line = ["Hello", "World", "Python", "Test"]
idx = 1

ARGS = {
    "split_line": split_line,
    "idx": idx
}
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
map_strings_to_ints Ran
ran on a synthesized input
strubell/LISA/src/dataset.py
code served (permissive licence) · get_code("c7484be80663fcc6")
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 tensorflow as tf

class MockVocabLookupOp:
    def __init__(self, vocab_name):
        self.vocab_name = vocab_name
    
    def lookup(self, x):
        # Mock lookup that converts strings to integers
        # Return tensor of same shape with int64 values
        return tf.cast(tf.ones_like(x, dtype=tf.int64), tf.int64)

# Create vocab lookup ops dictionary
vocab_lookup_ops = {
    'vocab_1': MockVocabLookupOp('vocab_1'),
    'vocab_2': MockVocabLookupOp('vocab_2'),
}

# Create data config with different feature configurations
data_config = {
    'feature_1': {
        'vocab': 'vocab_1',
        'type': 'range',
        'conll_idx': [0, 2]
    },
    'feature_2': {
        'vocab': 'vocab_2'
    },
    'feature_3': {
        # No vocab, will use string_to_number
    }
}

# Feature label names
feature_label_names = ['feature_1', 'feature_2', 'feature_3']

ARGS = {
    'vocab_lookup_ops': vocab_lookup_ops,
    'data_config': data_config,
    'feature_label_names': feature_label_names
}
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
parse_roots_self_loop_converter Ran
ran on a synthesized input
strubell/LISA/src/data_converters.py
code served (permissive licence) · get_code("deaa9d2fd33c5349")
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

# The function expects:
# - split_line: a list-like object that can be indexed
# - idx: a list-like object with at least 2 elements (idx[0] and idx[1])

# Create a sample split_line (simulating a parsed line with string numbers)
split_line = ["0", "42", "100", "200"]

# Create idx with two indices
idx = [0, 1]

ARGS = {
    "split_line": split_line,
    "idx": idx
}
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
strip_conll12_domain_converter Ran
ran on a synthesized input
strubell/LISA/src/data_converters.py
code served (permissive licence) · get_code("15dbbde62d34c21c")
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

def strip_conll12_domain_converter(split_line, idx):
    return [split_line[idx].split('/')[0]]

ARGS = {
    'split_line': ['word1/domain1', 'word2/domain2', 'word3/domain3'],
    'idx': 1
}
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
accuracy_tf Not yet run
unverified (harvested, no recorded run)
strubell/LISA/src/evaluation_fns.py
code served (permissive licence) · get_code("a8b322b3e51e24de")
How it ran

no invocation recorded.

convert_bilou Not yet run
unverified (harvested, no recorded run)
strubell/LISA/src/evaluation_fns_np.py
code served (permissive licence) · get_code("9d94a9256be463e0")
How it ran

no invocation recorded.

create_metric_variable Not yet run
unverified (harvested, no recorded run)
strubell/LISA/src/evaluation_fns.py
code served (permissive licence) · get_code("d5c0e80895ba13a2")
How it ran

no invocation recorded.

leaky_relu Not yet run
unverified (harvested, no recorded run)
strubell/LISA/src/nn_utils.py
code served (permissive licence) · get_code("ea3b43b22b209a25")
How it ran

no invocation recorded.

set_vars_to_moving_average Not yet run
unverified (harvested, no recorded run)
strubell/LISA/src/nn_utils.py
code served (permissive licence) · get_code("bbf19f387d296223")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 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 14 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

Current state-of-the-art semantic role labeling (SRL) uses a deep neural network with no explicit linguistic features. However, prior work has shown that gold syntax trees can dramatically improve SRL decoding, suggesting the possibility of increased accuracy from explicit modeling of syntax. In this work, we present linguistically-informed self-attention (LISA): a neural network model that combines multi-head self-attention with multi-task learning across dependency parsing, part-of-speech tagging, predicate detection and SRL. Unlike previous models which require significant pre-processing to prepare linguistic features, LISA can incorporate syntax using merely raw tokens as input, encoding the sequence only once to simultaneously perform parsing, predicate detection and role labeling for all predicates. Syntax is incorporated by training one attention head to attend to syntactic parents for each token. Moreover, if a high-quality syntactic parse is already available, it can be beneficially injected at test time without re-training our SRL model. In experiments on CoNLL-2005 SRL, LISA achieves new state-of-the-art performance for a model using predicted predicates and standard word embeddings, attaining 2.5 F1 absolute higher than the previous state-of-the-art on newswire and more than 3.5 F1 on out-of-domain data, nearly 10% reduction in error. On ConLL-2012 English SRL we also show an improvement of more than 2.5 F1. LISA also out-performs the state-of-the-art with contextually-encoded (ELMo) word representations, by nearly 1.0 F1 on news and more than 2.0 F1 on out-of-domain text.

For agents

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

get_harvested_code_for_paper("1804.08199")
get_code_for_paper("1804.08199")
have("1804.08199")

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

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

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

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

Connect an agent — have() is free.