SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.05919 · NAACL · 2021

Document-Level Event Argument Extraction by Conditional Generation

Jiawei Han, Heng Ji, Sha Li

arXiv · PDF · Open in the Atlas

Code that ran

9 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, 1 violated it and 2 have no contract verdict; 6 failures of our instrument; 2 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/2104.05919.json · badge: /api/ran/2104.05919.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
raspberryice/gen-arg canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
check_coref Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
raspberryice/gen-arg/src/genie/convert_gen_to_output.py
code served (permissive licence) · get_code("d29d3fecf016262c")
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 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

# Analyze the function:
# - ex: a dict with key 'corefs' containing clusters
# - arg_span: a span value that will be checked for membership in clusters
# - gold_spans: a list of span values to match against

# arg_span and spans appear to be comparable/hashable values
# Clusters are iterables containing spans
# The function checks if arg_span is in any cluster, finds matching gold_spans in that cluster

# Simple span representation: tuples (start, end)
arg_span = (0, 2)
gold_spans = [(1, 3), (5, 7), (0, 2)]

# ex['corefs'] is a list of clusters, where each cluster contains spans
# Let's create a scenario where arg_span is in one of the clusters
ex = {
    'corefs': [
        [(0, 2), (2, 4), (1, 3)],  # cluster 1: contains arg_span (0, 2) and gold_span (1, 3)
        [(10, 12), (11, 13)],        # cluster 2: unrelated
    ]
}

ARGS = {
    'ex': ex,
    'arg_span': arg_span,
    'gold_spans': gold_spans,
}
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 1, 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
check_pronoun Ran
ran, violated the contract we drafted
raspberryice/gen-arg/src/genie/utils.py
code served (permissive licence) · get_code("9ce6efac63b8483f")
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.

# Setup code for check_pronoun function

# First, populate the global pronoun_set that the function uses
pronoun_set = {
    "i", "me", "you", "he", "him", "she", "her", "it", "we", "us", "they", "them",
    "my", "your", "his", "hers", "its", "our", "their"
}

# Define ARGS dict with the parameter
ARGS = {
    "text": "he"
}
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
clean_mention Ran
ran; our contract draft was wrong, not the code
raspberryice/gen-arg/src/genie/utils.py
code served (permissive licence) · get_code("cd97889fceb677b3")
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 str. 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)

# The function clean_mention takes a single parameter: text (a string)
# It removes common article prefixes from the beginning of the text
# No complex objects needed - just a string

