SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.14477 · CVPR · 2021

Towards Diverse Paragraph Captioning for Untrimmed Videos

Shizhe Chen, Qin Jin, Yuqing Song

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2105.14477.json · badge: /api/ran/2105.14477.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
syuqings/video-paragraph canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
attention Ran
ran on a synthesized input
syuqings/video-paragraph/modules/common.py
code served (permissive licence) · get_code("6506293d511b80a3")
How it ran

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

import torch
import torch.nn as nn
import torch.nn.functional as F
import math

torch.manual_seed(0)

# Set up tensor dimensions
batch_size = 2
seq_len = 3
d_k = 4
d_v = 5

# Create query, key, value tensors
# q: (batch, seq_len, d_k)
q = torch.randn(batch_size, seq_len, d_k)

# k: (batch, seq_len, d_k)
k = torch.randn(batch_size, seq_len, d_k)

# v: (batch, seq_len, d_v)
v = torch.randn(batch_size, seq_len, d_v)

# d_k is the key dimension
d_k_param = d_k

# mask: (batch, seq_len, seq_len) - 0s where to mask, 1s where to attend
mask = torch.ones(batch_size, seq_len, seq_len)
mask[0, 1, 2] = 0  # mask out one position for variety

# dropout: a nn.Module with __call__ that takes and returns a tensor
dropout = nn.Dropout(p=0.1)

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "d_k": d_k_param,
    "mask": mask,
    "dropout": dropout
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
change_device Ran
ran on a synthesized input
syuqings/video-paragraph/resnet200/resnet200_mxnet.py
code served (permissive licence) · get_code("f6cbbd85d341da0b")
How it ran

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

import torch
import numpy as np

torch.manual_seed(0)

# Create mock tensors with as_in_context method
class MockNDArray:
    def __init__(self, data):
        self.data = data
    
    def as_in_context(self, ctx):
        # Simulate moving to context by returning self
        return self

# Create arg_params dict with mock NDArray objects
arg_params = {
    'weight': MockNDArray(np.random.randn(4, 3)),
    'bias': MockNDArray(np.random.randn(3,))
}

# Create aux_params dict with mock NDArray objects
aux_params = {
    'running_mean': MockNDArray(np.random.randn(3,)),
    'running_var': MockNDArray(np.random.randn(3,))
}

# Create a mock context object
class MockContext:
    pass

ctx = MockContext()

