SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1704.04368 · 2017

Get To The Point: Summarization with Pointer-Generator Networks

Christopher Manning, Peter Liu, Abigail See

arXiv · PDF · Open in the Atlas

Code that ran

30 of 64 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (11 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 2 violated it and 19 have no contract verdict; 5 failures of our instrument; 34 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/1704.04368.json · badge: /api/ran/1704.04368.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
steph1793/Pointer_Transformer_Generator community
not in the paper's declared repositories
9 ran · 2 no recorded run
jiminsun/pointer-generator community
Papers with Code archive
7 ran · 1 no recorded run
zide05/pointer-gen-fastnlp community
not in the paper's declared repositories
3 ran · 7 no recorded run
NirmalenduPrakash/DocumentSummarizer community
Papers with Code archive
3 ran · 5 no recorded run
AIKevin/Pointer_Generator_Summarizer community
Papers with Code archive
2 ran · 6 no recorded run
rohithreddy024/Text-Summarizer-Pytorch community
Papers with Code archive
2 ran · 6 no recorded run
steph1793/Pointer_Generator_Summarizer community
not in the paper's declared repositories
2 ran · 4 no recorded run
Iwontbecreative/Abstractive-summarization-OpenNMT community
Papers with Code archive
1 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
sblayush/summarization community
not in the paper's declared repositories
0 ran · 1 no recorded run
ishtoo1/Text-Summarization-using-Pointer-Generator-Model community
Papers with Code archive
0 ran · 1 no recorded run
sanjeevkrn/teaser_generate community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
Attention Ran
ran on a synthesized input
jiminsun/pointer-generator/models/model.py
code served (permissive licence) · get_code("cc3e0df6c9cadffc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, 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 torch.nn as nn
import torch.nn.functional as F

class Attention(nn.Module):
    """
    Attention mechanism based on Bahdanau et al. (2015) - Eq. (1)(2)
    augmented with Coverage mechanism - Eq. (11)
    B : batch size
    L : source text length
    H : encoder hidden state dimension
    """

    def __init__(self, hidden_dim, use_coverage):
        super().__init__()
        self.v = nn.Linear(hidden_dim * 2, 1, bias=False)
        self.enc_proj = nn.Linear(hidden_dim * 2, hidden_dim * 2, bias=False)
        self.dec_proj = nn.Linear(hidden_dim, hidden_dim * 2, bias=True)
        self.use_coverage = use_coverage
        if self.use_coverage:
            self.w_c = nn.Linear(1, hidden_dim * 2, bias=False)

    def forward(self, dec_input, coverage, enc_hidden, enc_pad_mask):
        """
        Args:
            dec_input: decoder hidden state             [B x H]
            coverage: coverage vector                   [B x L]
            enc_hidden: encoder hidden states           [B x L x 2H]
            enc_pad_mask: encoder padding masks         [B x L]

        Returns:
            attn_dist: attention dist'n over src tokens [B x L]
        """
        enc_feature = self.enc_proj(enc_hidden)
        dec_feature = self.dec_proj(dec_input)
        dec_feature = dec_feature.unsqueeze(1)
        scores = enc_feature + dec_feature
        if self.use_coverage:
            coverage = coverage.unsqueeze(-1)
            cov_feature = self.w_c(coverage)
            scores = scores + cov_feature
        scores = torch.tanh(scores)
        scores = self.v(scores)
        scores = scores.squeeze(-1)
        if enc_pad_mask is not None:
            scores = scores.float().masked_fill_(enc_pad_mask, float('-inf')).type_as(scores)
        attn_dist = F.softmax(scores, dim=-1)
        return attn_dist


INIT_ARGS = {
    'hidden_dim': 4,
    'use_coverage': True,
}

ARGS = {
    'dec_input': torch.randn(2, 4),
    'coverage': torch.randn(2, 3),
    'enc_hidden': torch.randn(2, 3, 8),
    'enc_pad_mask': torch.zeros(2, 3, dtype=torch.bool),
}

if __name__ == '__main__':
    model = Attention(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
AttnDecoder Ran
ran on a synthesized input · constructed an object; no result was computed
jiminsun/pointer-generator/models/model.py
code served (permissive licence) · get_code("6db9ed493ffd1554")
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 an instance of its own class, AttnDecoder: the run constructed the object and did not call it, so no result was computed. 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)

# Parameters for AttnDecoder
batch_size = 2
input_dim = 5  # embedding size (E)
hidden_dim = 4  # decoder hidden state dimension (H)
vocab_size = 10  # vocabulary size (V)
use_coverage = True

# Tensor dimensions:
# B = batch_size = 2
# L = source text length = 3
# E = input_dim = 5
# H = hidden_dim = 4
# 2H = 8 (encoder hidden state dimension)
# V = vocab_size = 10

source_length = 3

# Create sample tensors
dec_input = torch.randn(batch_size, input_dim)  # [B x E]
prev_h = torch.randn(batch_size, hidden_dim)  # [B x H]
prev_c = torch.randn(batch_size, hidden_dim)  # [B x H]
enc_hidden = torch.randn(batch_size, source_length, hidden_dim * 2)  # [B x L x 2H]
enc_pad_mask = torch.zeros(batch_size, source_length, dtype=torch.bool)  # [B x L]
coverage = torch.randn(batch_size, source_length)  # [B x L]

ARGS = {
    'input_dim': input_dim,
    'hidden_dim': hidden_dim,
    'vocab_size': vocab_size,
    'use_coverage': use_coverage,
}
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 AttnDecoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AttnDecoder 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
BahdanauAttention Ran
ran on a synthesized input · constructed an object; no result was computed
steph1793/Pointer_Generator_Summarizer/model.py
pointer only (licence: NONE) · get_code("a9fe6612eee87099")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, steph1793/Pointer_Generator_Summarizer 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.

Beam Ran
ran on a synthesized input · constructed an object; no result was computed
zide05/pointer-gen-fastnlp/model/model.py
pointer only (licence: NONE) · get_code("d0573c4de7b89c13")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zide05/pointer-gen-fastnlp 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.

CopyGenerator Ran
ran on a synthesized input · constructed an object; no result was computed
Iwontbecreative/Abstractive-summarization-OpenNMT/onmt/modules/CopyGenerator.py
code served (permissive licence) · get_code("ca9aebae1c1d68f1")
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 an instance of its own class, CopyGenerator: the run constructed the object and did not call it, so no result was computed. 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
import torch.nn.functional as F
import types as _types

torch.manual_seed(0)

# Create a minimal config object with required attributes
class Config:
    def __init__(self):
        self.rnn_size = 4
        self.tgt_word_vec_size = 3

opt = Config()

# Create minimal dictionaries with required stoi attribute
class MinimalDict:
    def __init__(self, size):
        self.size = size
        self.stoi = {'<pad>': 0}  # PAD_WORD token
    
    def __len__(self):
        return self.size

# Define onmt.IO.PAD_WORD
class IO:
    PAD_WORD = '<pad>'

class OnmtNamespace:
    IO = IO

onmt = OnmtNamespace()

src_dict = MinimalDict(10)
tgt_dict = MinimalDict(8)

# Create sample tensors matching the function's expectations
batch_size = 2
tlen = 3  # target length
slen = 5  # source length
rnn_size = 4
tgt_word_vec_size = 3

hidden = torch.randn(batch_size * tlen, rnn_size)  # [batch*tlen, rnn_size]
attn = torch.randn(batch_size * tlen, slen)  # [batch*tlen, slen]
src_map = torch.randn(slen, batch_size, len(tgt_dict))  # [slen, batch, cvocab]
rnn_output = torch.randn(batch_size * tlen, rnn_size)  # [batch*tlen, rnn_size]
src_emb = torch.randn(batch_size * tlen, tgt_word_vec_size)  # [batch*tlen, tgt_word_vec_size]

ARGS = {
    'opt': opt,
    'src_dict': src_dict,
    'tgt_dict': tgt_dict,
    'pointer_gen': 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 CopyGenerator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CopyGenerator 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
DecoderLayer Ran
ran on a synthesized input
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("1148acdcc26decf0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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 tensorflow as tf
import numpy as np

# Helper functions and classes from the provided code
def scaled_dot_product_attention(q, k, v, mask):
    matmul_qk = tf.matmul(q, k, transpose_b=True)
    dk = tf.cast(tf.shape(k)[-1], tf.float32)
    scaled_attention_logits = matmul_qk / tf.math.sqrt(dk)
    if mask is not None:
        scaled_attention_logits += mask * -1000000000.0
    attention_weights = tf.nn.softmax(scaled_attention_logits, axis=-1)
    output = tf.matmul(attention_weights, v)
    return (output, attention_weights)

class MultiHeadAttention(tf.keras.layers.Layer):
    def __init__(self, d_model, num_heads):
        super(MultiHeadAttention, self).__init__()
        self.num_heads = num_heads
        self.d_model = d_model
        assert d_model % self.num_heads == 0
        self.depth = d_model // self.num_heads
        self.wq = tf.keras.layers.Dense(d_model)
        self.wk = tf.keras.layers.Dense(d_model)
        self.wv = tf.keras.layers.Dense(d_model)
        self.dense = tf.keras.layers.Dense(d_model)

    def split_heads(self, x, batch_size):
        x = tf.reshape(x, (batch_size, -1, self.num_heads, self.depth))
        return tf.transpose(x, perm=[0, 2, 1, 3])

    def call(self, v, k, q, mask):
        batch_size = tf.shape(q)[0]
        q = self.wq(q)
        k = self.wk(k)
        v = self.wv(v)
        q = self.split_heads(q, batch_size)
        k = self.split_heads(k, batch_size)
        v = self.split_heads(v, batch_size)
        scaled_attention, attention_weights = scaled_dot_product_attention(q, k, v, mask)
        scaled_attention = tf.transpose(scaled_attention, perm=[0, 2, 1, 3])
        concat_attention = tf.reshape(scaled_attention, (batch_size, -1, self.d_model))
        output = self.dense(concat_attention)
        return (output, attention_weights)

def point_wise_feed_forward_network(d_model, dff):
    return tf.keras.Sequential([
        tf.keras.layers.Dense(dff, activation='relu'),
        tf.keras.layers.Dense(d_model)
    ])

class DecoderLayer(tf.keras.layers.Layer):
    def __init__(self, d_model, num_heads, dff, rate=0.1):
        super(DecoderLayer, self).__init__()
        self.mha1 = MultiHeadAttention(d_model, num_heads)
        self.mha2 = MultiHeadAttention(d_model, num_heads)
        self.ffn = point_wise_feed_forward_network(d_model, dff)
        self.layernorm1 = tf.keras.layers.LayerNormalization(epsilon=1e-06)
        self.layernorm2 = tf.keras.layers.LayerNormalization(epsilon=1e-06)
        self.layernorm3 = tf.keras.layers.LayerNormalization(epsilon=1e-06)
        self.dropout1 = tf.keras.layers.Dropout(rate)
        self.dropout2 = tf.keras.layers.Dropout(rate)
        self.dropout3 = tf.keras.layers.Dropout(rate)

    def call(self, x, enc_output, training, look_ahead_mask, padding_mask):
        attn1, attn_weights_block1 = self.mha1(x, x, x, look_ahead_mask)
        attn1 = self.dropout1(attn1, training=training)
        out1 = self.layernorm1(attn1 + x)
        attn2, attn_weights_block2 = self.mha2(enc_output, enc_output, out1, padding_mask)
        attn2 = self.dropout2(attn2, training=training)
        out2 = self.layernorm2(attn2 + out1)
        ffn_output = self.ffn(out2)
        ffn_output = self.dropout3(ffn_output, training=training)
        out3 = self.layernorm3(ffn_output + out2)
        return (out3, attn_weights_block1, attn_weights_block2)

INIT_ARGS = {
    'd_model': 4,
    'num_heads': 2,
    'dff': 8,
    'rate': 0.1
}

ARGS = {
    'x': tf.constant(np.random.randn(2, 3, 4).astype(np.float32)),
    'enc_output': tf.constant(np.random.randn(2, 5, 4).astype(np.float32)),
    'training': False,
    'look_ahead_mask': None,
    'padding_mask': None
}

METHOD = 'call'

if __name__ == '__main__':
    decoder_layer = DecoderLayer(**INIT_ARGS)
    output = decoder_layer(**ARGS)
    print("Output shape:", output[0].shape)
    print("Attention weights block 1 shape:", output[1].shape)
    print("Attention weights block 2 shape:", output[2].shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, tensorflow — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Embedding Ran
ran on a synthesized input · constructed an object; no result was computed
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("29f76cba1aca3bcc")
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 an instance of its own class, Embedding: the run constructed the object and did not call it, so no result was computed. 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

def get_angles(pos, i, d_model):
    angle_rates = 1 / np.power(10000, 2 * (i // 2) / np.float32(d_model))
    return pos * angle_rates

def positional_encoding(position, d_model):
    angle_rads = get_angles(np.arange(position)[:, np.newaxis], np.arange(d_model)[np.newaxis, :], d_model)
    angle_rads[:, 0::2] = np.sin(angle_rads[:, 0::2])
    angle_rads[:, 1::2] = np.cos(angle_rads[:, 1::2])
    pos_encoding = angle_rads[np.newaxis, ...]
    return tf.cast(pos_encoding, dtype=tf.float32)

class Embedding(tf.keras.layers.Layer):

    def __init__(self, vocab_size, d_model):
        super(Embedding, self).__init__()
        self.vocab_size = vocab_size
        self.d_model = d_model
        self.embedding = tf.keras.layers.Embedding(vocab_size, d_model)
        self.pos_encoding = positional_encoding(vocab_size, d_model)

    def call(self, x):
        embed_x = self.embedding(x)
        embed_x *= tf.math.sqrt(tf.cast(self.d_model, tf.float32))
        embed_x += self.pos_encoding[:, :tf.shape(x)[1], :]
        return embed_x

vocab_size = 16
d_model = 8

ARGS = {
    'vocab_size': vocab_size,
    'd_model': d_model,
}
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 Embedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Embedding 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
Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
zide05/pointer-gen-fastnlp/model/model.py
pointer only (licence: NONE) · get_code("edcc1fc3e330805d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zide05/pointer-gen-fastnlp 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.

Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("9b467256c6c83767")
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 an instance of its own class, Encoder: the run constructed the object and did not call it, so no result was computed. 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

# Define the ARGS dict with all parameters for Encoder.__init__
ARGS = {
    'num_layers': 2,
    'num_heads': 2,
    'd_model': 4,
    'dff': 8,
    'input_vocab_size': 100,
    'rate': 0.1
}
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 Encoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Encoder 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
Encoder Ran
ran on a synthesized input
jiminsun/pointer-generator/models/model.py
code served (permissive licence) · get_code("5fa0e46aae3e2283")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence
from torch.nn.utils.rnn import pad_packed_sequence

class Encoder(nn.Module):
    """
    Single-layer bidirectional LSTM
    B : batch size
    E : embedding size
    H : encoder hidden state dimension
    L : sequence length
    """

    def __init__(self, input_dim, hidden_dim):
        super().__init__()
        self.lstm = nn.LSTM(input_size=input_dim, hidden_size=hidden_dim, num_layers=1, bidirectional=True, batch_first=True)
        self.reduce_h = nn.Linear(hidden_dim * 2, hidden_dim, bias=True)
        self.reduce_c = nn.Linear(hidden_dim * 2, hidden_dim, bias=True)

    def forward(self, src, src_lens):
        """
        Args:
            src: source token embeddings    [B x L x E]
            src_lens: source text length    [B]

        Returns:
            enc_hidden: sequence of encoder hidden states                  [B x L x 2H]
            (final_h, final_c): Tuple for decoder state initialization     [B x L x H]
        """
        x = pack_padded_sequence(src, src_lens, batch_first=True, enforce_sorted=False)
        output, (h, c) = self.lstm(x)
        enc_hidden, _ = pad_packed_sequence(output, batch_first=True)
        h = torch.cat((h[0], h[1]), dim=-1)
        c = torch.cat((c[0], c[1]), dim=-1)
        final_hidden = torch.relu(self.reduce_h(h))
        final_cell = torch.relu(self.reduce_c(c))
        return (enc_hidden, (final_hidden, final_cell))


INIT_ARGS = {
    'input_dim': 4,
    'hidden_dim': 3,
}

ARGS = {
    'src': torch.randn(2, 5, 4),
    'src_lens': torch.tensor([5, 3]),
}

if __name__ == '__main__':
    encoder = Encoder(**INIT_ARGS)
    enc_hidden, (final_h, final_c) = encoder(**ARGS)
    print("enc_hidden shape:", enc_hidden.shape)
    print("final_h shape:", final_h.shape)
    print("final_c shape:", final_c.shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
EncoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("52b9248f17b25701")
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 an instance of its own class, EncoderLayer: the run constructed the object and did not call it, so no result was computed. 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

# Set random seeds for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Define ARGS dict with all required parameters for EncoderLayer
ARGS = {
    'd_model': 8,
    'num_heads': 2,
    'dff': 16,
    'rate': 0.1
}

# Create an instance of EncoderLayer to verify it works
encoder_layer = tf.keras.layers.Layer()
encoder_layer = type('EncoderLayer', (), {
    '__init__': lambda self, d_model, num_heads, dff, rate=0.1: None
})

# Create sample input tensors for testing
batch_size = 2
seq_len = 3
d_model = ARGS['d_model']

# Create a sample input tensor of shape (batch_size, seq_len, d_model)
sample_input = tf.random.normal((batch_size, seq_len, d_model))

# Create optional mask (can be None or a tensor)
sample_mask = None

# Create a training flag
training = True
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 EncoderLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EncoderLayer 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
FeedForward Ran
ran on a synthesized input
NirmalenduPrakash/DocumentSummarizer/summarizer_transformer.py
pointer only (licence: NONE) · get_code("8acf5b65cb2a2100")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NirmalenduPrakash/DocumentSummarizer 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.

Hypothesis Ran
ran on a synthesized input · constructed an object; no result was computed
jiminsun/pointer-generator/models/model.py
code served (permissive licence) · get_code("4f50db62a9b54a9b")
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 an instance of its own class, Hypothesis: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Analyze the Hypothesis class to determine what each parameter needs to be:
# - tokens: list of token indices (used in extend, latest_token, avg_log_prob)
# - log_probs: list of log probabilities (used in extend, avg_log_prob, sum())
# - hidden_state: tensor passed to extend (used in extend)
# - cell_state: tensor passed to extend (used in extend)
# - coverage: passed to extend (used in extend)

# Create sample arguments
tokens = [1, 2, 3]
log_probs = [-0.5, -0.3, -0.7]
hidden_state = torch.randn(2, 4)  # batch=2, hidden_dim=4
cell_state = torch.randn(2, 4)    # batch=2, hidden_dim=4
coverage = torch.zeros(2, 5)      # batch=2, seq_len=5

ARGS = {
    "tokens": tokens,
    "log_probs": log_probs,
    "hidden_state": hidden_state,
    "cell_state": cell_state,
    "coverage": coverage
}
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 Hypothesis — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Hypothesis 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
Linear Ran
ran on a synthesized input · constructed an object; no result was computed
AIKevin/Pointer_Generator_Summarizer/V1/model.py
pointer only (licence: NOASSERTION) · get_code("338352726f78576d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, AIKevin/Pointer_Generator_Summarizer (NOASSERTION). 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.

MultiHeadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("aca7c4bd13608aaf")
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 an instance of its own class, MultiHeadAttention: the run constructed the object and did not call it, so no result was computed. 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

# Set seed for reproducibility
tf.random.set_seed(0)

# Parameters for MultiHeadAttention
d_model = 8  # Model dimension
num_heads = 2  # Number of attention heads

# Create the MultiHeadAttention layer
mha = tf.keras.layers.Layer()  # Placeholder, will be initialized properly

# Create sample input tensors
batch_size = 2
seq_len_q = 3
seq_len_k = 3
seq_len_v = 3
depth = d_model

# v, k, q tensors: shape (batch_size, seq_len, d_model)
v = tf.random.normal((batch_size, seq_len_v, d_model))
k = tf.random.normal((batch_size, seq_len_k, d_model))
q = tf.random.normal((batch_size, seq_len_q, d_model))

# mask: shape broadcastable to (batch_size, seq_len_q, seq_len_k)
# Using None for no masking, or a tensor of zeros for no effect
mask = None

ARGS = {
    "d_model": d_model,
    "num_heads": num_heads
}
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 MultiHeadAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiHeadAttention 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
MultiHeadAttention Ran
ran on a synthesized input
NirmalenduPrakash/DocumentSummarizer/summarizer_transformer.py
pointer only (licence: NONE) · get_code("db4e1c41512bdaac")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NirmalenduPrakash/DocumentSummarizer 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.

Pointer Ran
ran on a synthesized input
steph1793/Pointer_Generator_Summarizer/model.py
pointer only (licence: NONE) · get_code("9b9b7b2462570738")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, steph1793/Pointer_Generator_Summarizer 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.

_calc_final_dist Ran
ran; our contract draft was wrong, not the code
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("f9feff661d1a3873")
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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)

# Define parameters
batch_size = 2
vocab_size = 4
batch_oov_len = 3
attn_len = 5
max_dec_steps = 2

# _enc_batch_extend_vocab: (batch_size, attn_len) - extended vocabulary indices
_enc_batch_extend_vocab = tf.constant([
    [0, 1, 2, 3, 4],
    [1, 2, 3, 4, 0]
], dtype=tf.int32)

# vocab_dists: List of (batch_size, vocab_size) distributions
vocab_dists = [
    tf.constant([[0.3, 0.2, 0.3, 0.2], [0.4, 0.3, 0.2, 0.1]], dtype=tf.float32),
    tf.constant([[0.2, 0.3, 0.3, 0.2], [0.1, 0.2, 0.3, 0.4]], dtype=tf.float32)
]

# attn_dists: List of (batch_size, attn_len) distributions
attn_dists = [
    tf.constant([[0.2, 0.2, 0.2, 0.2, 0.2], [0.1, 0.1, 0.2, 0.3, 0.3]], dtype=tf.float32),
    tf.constant([[0.3, 0.2, 0.2, 0.2, 0.1], [0.2, 0.2, 0.2, 0.2, 0.2]], dtype=tf.float32)
]

# p_gens: List of (batch_size,) or (batch_size, 1) probability values
p_gens = [
    tf.constant([[0.6], [0.7]], dtype=tf.float32),
    tf.constant([[0.5], [0.4]], dtype=tf.float32)
]

ARGS = {
    "_enc_batch_extend_vocab": _enc_batch_extend_vocab,
    "vocab_dists": vocab_dists,
    "attn_dists": attn_dists,
    "p_gens": p_gens,
    "batch_oov_len": batch_oov_len,
    "vocab_size": vocab_size,
    "batch_size": batch_size
}
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 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
_mask_and_avg Ran
ran, honoured the contract we drafted
AIKevin/Pointer_Generator_Summarizer/V1/model.py
pointer only (licence: NOASSERTION) · get_code("67aed5df940e4396")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, AIKevin/Pointer_Generator_Summarizer (NOASSERTION). 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.

attention Ran
ran; our contract draft was wrong, not the code
NirmalenduPrakash/DocumentSummarizer/summarizer_transformer.py
pointer only (licence: NONE) · get_code("6d646c72fd411781")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NirmalenduPrakash/DocumentSummarizer 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.

clean_up_tokenization Ran
ran; our contract draft was wrong, not the code
jiminsun/pointer-generator/models/model.py
code served (permissive licence) · get_code("7bf7e216c99a4f1a")
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

# The function clean_up_tokenization takes a single string argument
# and performs various text replacements on it. It doesn't use any
# complex objects, just a simple string.

out_string = "Hello world . This is a test ? Great ! It's n't working , we 've seen this 'm sure 's what 're doing"

ARGS = {
    "out_string": out_string
}
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
decoder_attention Ran
ran on a synthesized input
rohithreddy024/Text-Summarizer-Pytorch/model.py
pointer only (licence: NONE) · get_code("a4ac2e1bd15d3f38")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, rohithreddy024/Text-Summarizer-Pytorch 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.

encoder_attention Ran
ran on a synthesized input
rohithreddy024/Text-Summarizer-Pytorch/model.py
pointer only (licence: NONE) · get_code("a71ef898297188e2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, rohithreddy024/Text-Summarizer-Pytorch 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.

get_angles Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from chihchenghsieh/eventlogdice
pointer only; the stored copy get_code serves, from chihchenghsieh/eventlogdice, is pointer only (licence: NONE) · get_code("7816c6d65ab55d8f")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

is_infinite_dist Ran
ran, violated the contract we drafted
zide05/pointer-gen-fastnlp/model/model.py
pointer only (licence: NONE) · get_code("b1d4d55f6cfb7bf2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zide05/pointer-gen-fastnlp 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.

is_special Ran
ran, violated the contract we drafted
jiminsun/pointer-generator/models/model.py
code served (permissive licence) · get_code("de3f061bc084a621")
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.

import re

def is_special(token):
    res = re.search('\\[[A-Z]+\\]', token)
    if res is None:
        return False
    return token == res.group()

# Test with a valid special token
token1 = "[HELLO]"

# Test with an invalid token
token2 = "hello"

# Test with a token that contains the pattern but isn't equal to it
token3 = "prefix[WORLD]"

ARGS = {
    "token": token1
}
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
point_wise_feed_forward_network Ran
ran; our contract draft was wrong, not the code
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("a3e63cd2c4334956")
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 Sequential. 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

# The function takes two integer parameters: d_model and dff
# d_model is the model dimension
# dff is the feed-forward network dimension
# These are used to construct Dense layers

d_model = 64
dff = 128

ARGS = {
    "d_model": d_model,
    "dff": dff,
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential 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
positional_encoding Ran
ran, honoured the contract we drafted
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("29af386f64351dae")
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 EagerTensor, ndim 3, dtype family float, shape (1, 8, 16) 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 tensorflow as tf

ARGS = {
    "position": 8,
    "d_model": 16
}
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 EagerTensor, ndim 3, dtype family float, shape (1, 8, 16) — shape (1, 8, 16) 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
postprocess Ran
ran; our contract draft was wrong, not the code
jiminsun/pointer-generator/models/model.py
code served (permissive licence) · get_code("dbadcb9734ed8a55")
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 re

def clean_up_tokenization(out_string):
    """
    Reference : transformers.tokenization_utils_base
    Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms.

    Args:
        out_string (:obj:`str`): The text to clean up.

    Returns:
        :obj:`str`: The cleaned-up string.
    """
    out_string = out_string.replace(' .', '.').replace(' ?', '?').replace(' !', '!').replace(' ,', ',').replace(" ' ", "'").replace(" n't", "n't").replace(" 'm", "'m").replace(" 's", "'s").replace(" 've", "'ve").replace(" 're", "'re")
    return out_string

def is_special(token):
    res = re.search('\\[[A-Z]+\\]', token)
    if res is None:
        return False
    return token == res.group()

def postprocess(tokens, skip_special_tokens=True, clean_up_tokenization_spaces=True):
    if skip_special_tokens:
        tokens = [t for t in tokens if not is_special(t)]
    out_string = ' '.join(tokens)
    if clean_up_tokenization_spaces:
        out_string = clean_up_tokenization(out_string)
    return out_string


ARGS = {
    "tokens": ["hello", "world", " .", "how", "are", "you", " ?", "[PAD]", "n't"],
    "skip_special_tokens": True,
    "clean_up_tokenization_spaces": 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 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
scaled_dot_product_attention Ran
ran, honoured the contract we drafted
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("70c86dc3686d36b5")
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 tensorflow as tf

# Set random seed for reproducibility
tf.random.set_seed(0)

# Define tensor dimensions with distinct sizes
batch_size = 2
seq_len_q = 3
seq_len_k = 4
seq_len_v = 4
depth = 5
depth_v = 6

# Create query tensor: shape (..., seq_len_q, depth)
q = tf.random.normal([batch_size, seq_len_q, depth], dtype=tf.float32)

# Create key tensor: shape (..., seq_len_k, depth)
k = tf.random.normal([batch_size, seq_len_k, depth], dtype=tf.float32)

# Create value tensor: shape (..., seq_len_v, depth_v)
v = tf.random.normal([batch_size, seq_len_v, depth_v], dtype=tf.float32)

# Create mask tensor: shape broadcastable to (..., seq_len_q, seq_len_k)
# Using a simple padding mask
mask = tf.zeros([batch_size, seq_len_q, seq_len_k], dtype=tf.float32)

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "mask": mask
}
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 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
Attention Not yet run
unverified (harvested, no recorded run)
zide05/pointer-gen-fastnlp/model/model.py
pointer only (licence: NONE) · get_code("48ab9258f9be2b31")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zide05/pointer-gen-fastnlp 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. No invocation recorded.

Attention Not yet run
unverified (harvested, no recorded run)
sblayush/summarization/Attention/Attention.py
pointer only (licence: NONE) · get_code("08757013b9c0d91c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sblayush/summarization 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. No invocation recorded.

Attention_decoder Not yet run
unverified (harvested, no recorded run)
AIKevin/Pointer_Generator_Summarizer/V1/model.py
pointer only (licence: NOASSERTION) · get_code("eaa7996886b40957")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, AIKevin/Pointer_Generator_Summarizer (NOASSERTION). 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. No invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
zide05/pointer-gen-fastnlp/model/model.py
pointer only (licence: NONE) · get_code("b331c7c1df660bcf")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zide05/pointer-gen-fastnlp 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. No invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("56eb84acc4ebcc5b")
How it ran

no invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
steph1793/Pointer_Generator_Summarizer/model.py
pointer only (licence: NONE) · get_code("20022e811889f37b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, steph1793/Pointer_Generator_Summarizer 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. No invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
AIKevin/Pointer_Generator_Summarizer/V1/model.py
pointer only (licence: NOASSERTION) · get_code("7487de479c397feb")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, AIKevin/Pointer_Generator_Summarizer (NOASSERTION). 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. No invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
NirmalenduPrakash/DocumentSummarizer/summarizer_transformer.py
pointer only (licence: NONE) · get_code("ba300493e52be625")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NirmalenduPrakash/DocumentSummarizer 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. No invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
ishtoo1/Text-Summarization-using-Pointer-Generator-Model/PGNet/model.py
pointer only (licence: NONE) · get_code("01cb6fd7f41d2de2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ishtoo1/Text-Summarization-using-Pointer-Generator-Model 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. No invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
rohithreddy024/Text-Summarizer-Pytorch/model.py
pointer only (licence: NONE) · get_code("e5add5becd12d590")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, rohithreddy024/Text-Summarizer-Pytorch 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. No invocation recorded.

Encoder Not yet run
unverified (harvested, no recorded run)
steph1793/Pointer_Generator_Summarizer/model.py
pointer only (licence: NONE) · get_code("c58b5d53930c62fb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, steph1793/Pointer_Generator_Summarizer 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. No invocation recorded.

Encoder Not yet run
unverified (harvested, no recorded run)
AIKevin/Pointer_Generator_Summarizer/V1/model.py
pointer only (licence: NOASSERTION) · get_code("762286af9d313a53")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, AIKevin/Pointer_Generator_Summarizer (NOASSERTION). 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. No invocation recorded.

Encoder Not yet run
unverified (harvested, no recorded run)
NirmalenduPrakash/DocumentSummarizer/summarizer_transformer.py
pointer only (licence: NONE) · get_code("ef64d9a0c8ba787c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NirmalenduPrakash/DocumentSummarizer 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. No invocation recorded.

Encoder Not yet run
unverified (harvested, no recorded run)
rohithreddy024/Text-Summarizer-Pytorch/model.py
pointer only (licence: NONE) · get_code("f664cec323a8ceaa")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, rohithreddy024/Text-Summarizer-Pytorch 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. No invocation recorded.

GeneratorPoint Not yet run
unverified (harvested, no recorded run)
sanjeevkrn/teaser_generate/app/src/pointer_generator.py
pointer only (licence: NONE) · get_code("0ec5816294d1bd2c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sanjeevkrn/teaser_generate 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. No invocation recorded.

Model Not yet run
unverified (harvested, no recorded run)
zide05/pointer-gen-fastnlp/model/model.py
pointer only (licence: NONE) · get_code("bd19abd511462186")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zide05/pointer-gen-fastnlp 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. No invocation recorded.

Model Not yet run
unverified (harvested, no recorded run)
rohithreddy024/Text-Summarizer-Pytorch/model.py
pointer only (licence: NONE) · get_code("f3072d8c12f5efce")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, rohithreddy024/Text-Summarizer-Pytorch 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. No invocation recorded.

Norm Not yet run
unverified (harvested, no recorded run)
NirmalenduPrakash/DocumentSummarizer/summarizer_transformer.py
pointer only (licence: NONE) · get_code("c614959d211eacfc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NirmalenduPrakash/DocumentSummarizer 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. No invocation recorded.

PGN Not yet run
unverified (harvested, no recorded run)
steph1793/Pointer_Generator_Summarizer/model.py
pointer only (licence: NONE) · get_code("07d7bfd65d0e3ef0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, steph1793/Pointer_Generator_Summarizer 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. No invocation recorded.

PointerGenerator Not yet run
unverified (harvested, no recorded run)
jiminsun/pointer-generator/models/model.py
code served (permissive licence) · get_code("d22a7696119671b9")
How it ran

no invocation recorded.

PositionalEncoder Not yet run
unverified (harvested, no recorded run)
NirmalenduPrakash/DocumentSummarizer/summarizer_transformer.py
pointer only (licence: NONE) · get_code("577451b59ae065eb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NirmalenduPrakash/DocumentSummarizer 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. No invocation recorded.

ReduceState Not yet run
unverified (harvested, no recorded run)
zide05/pointer-gen-fastnlp/model/model.py
pointer only (licence: NONE) · get_code("da713dcec336840d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zide05/pointer-gen-fastnlp 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. No invocation recorded.

SummarizationModel Not yet run
unverified (harvested, no recorded run)
AIKevin/Pointer_Generator_Summarizer/V1/model.py
pointer only (licence: NOASSERTION) · get_code("bd62b9f74c093c39")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, AIKevin/Pointer_Generator_Summarizer (NOASSERTION). 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. No invocation recorded.

Transformer Not yet run
unverified (harvested, no recorded run)
steph1793/Pointer_Transformer_Generator/transformer.py
code served (permissive licence) · get_code("0ea4df17ef8e2996")
How it ran

no invocation recorded.

Transformer Not yet run
unverified (harvested, no recorded run)
NirmalenduPrakash/DocumentSummarizer/summarizer_transformer.py
pointer only (licence: NONE) · get_code("c89b7806c496fa46")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NirmalenduPrakash/DocumentSummarizer 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. No invocation recorded.

_calc_final_dist Not yet run
unverified (harvested, no recorded run)
steph1793/Pointer_Generator_Summarizer/model.py
pointer only (licence: NONE) · get_code("fa14eec02785c8fd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, steph1793/Pointer_Generator_Summarizer 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. No invocation recorded.

_calc_final_dist Not yet run
unverified (harvested, no recorded run)
AIKevin/Pointer_Generator_Summarizer/V1/model.py
pointer only (licence: NOASSERTION) · get_code("75edad4571dd5c56")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, AIKevin/Pointer_Generator_Summarizer (NOASSERTION). 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. No invocation recorded.

apply_mask_normalize Not yet run
unverified (harvested, no recorded run)
AIKevin/Pointer_Generator_Summarizer/V1/model.py
pointer only (licence: NOASSERTION) · get_code("7a475c976579453a")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, AIKevin/Pointer_Generator_Summarizer (NOASSERTION). 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. No invocation recorded.

init_linear_wt Not yet run
unverified (harvested, no recorded run)
zide05/pointer-gen-fastnlp/model/model.py
pointer only (licence: NONE) · get_code("1daa4703ad0f6451")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zide05/pointer-gen-fastnlp 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. No invocation recorded.

init_linear_wt Not yet run
unverified (harvested, no recorded run)
rohithreddy024/Text-Summarizer-Pytorch/model.py
pointer only (licence: NONE) · get_code("77c13b740619d01b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, rohithreddy024/Text-Summarizer-Pytorch 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. No invocation recorded.

Showing the first 60. An agent gets every one from get_harvested_code_for_paper("1704.04368").

Also present in other papers' code

Of 64 samples lifted from this paper's linked repositories, 64 carry a function identity and 0 do not. Of the 63 distinct functions with an identity, 7 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 7 later) and 56 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_angles
brick of this paper's assembly: helper
14 other papers
14 later · 2 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1905.07697 (2019-05)
Explaining Machine Learning Classifiers through Diverse Counterfactual Explanations
and 11 more not named here
positional_encoding
brick of this paper's assembly: helper
5 other papers
5 later · 1 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1910.02562 (2019-10)
MASTER: Multi-Aspect Non-local Network for Scene Text Recognition
and 2 more not named here
point_wise_feed_forward_network
brick of this paper's assembly: model
4 other papers
4 later · 2 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
2002.10381 (2020-02)
Sketchformer: Transformer-based Representation for Sketched Structure
and 1 more not named here
scaled_dot_product_attention
brick of this paper's assembly: helper
4 other papers
4 later · 1 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
2107.05916 (2021-07)
Towards Automatic Instrumentation by Learning to Separate Parts in Symbolic Multitrack Music
and 1 more not named here
DecoderLayer
brick of this paper's assembly: model
1 other paper
1 later
1706.03762 (2017-06)
Attention Is All You Need
EncoderLayer
brick of this paper's assembly: model
1 other paper
1 later
1706.03762 (2017-06)
Attention Is All You Need
MultiHeadAttention
brick of this paper's assembly: model
1 other paper
1 later
1706.03762 (2017-06)
Attention Is All You Need

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

More are linked than shown here.

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

Abstract

Neural sequence-to-sequence models have provided a viable new approach for abstractive text summarization (meaning they are not restricted to simply selecting and rearranging passages from the original text). However, these models have two shortcomings: they are liable to reproduce factual details inaccurately, and they tend to repeat themselves. In this work we propose a novel architecture that augments the standard sequence-to-sequence attentional model in two orthogonal ways. First, we use a hybrid pointer-generator network that can copy words from the source text via pointing, which aids accurate reproduction of information, while retaining the ability to produce novel words through the generator. Second, we use coverage to keep track of what has been summarized, which discourages repetition. We apply our model to the CNN / Daily Mail summarization task, outperforming the current abstractive state-of-the-art by at least 2 ROUGE points.

For agents

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

get_harvested_code_for_paper("1704.04368")
get_code_for_paper("1704.04368")
have("1704.04368")

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

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

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

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

Connect an agent — have() is free.