SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1602.03606 · 2016

Variations of the Similarity Function of TextRank for Automated Summarization

arXiv · PDF · Open in the Atlas

Code that ran

8 of 18 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 8 have no contract verdict; 0 failures of our instrument; 10 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/1602.03606.json · badge: /api/ran/1602.03606.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
summanlp/textrank canonical (classifier label)
classifier basis: classifier_2025
0 ran · 4 no recorded run
chalothon/textRank community (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
WilliamKulp/textrank community (classifier label)
classifier basis not recorded on the link
3 ran · 5 no recorded run
FunctionStatusWhere it lives
build_adjacency_matrix Ran
ran on a synthesized input
WilliamKulp/textrank/summa/pagerank_weighted.py
code served (permissive licence) · get_code("bb1d0756756d4eed")
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 csr_matrix. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class SimpleGraph:
    def __init__(self):
        self._nodes = ['A', 'B', 'C', 'D']
        self._edges = {
            ('A', 'B'): 2.0,
            ('A', 'C'): 1.0,
            ('B', 'A'): 2.0,
            ('B', 'D'): 3.0,
            ('C', 'A'): 1.0,
            ('C', 'D'): 2.0,
            ('D', 'B'): 3.0,
            ('D', 'C'): 2.0,
        }
    
    def nodes(self):
        return self._nodes
    
    def neighbors(self, node):
        neighbors = []
        for (src, dst), weight in self._edges.items():
            if src == node and weight != 0:
                neighbors.append(dst)
        return neighbors
    
    def edge_weight(self, edge):
        return self._edges.get(edge, 0.0)

graph = SimpleGraph()

ARGS = {
    'graph': graph
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type csr_matrix — a csr_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a csr_matrix 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
pagerank_weighted Ran
ran on a synthesized input
WilliamKulp/textrank/summa/pagerank_weighted.py
code served (permissive licence) · get_code("dab5b920ede224a5")
How it ran

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

import networkx as nx

class WeightedGraph:
    """Stand-in for a graph object with weighted edges"""
    def __init__(self):
        self._nodes = [0, 1, 2]
        self._edges = {
            (0, 1): 0.5,
            (1, 0): 0.5,
            (1, 2): 0.8,
            (2, 1): 0.8,
            (0, 2): 0.3,
            (2, 0): 0.3,
        }
    
    def nodes(self):
        return self._nodes
    
    def neighbors(self, node):
        """Return list of neighbors for a given node"""
        neighbors = []
        for (src, dst) in self._edges.keys():
            if src == node:
                neighbors.append(dst)
        return neighbors
    
    def edge_weight(self, edge):
        """Return weight for edge (src, dst)"""
        return self._edges.get(edge, 1.0)


graph = WeightedGraph()

ARGS = {
    "graph": graph,
    "initial_value": None,
    "damping": 0.85,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — 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
pagerank_weighted_scipy Ran
ran on a synthesized input
chalothon/textRank/summa/pagerank_weighted.py
code served (permissive licence) · get_code("95597204ae348f0e")
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.

class SimpleGraph:
    def __init__(self):
        self._nodes = ['A', 'B', 'C', 'D']
        self._edges = {
            ('A', 'B'): 0.5,
            ('A', 'C'): 0.3,
            ('B', 'A'): 0.4,
            ('B', 'D'): 0.6,
            ('C', 'A'): 0.2,
            ('C', 'D'): 0.8,
            ('D', 'B'): 0.7,
            ('D', 'C'): 0.5,
        }
    
    def nodes(self):
        return self._nodes
    
    def neighbors(self, node):
        neighbors = []
        for (src, dst) in self._edges.keys():
            if src == node and self._edges[(src, dst)] != 0:
                neighbors.append(dst)
        return neighbors
    
    def edge_weight(self, edge):
        return self._edges.get(edge, 0.0)


graph = SimpleGraph()

ARGS = {
    'graph': graph,
    'damping': 0.85
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
parse_args Ran
ran on a synthesized input
chalothon/textRank/summa/textrank.py
code served (permissive licence) · get_code("e0daabcb87f49edb")
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 Namespace. 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 argparse

DEFAULT_RATIO = 0.2

def restricted_float(x):
    x = float(x)
    if x < 0.0 or x > 1.0:
        raise argparse.ArgumentTypeError('{} not in range [0.0, 1.0]'.format(x))
    return x

def parse_args(args):
    parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, prog='textrank', description='Extract the most relevant sentences or keywords of a given text using the TextRank algorithm.')
    parser.add_argument('--text', '-t', type=str, required=True, help='Text to summarize')
    parser.add_argument('--summary', '-s', type=int, default=0, help='Type of unit to summarize: sentence (0) or word (1)')
    parser.add_argument('--ratio', '-r', type=restricted_float, default=DEFAULT_RATIO, help="Float number (0,1] that defines the length of the summary. It's a proportion of the original text")
    parser.add_argument('--words', '-w', type=int, help='Number to limit the length of the summary. The length option is ignored if the word limit is set.')
    parser.add_argument('--additional_stopwords', '-a', help='Either a string of comma separated stopwords or a path to a file which has comma separated stopwords in every line')
    return parser.parse_args(args)

ARGS = {
    'args': [
        '--text',
        'This is a sample text to be summarized using the TextRank algorithm. It contains multiple sentences that should be ranked and filtered.',
        '--summary',
        '0',
        '--ratio',
        '0.5',
        '--words',
        '10',
        '--additional_stopwords',
        'the,a,an,and,or,but'
    ]
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
replace_abbreviations Ran
ran on a synthesized input
chalothon/textRank/summa/preprocessing/textcleaner.py
code served (permissive licence) · get_code("409f9a3f470dd736")
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

SEPARATOR = '@'

AB_SENIOR = re.compile('([A-Z][a-z]{1,2}\\.)\\s(\\w)')

AB_ACRONYM = re.compile('(\\.[a-zA-Z]\\.)\\s(\\w)')

def replace_with_separator(text, separator, regexs):
    replacement = '\\1' + separator + '\\2'
    result = text
    for regex in regexs:
        result = regex.sub(replacement, result)
    return result

def replace_abbreviations(text):
    return replace_with_separator(text, SEPARATOR, [AB_SENIOR, AB_ACRONYM])

ARGS = {
    'text': 'Dr. Smith and U.S. government officials met today.'
}
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
restricted_float Ran
ran on a synthesized input
WilliamKulp/textrank/summa/textrank.py
code served (permissive licence) · get_code("16543a6404e169bf")
How it ran

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

import argparse

def restricted_float(x):
    x = float(x)
    if x < 0.0 or x > 1.0:
        raise argparse.ArgumentTypeError('{} not in range [0.0, 1.0]'.format(x))
    return x

ARGS = {
    'x': '0.5'
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_sentences Ran
ran on a synthesized input
chalothon/textRank/summa/preprocessing/textcleaner.py
code served (permissive licence) · get_code("3bd5903bb5b570bc")
How it ran

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

import re

SEPARATOR = '@'

RE_SENTENCE = re.compile('(\\S.+?[.!?])(?=\\s+|$)|(\\S.+?)(?=[\n]|$)')

AB_SENIOR = re.compile('([A-Z][a-z]{1,2}\\.)\\s(\\w)')

AB_ACRONYM = re.compile('(\\.[a-zA-Z]\\.)\\s(\\w)')

UNDO_AB_SENIOR = re.compile('([A-Z][a-z]{1,2}\\.)' + SEPARATOR + '(\\w)')

UNDO_AB_ACRONYM = re.compile('(\\.[a-zA-Z]\\.)' + SEPARATOR + '(\\w)')

def replace_abbreviations(text):
    return replace_with_separator(text, SEPARATOR, [AB_SENIOR, AB_ACRONYM])

def undo_replacement(sentence):
    return replace_with_separator(sentence, ' ', [UNDO_AB_SENIOR, UNDO_AB_ACRONYM])

def replace_with_separator(text, separator, regexs):
    replacement = '\\1' + separator + '\\2'
    result = text
    for regex in regexs:
        result = regex.sub(replacement, result)
    return result

def get_sentences(text):
    for match in RE_SENTENCE.finditer(text):
        yield match.group()

def split_sentences(text):
    processed = replace_abbreviations(text)
    return [undo_replacement(sentence) for sentence in get_sentences(processed)]

ARGS = {
    'text': 'Dr. Smith went to the store. Prof. Jones was there. This is a sentence! And another one?'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
undo_replacement Ran
ran on a synthesized input
chalothon/textRank/summa/preprocessing/textcleaner.py
code served (permissive licence) · get_code("2c508fee6fc6b65a")
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

SEPARATOR = '@'

UNDO_AB_SENIOR = re.compile('([A-Z][a-z]{1,2}\\.)' + SEPARATOR + '(\\w)')

UNDO_AB_ACRONYM = re.compile('(\\.[a-zA-Z]\\.)' + SEPARATOR + '(\\w)')

def replace_with_separator(text, separator, regexs):
    replacement = '\\1' + separator + '\\2'
    result = text
    for regex in regexs:
        result = regex.sub(replacement, result)
    return result

def undo_replacement(sentence):
    return replace_with_separator(sentence, ' ', [UNDO_AB_SENIOR, UNDO_AB_ACRONYM])

# Test sentence containing patterns that match the regexes
# UNDO_AB_SENIOR matches: "[A-Z][a-z]{1,2}\.@\w"
# UNDO_AB_ACRONYM matches: "\.[a-zA-Z]\.@\w"
test_sentence = "Dr.@Smith and U.S.@A are here"

ARGS = {
    'sentence': test_sentence
}
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
build_graph Not yet run
unverified (harvested, no recorded run)
WilliamKulp/textrank/summa/commons.py
code served (permissive licence) · get_code("1be547f705c87234")
How it ran

no invocation recorded.

existing_file Not yet run
unverified (harvested, no recorded run)
WilliamKulp/textrank/summa/textrank.py
code served (permissive licence) · get_code("06da80d84e129959")
How it ran

no invocation recorded.

get_graph Not yet run
unverified (harvested, no recorded run)
summanlp/textrank/summa/summarizer.py
code served (permissive licence) · get_code("72eccc45566033ed")
How it ran

no invocation recorded.

get_graph Not yet run
unverified (harvested, no recorded run)
summanlp/textrank/summa/keywords.py
code served (permissive licence) · get_code("f7e39c6c068afc28")
How it ran

no invocation recorded.

get_stopwords_by_language Not yet run
unverified (harvested, no recorded run)
WilliamKulp/textrank/summa/preprocessing/stopwords.py
code served (permissive licence) · get_code("1f5acd51e8e4d67c")
How it ran

no invocation recorded.

get_stopwords_by_language Not yet run
unverified (harvested, no recorded run)
chalothon/textRank/summa/preprocessing/stopwords.py
code served (permissive licence) · get_code("bb0fc72f5cf908e9")
How it ran

no invocation recorded.

keywords Not yet run
unverified (harvested, no recorded run)
summanlp/textrank/summa/keywords.py
code served (permissive licence) · get_code("227fa4d2d593c288")
How it ran

no invocation recorded.

pagerank_weighted_scipy Not yet run
unverified (harvested, no recorded run)
WilliamKulp/textrank/summa/pagerank_weighted.py
code served (permissive licence) · get_code("d59142fae31f7252")
How it ran

no invocation recorded.

summarize Not yet run
unverified (harvested, no recorded run)
summanlp/textrank/summa/summarizer.py
code served (permissive licence) · get_code("ecc34edea14228d3")
How it ran

no invocation recorded.

textrank Not yet run
unverified (harvested, no recorded run)
WilliamKulp/textrank/summa/textrank.py
code served (permissive licence) · get_code("21dc8fc213a2e769")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 17 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.

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

This article presents new alternatives to the similarity function for the TextRank algorithm for automatic summarization of texts. We describe the generalities of the algorithm and the different functions we propose. Some of these variants achieve a significative improvement using the same metrics and dataset as the original publication.

For agents

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

get_harvested_code_for_paper("1602.03606")
get_code_for_paper("1602.03606")
have("1602.03606")

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

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

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

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

Connect an agent — have() is free.