SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.09792 · 2022

Hierarchical Interpretation of Neural Text Classification

arXiv · PDF · Open in the Atlas

Code that ran

5 of 10 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 5 have no contract verdict; 0 failures of our instrument; 5 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/2202.09792.json · badge: /api/ran/2202.09792.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
hanqi-qi/sine canonical (classifier label)
classifier basis not recorded on the link
5 ran · 5 no recorded run
FunctionStatusWhere it lives
clean_word Ran
ran on a synthesized input
hanqi-qi/sine/vis_sine.py
code served (permissive licence) · get_code("78d6729cfa2161d4")
How it ran

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

import torch
import numpy as np

# Construct a valid word_list argument
# The function expects a list of strings (words) that may contain LaTeX-sensitive characters
word_list = [
    "hello",
    "world_with_underscore",
    "math^power",
    "percent%sign",
    "backslash\\char",
    "ampersand&symbol",
    "hash#tag",
    "curly{brace}",
    "normal_word"
]

ARGS = {
    "word_list": word_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate Ran
ran on a synthesized input
hanqi-qi/sine/sine_abalation.py
code served (permissive licence) · get_code("0fac14e8718a1839")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np
from itertools import chain

torch.manual_seed(0)

# Create a mock model that matches the function's usage
class MockModel(nn.Module):
    def __init__(self):
        super(MockModel, self).__init__()
        self.linear = nn.Linear(10, 2)  # 2 classes for classification
    
    def forward(self, data_var_list, tfidf_var_list, length):
        # data_var_list: list of LongTensors
        # tfidf_var_list: list of tensors
        # length: LongTensor
        
        # Simulate concatenating data
        batch_size = data_var_list[0].shape[0]
        
        # Create dummy outputs matching what evaluate expects
        predicted_target = torch.randn(batch_size, 2)  # 2 classes
        attention_weight = torch.randn(batch_size, 5)
        classifier_input = np.random.randn(batch_size, 8)
        
        # Additional outputs expected
        dummy_tensor = torch.randn(batch_size)
        senatt_arr = torch.randn(batch_size, 3)
        kld_loss = torch.tensor([0.1, 0.2])
        recon_loss = torch.tensor([0.05, 0.06])
        
        return predicted_target, attention_weight, classifier_input, dummy_tensor, senatt_arr, kld_loss, recon_loss

# Create a mock batch generator
class MockBatchGenerator:
    def __init__(self):
        self.batches = [
            (
                [np.array([[1, 2, 3], [4, 5, 6]]), np.array([[7, 8], [9, 10]])],  # data: list of arrays
                np.array([0, 1]),  # target: labels
                [np.array([[0.1, 0.2], [0.3, 0.4]]), np.array([[0.5], [0.6]])],  # tfidf: list of arrays
                np.array([3, 2]),  # length: sequence lengths
                np.array([100, 101])  # original_index
            ),
            (
                [np.array([[11, 12, 13], [14, 15, 16]]), np.array([[17, 18], [19, 20]])],
                np.array([1, 0]),
                [np.array([[0.7, 0.8], [0.9, 1.0]]), np.array([[1.1], [1.2]])],
                np.array([3, 2]),
                np.array([102, 103])
            )
        ]
    
    def __iter__(self):
        return iter(self.batches)
    
    def sample_document(self, index):
        return f"document_{index}"

# Create a mock loss function
def mock_loss_function(predicted, target):
    return nn.CrossEntropyLoss()(predicted, target)

# Build ARGS dictionary
ARGS = {
    'model': MockModel(),
    'loss_function': mock_loss_function,
    'batch_generator': MockBatchGenerator(),
    'cuda': None
}
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
evaluate Ran
ran on a synthesized input
hanqi-qi/sine/sine_dec.py
code served (permissive licence) · get_code("1a24b383db4c486a")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np

torch.manual_seed(0)

class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(100, 8)
        self.classifier = nn.Linear(8, 3)
    
    def forward(self, data_var_list, tfidf_var_list, length):
        # data_var_list: list of LongTensors
        # tfidf_var_list: list of tensors
        # length: LongTensor
        
        batch_size = data_var_list[0].shape[0]
        
        # Embed and pool
        embedded = self.embedding(data_var_list[0])  # (batch, seq_len, 8)
        pooled = embedded.mean(dim=1)  # (batch, 8)
        
        # Classifier output
        predicted_target = self.classifier(pooled)  # (batch, 3)
        
        # Dummy outputs matching function expectations
        attention_weight = torch.ones(batch_size, 1)
        classifier_input = pooled
        senatt_arr = torch.ones(batch_size, 1)
        kld_loss = torch.tensor(0.1)
        recon_loss = torch.tensor(0.2)
        
        return predicted_target, attention_weight, classifier_input, None, senatt_arr, kld_loss, recon_loss

def dummy_loss_function(predicted, target):
    return torch.nn.functional.cross_entropy(predicted, target)

def batch_generator():
    # Generate batches matching the expected format
    for _ in range(2):
        batch_size = 2
        seq_len = 5
        num_classes = 3
        
        # data: list of arrays
        data = [np.random.randint(0, 100, (batch_size, seq_len))]
        
        # target: array of class labels
        target = np.array([0, 1])
        
        # tfidf: list of arrays
        tfidf = [np.random.rand(batch_size, seq_len).astype(np.float32)]
        
        # idx: array of indices
        idx = np.array([0, 1])
        
        # wpos: array
        wpos = np.array([0, 1])
        
        # length: array of sequence lengths
        length = np.array([5, 5])
        
        # original_index: array
        original_index = np.array([0, 1])
        
        yield (data, target, tfidf, idx, wpos, length, original_index)

ARGS = {
    'model': DummyModel(),
    'loss_function': dummy_loss_function,
    'batch_generator': batch_generator(),
    'cuda': None
}
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
label2symbol Ran
ran on a synthesized input
hanqi-qi/sine/vis_sine.py
code served (permissive licence) · get_code("ec3d09f89a6498f6")
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
import numpy as np

torch.manual_seed(0)

# The function label2symbol takes a single parameter 'label'
# It checks if label > 0 and returns a string based on that condition
# label should be a numeric value (int or float)

ARGS = {
    'label': 1
}
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 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
rescale Ran
ran on a synthesized input
hanqi-qi/sine/vis_sine.py
code served (permissive licence) · get_code("4cd8d19876889aed")
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 numpy as np

# The function takes input_list as a parameter
# It converts it to a numpy array, finds max and min, then rescales to 0-100
# We need to provide a list of numeric values

input_list = [10, 20, 30, 40, 50]

ARGS = {
    "input_list": input_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
evaluate Not yet run
unverified (harvested, no recorded run)
hanqi-qi/sine/sine_explain.py
code served (permissive licence) · get_code("8839e9ada8b42b1b")
How it ran

no invocation recorded.

train_model Not yet run
unverified (harvested, no recorded run)
hanqi-qi/sine/sine_abalation.py
code served (permissive licence) · get_code("1f292aa3c12e9fa4")
How it ran

no invocation recorded.

train_model Not yet run
unverified (harvested, no recorded run)
hanqi-qi/sine/sine_dec.py
code served (permissive licence) · get_code("c044696f38d79087")
How it ran

no invocation recorded.

train_model Not yet run
unverified (harvested, no recorded run)
hanqi-qi/sine/sine_dec_gat.py
code served (permissive licence) · get_code("e8f35f87bda35cfa")
How it ran

no invocation recorded.

train_model Not yet run
unverified (harvested, no recorded run)
hanqi-qi/sine/sine_dec_tfidf.py
code served (permissive licence) · get_code("ba3f28b7c1dcb513")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
clean_word 1 other paper
1 later
2023.findings-emnlp.594 (2023 (year only))
Instances and Labels: Hierarchy-aware Joint Supervised Contrastive Learning for Hierarchical Multi-Label Text Classification
rescale 1 other paper
1 later
2023.findings-emnlp.594 (2023 (year only))
Instances and Labels: Hierarchy-aware Joint Supervised Contrastive Learning for Hierarchical Multi-Label Text Classification

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

Recent years have witnessed increasing interests in developing interpretable models in Natural Language Processing (NLP). Most existing models aim at identifying input features such as words or phrases important for model predictions. Neural models developed in NLP however often compose word semantics in a hierarchical manner and text classification requires hierarchical modelling to aggregate local information in order to deal with topic and label shifts more effectively. As such, interpretation by words or phrases only cannot faithfully explain model decisions in text classification. This paper proposes a novel Hierarchical INTerpretable neural text classifier, called Hint, which can automatically generate explanations of model predictions in the form of label-associated topics in a hierarchical manner. Model interpretation is no longer at the word level, but built on topics as the basic semantic unit. Experimental results on both review datasets and news datasets show that our proposed approach achieves text classification results on par with existing state-of-the-art text classifiers, and generates interpretations more faithful to model predictions and better understood by humans than other interpretable neural text classifiers.

For agents

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

get_harvested_code_for_paper("2202.09792")
get_code_for_paper("2202.09792")
have("2202.09792")

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

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

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

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

Connect an agent — have() is free.