SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.12724 · 2021

DEGREE: A Data-Efficient Generation-Based Event Extraction Model

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 4 have no contract verdict; 0 failures of our instrument; 0 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/2108.12724.json · badge: /api/ran/2108.12724.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
pluslabnlp/degree canonical (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
FunctionStatusWhere it lives
get_role_list Ran
ran on a synthesized input
pluslabnlp/degree/degree/data.py
code served (permissive licence) · get_code("3eb2f0880859dfac")
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 3, 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

# Construct valid arguments for get_role_list function

entities = [
    {
        'id': 'entity_1',
        'start': 10,
        'end': 15
    },
    {
        'id': 'entity_2',
        'start': 20,
        'end': 25
    },
    {
        'id': 'entity_3',
        'start': 30,
        'end': 35
    }
]

events = [
    {
        'trigger': {
            'start': 0,
            'end': 5
        },
        'event_type': 'type_A',
        'arguments': [
            {
                'entity_id': 'entity_1',
                'role': 'role_1'
            },
            {
                'entity_id': 'entity_2',
                'role': 'role_2'
            }
        ]
    },
    {
        'trigger': {
            'start': 40,
            'end': 45
        },
        'event_type': 'type_B',
        'arguments': [
            {
                'entity_id': 'entity_2',
                'role': 'role_3'
            },
            {
                'entity_id': 'entity_3',
                'role': 'role_4'
            }
        ]
    }
]

id_map = {
    'entity_1': 'entity_1',
    'entity_2': 'entity_2',
    'entity_3': 'entity_3'
}

ARGS = {
    'entities': entities,
    'events': events,
    'id_map': id_map
}
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 3, 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
get_span_idx Ran
ran on a synthesized input
pluslabnlp/degree/degree/eval_pipelineEE.py
code served (permissive licence) · get_code("44c175e5c1dc9629")
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 numpy as np

class SimpleTokenizer:
    def encode(self, text, add_special_tokens=False):
        # Simple tokenizer that splits text and returns token IDs
        words = text.split()
        return list(range(len(words)))
    
    def decode(self, token_id):
        # Return empty string for some tokens to simulate special tokens
        if token_id in [0, 1]:
            return ''
        return f'word_{token_id}'

# Create test data
tokenizer = SimpleTokenizer()

# pieces: tokenized representation of original text
pieces = [0, 1, 2, 3, 4, 5, 6, 7, 8]

# token_start_idxs: indices where tokens start in the original text
token_start_idxs = [0, 1, 2, 3, 4, 5, 6, 7, 8]

# span: the predicted span text to search for
span = "word_3 word_4"

# trigger_span: optional trigger span for relation extraction tasks
# Format: (start_idx, end_idx)
trigger_span = (2, 5)

ARGS = {
    'pieces': pieces,
    'token_start_idxs': token_start_idxs,
    'span': span,
    'tokenizer': tokenizer,
    'trigger_span': trigger_span
}
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 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_span_idx_tri Ran
ran on a synthesized input
pluslabnlp/degree/degree/eval_pipelineEE.py
code served (permissive licence) · get_code("a85a17737108ee7a")
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 2, 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 numpy as np

class MockTokenizer:
    """Minimal tokenizer mock that implements encode and decode methods."""
    
    def encode(self, text, add_special_tokens=False):
        """Split text into simple token ids."""
        tokens = text.lower().split()
        return [hash(t) % 1000 for t in tokens]
    
    def decode(self, token_id):
        """Decode a token id - return empty string for special tokens."""
        if token_id < 0:
            return ''
        return ''

tokenizer = MockTokenizer()

# pieces: list of token ids from the original tokenized text
pieces = [101, 2054, 2003, 2009, 102, 999, 888, 777]

# token_start_idxs: indices marking token starts in original sequence
token_start_idxs = [0, 1, 2, 3, 4, 5, 6, 7]

# span: the text span we're trying to find in pieces
span = "what is"

# trigger_span: optional span for argument extraction (tuple of indices)
trigger_span = (1, 3)

ARGS = {
    'pieces': pieces,
    'token_start_idxs': token_start_idxs,
    'span': span,
    'tokenizer': tokenizer,
    'trigger_span': trigger_span
}
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 list, ndim 2, dtype family int — 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
remove_overlap_entities Ran
ran on a synthesized input
pluslabnlp/degree/degree/data.py
code served (permissive licence) · get_code("f4a2f4aa3f6a7368")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Construct a list of entity mentions with overlapping and non-overlapping entities
entities = [
    {
        'id': 1,
        'start': 10,
        'end': 15
    },
    {
        'id': 2,
        'start': 12,
        'end': 18
    },
    {
        'id': 3,
        'start': 20,
        'end': 25
    },
    {
        'id': 4,
        'start': 20,
        'end': 23
    },
    {
        'id': 5,
        'start': 30,
        'end': 35
    }
]

ARGS = {
    'entities': entities
}
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 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_role_list 1 other paper
1 later
2022.naacl-main.138 (2022 (year only))
DEGREE: A Data-Efficient Generation-Based Event Extraction Model
get_span_idx 1 other paper
1 later
2022.naacl-main.138 (2022 (year only))
DEGREE: A Data-Efficient Generation-Based Event Extraction Model
get_span_idx_tri 1 other paper
1 later
2022.naacl-main.138 (2022 (year only))
DEGREE: A Data-Efficient Generation-Based Event Extraction Model
remove_overlap_entities 1 other paper
1 later
2022.naacl-main.138 (2022 (year only))
DEGREE: A Data-Efficient Generation-Based Event Extraction Model

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 requires high-quality expert human annotations, which are usually expensive. Therefore, learning a data-efficient event extraction model that can be trained with only a few labeled examples has become a crucial challenge. In this paper, we focus on low-resource end-to-end event extraction and propose DEGREE, a data-efficient model that formulates event extraction as a conditional generation problem. Given a passage and a manually designed prompt, DEGREE learns to summarize the events mentioned in the passage into a natural sentence that follows a predefined pattern. The final event predictions are then extracted from the generated sentence with a deterministic algorithm. DEGREE has three advantages to learn well with less training data. First, our designed prompts provide semantic guidance for DEGREE to leverage DEGREE and thus better capture the event arguments. Moreover, DEGREE is capable of using additional weakly-supervised information, such as the description of events encoded in the prompts. Finally, DEGREE learns triggers and arguments jointly in an end-to-end manner, which encourages the model to better utilize the shared knowledge and dependencies among them. Our experimental results demonstrate the strong performance of DEGREE for low-resource event extraction.

For agents

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

get_harvested_code_for_paper("2108.12724")
get_code_for_paper("2108.12724")
have("2108.12724")

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

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

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

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

Connect an agent — have() is free.