SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1809.05679 · 2018

Graph Convolutional Networks for Text Classification

arXiv · PDF · Open in the Atlas

Code that ran

14 of 16 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; 2 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 4 failures of our instrument; 2 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/1809.05679.json · badge: /api/ran/1809.05679.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
codeKgu/text-gcn community (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
chengsen/pytorch_textgcn reimplementation (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
koreyou/text-gcn-chainer community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
dtriepke/Graph_Convolutional_Network reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
plkmo/Bible_Text_GCN reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
build_edges Ran
ran on a synthesized input
codeKgu/text-gcn/build_graph.py
code served (permissive licence) · get_code("d7c52fad2776eea6")
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.

import scipy.sparse as sp
from math import log
from collections import defaultdict

# Create small test data
doc_list = [
    "apple banana cherry date apple",
    "banana cherry date elderberry fig",
    "apple cherry fig grape"
]

# Create vocabulary (word to id mapping)
vocab_words = ["apple", "banana", "cherry", "date", "elderberry", "fig", "grape"]
word_id_map = {word: idx for idx, word in enumerate(vocab_words)}
vocab = {idx: word for idx, word in enumerate(vocab_words)}

# Create word_doc_freq (how many documents each word appears in)
word_doc_freq = {
    "apple": 2,
    "banana": 2,
    "cherry": 3,
    "date": 2,
    "elderberry": 1,
    "fig": 2,
    "grape": 1
}

# Window size
window_size = 5

ARGS = {
    "doc_list": doc_list,
    "word_id_map": word_id_map,
    "vocab": vocab,
    "word_doc_freq": word_doc_freq,
    "window_size": window_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
scipy, tqdm — 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
cal_pmi Ran
ran, honoured the contract we drafted
chengsen/pytorch_textgcn/build_graph.py
pointer only (licence: NONE) · get_code("a5ebdf6ac2def3a0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, chengsen/pytorch_textgcn 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_pmi Ran
ran on a synthesized input
koreyou/text-gcn-chainer/graphs.py
code served (permissive licence) · get_code("b362ca4a14ece361")
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 csc_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.

import numpy as np
from scipy import sparse

# Analyze the function:
# - calc_pmi takes X as input
# - X.T.dot(X) suggests X is a sparse matrix (has .T and .dot methods)
# - Y is then treated as sparse (has .data, .indices, .indptr attributes)
# - Y.diagonal() is called
# - Operations on Y.data and Y.diag suggest sparse CSR matrix format
# - X.shape[0] is accessed

# Create a small sparse matrix X
# Using scipy.sparse CSR matrix which has the required methods and attributes
np.random.seed(0)

# Create a small sparse matrix (4 rows, 3 columns)
# Use a simple sparse matrix with some non-zero values
data = np.array([1, 2, 3, 4, 5], dtype=np.float32)
indices = np.array([0, 1, 1, 2, 2])
indptr = np.array([0, 1, 3, 5])
X = sparse.csr_matrix((data, indices, indptr), shape=(3, 4))

ARGS = {
    "X": X
}
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 csc_matrix — a csc_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a csc_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
clean_doc Ran
ran on a synthesized input
codeKgu/text-gcn/prep_data.py
code served (permissive licence) · get_code("d3fab161b1ada8bb")
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_doc_ap(string):
    string = re.sub('http[s]?\\:\\/\\/.[a-zA-Z0-9\\.\\/\\_?=%&#\\-\\+!]+', ' ', string)
    string = re.sub("[^A-Za-z0-9()_+,!?:\\'\\`]", ' ', string)
    string = re.sub('(?<!HASHTAG)_', ' ', string)
    string = re.sub('(?<!EASTASIA)\\+ | (?<!VIRUS)\\+', ' ', string)
    string = re.sub('\\+', '_', string)
    string = re.sub('HASHTAG_EASTASIA_VIRUS(?!(\\s))', 'HASHTAG_EASTASIA_VIRUS ', string)
    string = re.sub('HASHTAG_EASTASIA(?!(\\s|_))', 'HASHTAG_EASTASIA ', string)
    string = re.sub('HASHTAG_VIRUS(?!(\\s|_))', 'HASHTAG_VIRUS ', string)
    string = re.sub('HASHTAG_VIRUS_OTHERCOUNTRY(?!(\\s))', 'HASHTAG_VIRUS_OTHERCOUNTRY ', string)
    string = re.sub('HASHTAG(?!([\\s|_]))', 'HASHTAG ', string)
    if 'no_hashtag' in dataset:
        string = re.sub('HASHTAG_EASTASIA_VIRUS', ' ', string)
        string = re.sub('HASHTAG_EASTASIA', ' ', string)
        string = re.sub('HASHTAG_VIRUS', ' ', string)
        string = re.sub('HASHTAG_VIRUS_OTHERCOUNTRY', ' ', string)
        string = re.sub('HASHTAG', ' ', string)
    return string

def clean_doc(string, dataset):
    if 'twitter_asian_prejudice' in dataset:
        string = clean_doc_ap(string)
    else:
        pass
    string = re.sub('^\\"', '', string)
    string = re.sub('\\"$', '', string)
    string = re.sub("\\'s", " 's", string)
    string = re.sub("\\'ve", " 've", string)
    string = re.sub("n\\'t", " n't", string)
    string = re.sub("\\'re", " 're", string)
    string = re.sub("\\'d", " 'd", string)
    string = re.sub("\\'ll", " 'll", string)
    string = re.sub('\\.', ' ', string)
    string = re.sub(',', ' ', string)
    string = re.sub('!', ' ', string)
    string = re.sub('\\(', ' ', string)
    string = re.sub('\\)', ' ', string)
    string = re.sub('\\?', ' ', string)
    string = re.sub('\\s{2,}', ' ', string)
    return string.strip().lower()

test_string = "Hello, world! This is a test. Visit https://example.com for more info. What's happening?"
test_dataset = "some_other_dataset"

ARGS = {
    "string": test_string,
    "dataset": test_dataset
}
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
count_pmi Ran
ran; our contract draft was wrong, not the code
chengsen/pytorch_textgcn/build_graph.py
pointer only (licence: NONE) · get_code("23cb6c93ee0a7878")
How it ran

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

create_act Ran
ran on a synthesized input
codeKgu/text-gcn/model_text_gnn.py
code served (permissive licence) · get_code("f71177416c3999b7")
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 ReLU. 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)

# Test case 1: relu activation
ARGS = {
    'act': 'relu',
    'num_parameters': None
}

# Alternative test cases could be:
# ARGS = {'act': 'prelu', 'num_parameters': 3}
# ARGS = {'act': 'sigmoid', 'num_parameters': None}
# ARGS = {'act': 'tanh', 'num_parameters': None}
# ARGS = {'act': 'identity', 'num_parameters': None}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
create_text_adjacency_matrix Ran
ran on a synthesized input
koreyou/text-gcn-chainer/graphs.py
code served (permissive licence) · get_code("8439106958ba7d2c")
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 coo_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.

import numpy as np
import scipy.sparse as sp
import sklearn.feature_extraction.text

# Create minimal test data for texts parameter
# texts should be a list of list of str (tokenized documents)
texts = [
    ['word1', 'word2', 'word3', 'word4', 'word5', 'word6', 'word7', 'word8', 'word9', 'word10',
     'word11', 'word12', 'word13', 'word14', 'word15', 'word16', 'word17', 'word18', 'word19', 'word20',
     'word21', 'word22', 'word23', 'word24'],
    ['word2', 'word3', 'word4', 'word5', 'word6', 'word7', 'word8', 'word9', 'word10', 'word11',
     'word12', 'word13', 'word14', 'word15', 'word16', 'word17', 'word18', 'word19', 'word20', 'word21',
     'word22', 'word23', 'word24', 'word25'],
    ['word3', 'word4', 'word5', 'word6', 'word7', 'word8', 'word9', 'word10', 'word11', 'word12',
     'word13', 'word14', 'word15', 'word16', 'word17', 'word18', 'word19', 'word20', 'word21', 'word22',
     'word23', 'word24', 'word25', 'word26'],
]

ARGS = {
    'texts': texts
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coo_matrix — a coo_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coo_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
get_vocab Ran
ran on a synthesized input
codeKgu/text-gcn/build_graph.py
code served (permissive licence) · get_code("f0aeffa095b44a3a")
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 defaultdict. 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
from collections import defaultdict

def get_vocab(text_list):
    word_freq = defaultdict(int)
    for doc_words in text_list:
        words = doc_words.split()
        for word in words:
            word_freq[word] += 1
    return word_freq

ARGS = {
    "text_list": [
        "hello world this is a test",
        "hello there friend how are you",
        "world peace and harmony"
    ]
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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_window Ran
ran; our contract draft was wrong, not the code
chengsen/pytorch_textgcn/build_graph.py
pointer only (licence: NONE) · get_code("a7642b4d294d07a6")
How it ran

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

load_pickle Ran
ran; our contract draft was wrong, not the code
dtriepke/Graph_Convolutional_Network/model_train.py
pointer only (licence: NONE) · get_code("d760f5d1c4f85eb6")
How it ran

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

load_state Ran
ran, honoured the contract we drafted
plkmo/Bible_Text_GCN/text_GCN.py
pointer only (licence: NONE) · get_code("1d30b9a0ccf5a53d")
How it ran

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

normalize_text Ran
ran on a synthesized input
koreyou/text-gcn-chainer/nlp_utils.py
code served (permissive licence) · get_code("2950d6b582fe43a8")
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 normalize_text(string):
    """ Text normalization from
    https://github.com/yoonkim/CNN_sentence/blob/23e0e1f735570/process_data.py
    as specified in Yao's paper.
    """
    string = re.sub("[^A-Za-z0-9(),!?\\'\\`]", ' ', string)
    string = re.sub("\\'s", " 's", string)
    string = re.sub("\\'ve", " 've", string)
    string = re.sub("n\\'t", " n't", string)
    string = re.sub("\\'re", " 're", string)
    string = re.sub("\\'d", " 'd", string)
    string = re.sub("\\'ll", " 'll", string)
    string = re.sub(',', ' , ', string)
    string = re.sub('!', ' ! ', string)
    string = re.sub('\\(', ' \\( ', string)
    string = re.sub('\\)', ' \\) ', string)
    string = re.sub('\\?', ' \\? ', string)
    string = re.sub('\\s{2,}', ' ', string)
    return string.strip().lower()

# Test string with various characters that need normalization
test_string = "Hello, world! This isn't a test? (Really) It's great."

ARGS = {
    "string": test_string
}
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
proc_filepath Ran
ran on a synthesized input
codeKgu/text-gcn/utils.py
code served (permissive licence) · get_code("ca704301382f623d")
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

torch.manual_seed(0)

ARGS = {
    'filepath': 'model_checkpoint',
    'ext': '.klepto'
}
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
remove_less_word Ran
ran; our contract draft was wrong, not the code
chengsen/pytorch_textgcn/data_processor.py
pointer only (licence: NONE) · get_code("11c600e5158c8de1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, chengsen/pytorch_textgcn 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_doc_ap Not yet run
unverified (harvested, no recorded run)
codeKgu/text-gcn/prep_data.py
code served (permissive licence) · get_code("609ed2882449335b")
How it ran

no invocation recorded.

clean_documents Not yet run
unverified (harvested, no recorded run)
codeKgu/text-gcn/prep_data.py
code served (permissive licence) · get_code("eef3ad654b28192f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 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 16 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

Text classification is an important and classical problem in natural language processing. There have been a number of studies that applied convolutional neural networks (convolution on regular grid, e.g., sequence) to classification. However, only a limited number of studies have explored the more flexible graph convolutional neural networks (convolution on non-grid, e.g., arbitrary graph) for the task. In this work, we propose to use graph convolutional networks for text classification. We build a single text graph for a corpus based on word co-occurrence and document word relations, then learn a Text Graph Convolutional Network (Text GCN) for the corpus. Our Text GCN is initialized with one-hot representation for word and document, it then jointly learns the embeddings for both words and documents, as supervised by the known class labels for documents. Our experimental results on multiple benchmark datasets demonstrate that a vanilla Text GCN without any external word embeddings or knowledge outperforms state-of-the-art methods for text classification. On the other hand, Text GCN also learns predictive word and document embeddings. In addition, experimental results show that the improvement of Text GCN over state-of-the-art comparison methods become more prominent as we lower the percentage of training data, suggesting the robustness of Text GCN to less training data in text classification.

For agents

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

get_harvested_code_for_paper("1809.05679")
get_code_for_paper("1809.05679")
have("1809.05679")

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

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

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

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

Connect an agent — have() is free.