SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1804.05685 · 2018

A Discourse-Aware Attention Model for Abstractive Summarization of Long Documents

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 7 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.05685.json · badge: /api/ran/1804.05685.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
acohan/long-summarization canonical (classifier label)
classifier basis: census
6 ran · 5 no recorded run
AlexGidiotis/DANCER-summ community (classifier label)
classifier basis not recorded on the link
1 ran · 2 no recorded run
FunctionStatusWhere it lives
abstract2ids Ran
ran, honoured the contract we drafted
acohan/long-summarization/data.py
code served (permissive licence) · get_code("fe1c05743cd67af2")
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 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.

class Vocabulary:
    def __init__(self):
        self._word2id = {
            '[UNK]': 0,
            'the': 1,
            'quick': 2,
            'brown': 3,
            'fox': 4,
            'jumps': 5,
            'over': 6,
            'lazy': 7,
            'dog': 8,
        }
        self._id2word = {v: k for k, v in self._word2id.items()}
    
    def word2id(self, word):
        return self._word2id.get(word, self._word2id['[UNK]'])
    
    def size(self):
        return len(self._word2id)

vocab = Vocabulary()

abstract_words = ['the', 'quick', 'brown', 'oov1', 'fox', 'oov2', 'jumps']

article_oovs = ['oov1', 'oov2', 'oov3']

ARGS = {
    'abstract_words': abstract_words,
    'vocab': vocab,
    'article_oovs': article_oovs,
}
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 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
article2ids Ran
ran; our contract draft was wrong, not the code
acohan/long-summarization/data.py
code served (permissive licence) · get_code("ecb10763ebbfe0bd")
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.

class Vocabulary:
    def __init__(self, word_to_id_dict):
        self.word_to_id_dict = word_to_id_dict
        self._size = len(word_to_id_dict)
    
    def word2id(self, word):
        return self.word_to_id_dict.get(word, self.word_to_id_dict['[UNK]'])
    
    def size(self):
        return self._size


vocab = Vocabulary({
    '[UNK]': 0,
    'the': 1,
    'quick': 2,
    'brown': 3,
    'fox': 4,
    'jumps': 5,
    'over': 6,
    'lazy': 7,
})

article_words = ['the', 'quick', 'brown', 'fox', 'unseen_word', 'another_oov', 'jumps']