ARGS = {
    'text': 'the quick brown fox'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
clean_span Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
raspberryice/gen-arg/src/genie/pipeline_scorer.py
code served (permissive licence) · get_code("0c5be628187d2af8")
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 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

torch.manual_seed(0)

# The function expects:
# - ex: a dict with a 'tokens' key containing a list of token strings
# - span: a tuple of two integers representing (start_index, end_index)

ex = {
    'tokens': ['the', 'quick', 'brown', 'fox', 'jumps']
}

span = (0, 3)

ARGS = {
    'ex': ex,
    'span': span
}
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 1, 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
extract_args_from_template Ran
ran; our contract draft was wrong, not the code
raspberryice/gen-arg/src/genie/pipeline_scorer.py
code served (permissive licence) · get_code("311da0dc94aa39ef")
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 re
from collections import defaultdict

# Construct the arguments for extract_args_from_template

# Create a minimal example dict
ex = {
    'predicted': 'The <arg> was attacked by <arg> yesterday',
    'event': {
        'event_type': 'Attack'
    }
}

# Create a template string with argument placeholders
template = 'The <arg1> was attacked by <arg2> yesterday'

# Create an ontology dict mapping event types to argument numbers and names
ontology_dict = {
    'Attack': {
        'arg1': 'victim',
        'arg2': 'attacker'
    }
}

ARGS = {
    'ex': ex,
    'template': template,
    'ontology_dict': ontology_dict
}
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 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
find_head Ran
ran on a synthesized input
raspberryice/gen-arg/viz/visualize_output_KAIROS.py
code served (permissive licence) · get_code("e45fdae8c3fc7fb0")
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 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
from collections import namedtuple

# Create a mock spaCy Token-like object
Token = namedtuple('Token', ['head', 'i'])

class MockHead:
    def __init__(self, i):
        self.i = i

class MockToken:
    def __init__(self, i, head_i):
        self.i = i
        self.head = MockHead(head_i)
    
    def __getitem__(self, idx):
        return self

# Create a mock doc (list-like object with indexable tokens)
class MockDoc:
    def __init__(self, tokens):
        self.tokens = tokens
    
    def __getitem__(self, idx):
        return self.tokens[idx]
    
    def __len__(self):
        return len(self.tokens)

# Construct test data:
# Create tokens where:
# - token 0 points to itself (head.i == 0)
# - token 1 points to token 0
# - token 2 points to token 1
# - token 3 points to token 2
tokens = [
    MockToken(i=0, head_i=0),  # self-pointing (root)
    MockToken(i=1, head_i=0),  # points to 0
    MockToken(i=2, head_i=1),  # points to 1
    MockToken(i=3, head_i=2),  # points to 2
]

doc = MockDoc(tokens)

# arg_start and arg_end define a span [2, 3]
# Starting from index 2:
# - doc[2].head.i = 1 (within range [2,3]? No, 1 < 2, so loop exits)
arg_start = 2
arg_end = 3

ARGS = {
    "arg_start": arg_start,
    "arg_end": arg_end,
    "doc": doc,
}
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 1, 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
get_event_type Ran
ran; our contract draft was wrong, not the code
raspberryice/gen-arg/src/genie/convert_gen_to_output.py
code served (permissive licence) · get_code("2d97ed4e5c2db314")
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
import numpy as np

torch.manual_seed(0)

# The function expects ex['evt_triggers'] to be iterable
# Each evt in evt_triggers should be indexable at position [2]
# evt[2] should be iterable, and each element t should be indexable at [0]

ex = {
    'evt_triggers': [
        # First trigger: evt[2] is a list of tuples where each tuple has at least one element
        (None, None, [('event_type_1',), ('event_type_2',)]),
        # Second trigger: another event with different types
        (None, None, [('event_type_3',)]),
        # Third trigger: multiple event types
        (None, None, [('event_type_4',), ('event_type_5',), ('event_type_6',)]),
    ]
}

ARGS = {
    'ex': ex
}
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 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
my_collate Ran
ran; our contract draft was wrong, not the code
raspberryice/gen-arg/src/genie/data.py
code served (permissive licence) · get_code("de4450d072db3735")
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

torch.manual_seed(0)

# Create a batch of example dictionaries
# Each example has the required keys with appropriate token IDs and attention masks
batch = [
    {
        'doc_key': 'doc_1',
        'input_token_ids': [101, 2054, 2003, 102],
        'input_attn_mask': [True, True, True, True],
        'tgt_token_ids': [101, 2054, 102, 0],
        'tgt_attn_mask': [True, True, True, False],
    },
    {
        'doc_key': 'doc_2',
        'input_token_ids': [101, 1045, 2572, 102],
        'input_attn_mask': [True, True, True, True],
        'tgt_token_ids': [101, 1045, 102, 0],
        'tgt_attn_mask': [True, True, True, False],
    },
]

ARGS = {
    'batch': batch,
}
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
safe_div Ran
ran on a synthesized input
raspberryice/gen-arg/src/genie/utils.py
code served (permissive licence) · get_code("ac4edaf53cf349f7")
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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# safe_div(num, denom) performs a comparison denom > 0, then division num / denom
# Both num and denom should support > comparison and division operations
# They can be scalars, tensors, or numpy arrays

# Simple scalar case
num = 10
denom = 5

ARGS = {
    "num": num,
    "denom": denom,
}
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 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
extract_args_from_template Not yet run
unverified (harvested, no recorded run)
raspberryice/gen-arg/src/genie/convert_gen_to_output.py
code served (permissive licence) · get_code("d5490a17a01f72e4")
How it ran

no invocation recorded.

find_arg_span Not yet run
unverified (harvested, no recorded run)
raspberryice/gen-arg/viz/visualize_output_KAIROS.py
code served (permissive licence) · get_code("47d4228f0f998334")
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, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 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
safe_div 3 other papers
3 later
2106.15838 (2021-06)
HySPA: Hybrid Span Generation for Scalable Text-to-Graph Extraction
2210.12582 (2022-10)
Language Model Pre-Training with Sparse Latent Typing
2304.11633 (2023-04)
Evaluating ChatGPT's Information Extraction Capabilities: An Assessment of Performance, Explainability, Calibration, and Faithfulness
find_head 1 other paper
1 later
2304.11633 (2023-04)
Evaluating ChatGPT's Information Extraction Capabilities: An Assessment of Performance, Explainability, Calibration, and Faithfulness

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

Event extraction has long been treated as a sentence-level task in the IE community. We argue that this setting does not match human information seeking behavior and leads to incomplete and uninformative extraction results. We propose a document-level neural event argument extraction model by formulating the task as conditional generation following event templates. We also compile a new document-level event extraction benchmark dataset WIKIEVENTS which includes complete event and coreference annotation. On the task of argument extraction, we achieve an absolute gain of 7.6% F1 and 5.7% F1 over the next best model on the RAMS and WIKIEVENTS datasets respectively. On the more challenging task of informative argument extraction, which requires implicit coreference reasoning, we achieve a 9.3% F1 gain over the best baseline. To demonstrate the portability of our model, we also create the first end-to-end zero-shot event extraction framework and achieve 97% of fully supervised model's trigger extraction performance and 82% of the argument extraction performance given only access to 10 out of the 33 types on ACE. 1 Prosecutors say he drove the truck to Geary Lake in Kansas, that 4,000 pounds of ammonium nitrate laced with nitromethane were loaded into the truck there, and that it was driven to Oklahoma City and detonated. Elliott testified that on April 15, McVeigh came into the body shop and reserved the truck, to be picked up at 4pm two days later. Elliott said that McVeigh gave him the $280.32 in exact change after declining to pay an additional amount for insurance.

For agents

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

get_harvested_code_for_paper("2104.05919")
get_code_for_paper("2104.05919")
have("2104.05919")

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

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

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

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

Connect an agent — have() is free.