ARGS = {
    'arg_params': arg_params,
    'aux_params': aux_params,
    'ctx': ctx
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cook_refs Ran
ran; our contract draft was wrong, not the code
syuqings/video-paragraph/cap_eval/bleu/bleu_scorer.py
code served (permissive licence) · get_code("7586e1d32f7325f7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family 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.

from collections import defaultdict

ARGS = {
    'refs': [
        'the quick brown fox jumps over the lazy dog',
        'a quick brown fox leaps over a lazy dog'
    ],
    'eff': 'shortest',
    'n': 4
}
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, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cook_test Ran
ran; our contract draft was wrong, not the code
syuqings/video-paragraph/cap_eval/cider/cider_scorer.py
pointer only (licence: MIT); the stored copy get_code serves, from wenhuchen/data-to-text-evaluation-metric, is pointer only (licence: NOASSERTION) · get_code("3573c4bc85f65dfd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from wenhuchen/data-to-text-evaluation-metric, and GitHub could not classify the licence of that repository (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.

cook_test Ran
ran on a synthesized input
syuqings/video-paragraph/cap_eval/bleu/bleu_scorer.py
code served (permissive licence) · get_code("ed1b5dfbcf00658a")
How it ran

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

from collections import defaultdict

def precook(s, n=4, out=False):
    """Takes a string as input and returns an object that can be given to
    either cook_refs or cook_test. This is optional: cook_refs and cook_test
    can take string arguments as well."""
    words = s.split()
    counts = defaultdict(int)
    for k in range(1, n + 1):
        for i in range(len(words) - k + 1):
            ngram = tuple(words[i:i + k])
            counts[ngram] += 1
    return (len(words), counts)

def cook_test(test, refinfo, eff=None, n=4):
    """Takes a test sentence and returns an object that
    encapsulates everything that BLEU needs to know about it."""
    reflen, refmaxcounts = refinfo
    testlen, counts = precook(test, n, True)
    result = {}
    if eff == 'closest':
        result['reflen'] = min(((abs(l - testlen), l) for l in reflen))[1]
    else:
        result['reflen'] = reflen
    result['testlen'] = testlen
    result['guess'] = [max(0, testlen - k + 1) for k in range(1, n + 1)]
    result['correct'] = [0] * n
    for ngram, count in counts.items():
        result['correct'][len(ngram) - 1] += min(refmaxcounts.get(ngram, 0), count)
    return result

# Create test sentence
test_sentence = "the quick brown fox jumps over the lazy dog"

# Create reference info by precooking reference sentences
ref_sentence_1 = "the quick brown fox jumps over the lazy dog"
ref_sentence_2 = "a quick brown fox jumps over a lazy dog"

reflen_1, refmaxcounts_1 = precook(ref_sentence_1, n=4)
reflen_2, refmaxcounts_2 = precook(ref_sentence_2, n=4)

# Combine reference max counts (taking max for each ngram across all references)
refmaxcounts = defaultdict(int)
for ngram, count in refmaxcounts_1.items():
    refmaxcounts[ngram] = max(refmaxcounts[ngram], count)
for ngram, count in refmaxcounts_2.items():
    refmaxcounts[ngram] = max(refmaxcounts[ngram], count)

# refinfo is a tuple of (reflen, refmaxcounts)
# reflen can be a list of lengths or a single length
refinfo = ([len(ref_sentence_1.split()), len(ref_sentence_2.split())], refmaxcounts)

ARGS = {
    'test': test_sentence,
    'refinfo': refinfo,
    'eff': None,
    'n': 4
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_clones Ran
ran; our contract draft was wrong, not the code
syuqings/video-paragraph/modules/common.py
pointer only (licence: MIT); the stored copy get_code serves, from arshadshk/SAINT-pytorch, is pointer only (licence: NONE) · get_code("891b8ebab395921f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from arshadshk/SAINT-pytorch, and GitHub detected no licence in that repository 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.

precook Ran
ran; our contract draft was wrong, not the code
syuqings/video-paragraph/cap_eval/bleu/bleu_scorer.py
code served (permissive licence) · get_code("ec4448373d72d636")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, 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.

ARGS = {
    "s": "the quick brown fox jumps over the lazy dog",
    "n": 4,
    "out": False
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 4 later) and 3 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_clones 40 other papers
4 dated earlier, 36 later · 8 only as an assembly brick
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
2002.07033 (2020-02)
Towards an Appropriate Query, Key, and Value Computation for Knowledge Tracing
2010.12042 (2020-10)
SAINT+: Integrating Temporal Features for EdNet Correctness Prediction
and 37 more not named here
cook_test 22 other papers
10 dated earlier, 12 later
1411.5726 (2014-11)
CIDEr: Consensus-based Image Description Evaluation
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1503.01817 (2015-03)
YFCC100M: The New Data in Multimedia Research
and 19 more not named here
precook 22 other papers
11 dated earlier, 11 later
1411.4555 (2014-11)
Show and Tell: A Neural Image Caption Generator
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1611.09268 (2016-11)
MS MARCO: A Human Generated MAchine Reading COmprehension Dataset
and 19 more not named here
cook_refs 21 other papers
9 dated earlier, 12 later
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1611.09268 (2016-11)
MS MARCO: A Human Generated MAchine Reading COmprehension Dataset
1611.09571 (2016-11)
Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model
and 18 more not named here

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

Video paragraph captioning aims to describe multiple events in untrimmed videos with descriptive paragraphs. Existing approaches mainly solve the problem in two steps: event detection and then event captioning. Such two-step manner makes the quality of generated paragraphs highly dependent on the accuracy of event proposal detection which is already a challenging task. In this paper, we propose a paragraph captioning model which eschews the problematic event detection stage and directly generates paragraphs for untrimmed videos. To describe coherent and diverse events, we propose to enhance the conventional temporal attention with dynamic video memories, which progressively exposes new video features and suppresses over-accessed video contents to control visual focuses of the model. In addition, a diversity-driven training strategy is proposed to improve diversity of paragraph on the language perspective. Considering that untrimmed videos generally contain massive but redundant frames, we further augment the video encoder with keyframe awareness to improve efficiency. Experimental results on the ActivityNet and Charades datasets show that our proposed model significantly outperforms the state-of-the-art performance on both accuracy and diversity metrics without using any event boundary annotations. Code will be released at https: //github.com/syuqings/video-paragraph. * Equal contribution. This work was performed when Shizhe Chen was at Renmin University of China.

For agents

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

get_harvested_code_for_paper("2105.14477")
get_code_for_paper("2105.14477")
have("2105.14477")

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

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

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

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

Connect an agent — have() is free.