ARGS = {
    'article_words': article_words,
    'vocab': vocab,
}
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 — 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
load_embeddings Ran
ran on a synthesized input
acohan/long-summarization/util.py
code served (permissive licence) · get_code("ab9862cbeb4502b8")
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 (5, 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 numpy as np
import tempfile
import os

# Create a temporary embedding file
temp_dir = tempfile.mkdtemp()
fpath = os.path.join(temp_dir, "embeddings.txt")

# Create a small embedding file
# Format: first line is "num_words vector_size"
# followed by lines: "word val1 val2 val3 ..."
with open(fpath, 'w') as f:
    f.write("5 3\n")  # 5 words, 3-dimensional vectors
    f.write("hello 0.1 0.2 0.3\n")
    f.write("world 0.4 0.5 0.6\n")
    f.write("foo 0.7 0.8 0.9\n")
    f.write("bar 1.0 1.1 1.2\n")
    f.write("baz 1.3 1.4 1.5\n")

# Create word_to_id mapping
word_to_id = {
    "hello": 0,
    "world": 1,
    "foo": 2,
    "bar": 3,
    "baz": 4,
}

ARGS = {
    "fpath": fpath,
    "word_to_id": word_to_id,
    "emd_init_var": 0.25,
}
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 (5, 3) — shape (5, 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
make_html_safe Ran
ran; our contract draft was wrong, not the code
acohan/long-summarization/decode.py
code served (permissive licence) · get_code("84fcb74e05d73aff")
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) 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

ARGS = {
    's': '<div>Hello</div>'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
outputids2words Ran
ran on a synthesized input
acohan/long-summarization/data.py
code served (permissive licence) · get_code("eca0776bc82826da")
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.

class MockVocab:
    def __init__(self):
        self._word_map = {
            0: "the",
            1: "cat",
            2: "sat",
            3: "on",
            4: "mat",
            5: "end"
        }
        self._vocab_size = len(self._word_map)
    
    def id2word(self, idx):
        if idx not in self._word_map:
            raise ValueError(f"ID {idx} not in vocabulary")
        return self._word_map[idx]
    
    def size(self):
        return self._vocab_size


ARGS = {
    "id_list": [0, 1, 2, 3, 4, 5, 6, 7],
    "vocab": MockVocab(),
    "article_oovs": ["rare_word_1", "rare_word_2"]
}
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
rouge_targets Ran
ran on a synthesized input
AlexGidiotis/DANCER-summ/src/full_prep.py
code served (permissive licence) · get_code("652b875f36ede145")
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

# Stand-in ROUGE scorer that mimics the interface used in rouge_targets
class MockRougeScorer:
    def score(self, text1, text2):
        # Returns a dict with 'rougeL' key containing a tuple
        # where index [1] is the recall score
        # Mock score based on text length similarity
        score = min(len(text1), len(text2)) / max(len(text1), len(text2), 1)
        return {'rougeL': (score, score, score)}

# Create sample data
abstract_sentences = [
    "This is the first abstract sentence.",
    "This is the second abstract sentence about something.",
    "Third sentence with more content here."
]

section_sentences = [
    "This is the first abstract sentence.",
    "Here is a different section sentence.",
    "Another section with related content.",
    "Final section sentence for comparison."
]

rg_scorer = MockRougeScorer()

ARGS = {
    "abstract_sentences": abstract_sentences,
    "section_sentences": section_sentences,
    "rg_scorer": rg_scorer
}
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
sort_hyps Ran
ran; our contract draft was wrong, not the code
acohan/long-summarization/beam_search.py
code served (permissive licence) · get_code("8891bb52fbe37510")
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

class Hypothesis:
    def __init__(self, avg_log_prob):
        self.avg_log_prob = avg_log_prob

hyp1 = Hypothesis(avg_log_prob=-0.5)
hyp2 = Hypothesis(avg_log_prob=-1.2)
hyp3 = Hypothesis(avg_log_prob=-0.8)

ARGS = {
    "hyps": [hyp1, hyp2, hyp3]
}
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
attention_decoder Not yet run
unverified (harvested, no recorded run)
acohan/long-summarization/attention_decoder_new.py
code served (permissive licence) · get_code("e099bb1c118a98d5")
How it ran

no invocation recorded.

calc_running_avg_loss Not yet run
unverified (harvested, no recorded run)
acohan/long-summarization/run_summarization.py
code served (permissive licence) · get_code("dfba7977a83de9b4")
How it ran

no invocation recorded.

init_loader Not yet run
unverified (harvested, no recorded run)
AlexGidiotis/DANCER-summ/src/loaders.py
code served (permissive licence) · get_code("e9773eff8ddf3122")
How it ran

no invocation recorded.

linear Not yet run
unverified (harvested, no recorded run)
acohan/long-summarization/attention_decoder.py
code served (permissive licence) · get_code("75bf8deb2b42c686")
How it ran

no invocation recorded.

linear_weight_sharing Not yet run
unverified (harvested, no recorded run)
acohan/long-summarization/attention_decoder_new.py
code served (permissive licence) · get_code("fee6d1051182f149")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
AlexGidiotis/DANCER-summ/src/loaders.py
code served (permissive licence) · get_code("6a3b6c3e04b98ed4")
How it ran

no invocation recorded.

rouge_log Not yet run
unverified (harvested, no recorded run)
acohan/long-summarization/decode.py
code served (permissive licence) · get_code("47c13473d0a48d39")
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, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 later) and 8 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
make_html_safe 4 other papers
4 later
1805.06266 (2018-05)
A Unified Model for Extractive and Abstractive Summarization using Inconsistency Loss
1805.09461 (2018-05)
Deep Reinforcement Learning For Sequence to Sequence Models
1908.10835 (2019-08)
An Empirical Comparison on Imitation Learning and Reinforcement Learning for Paraphrase Generation
and 1 more not named here
sort_hyps 3 other papers
3 later
1805.06266 (2018-05)
A Unified Model for Extractive and Abstractive Summarization using Inconsistency Loss
1805.09461 (2018-05)
Deep Reinforcement Learning For Sequence to Sequence Models
1808.10122 (2018-08)
Learning Neural Templates for Text Generation
abstract2ids 2 other papers
2 later
1805.09461 (2018-05)
Deep Reinforcement Learning For Sequence to Sequence Models
1908.10835 (2019-08)
An Empirical Comparison on Imitation Learning and Reinforcement Learning for Paraphrase Generation
article2ids 2 other papers
2 later
1805.09461 (2018-05)
Deep Reinforcement Learning For Sequence to Sequence Models
1908.10835 (2019-08)
An Empirical Comparison on Imitation Learning and Reinforcement Learning for Paraphrase Generation
linear 1 other paper
1 later
1805.06266 (2018-05)
A Unified Model for Extractive and Abstractive Summarization using Inconsistency Loss
outputids2words 1 other paper
1 later
1805.09461 (2018-05)
Deep Reinforcement Learning For Sequence to Sequence Models

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

Neural abstractive summarization models have led to promising results in summarizing relatively short documents. We propose the first model for abstractive summarization of single, longer-form documents (e.g., research papers). Our approach consists of a new hierarchical encoder that models the discourse structure of a document, and an attentive discourse-aware decoder to generate the summary. Empirical results on two large-scale datasets of scientific papers show that our model significantly outperforms state-of-the-art models.

For agents

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

get_harvested_code_for_paper("1804.05685")
get_code_for_paper("1804.05685")
have("1804.05685")

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

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

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

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

Connect an agent — have() is free.