SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-emnlp.965 · EMNLP Findings · 2024

See Detail Say Clear: Towards Brain CT Report Generation via Pathological Clue-driven Representation Learning

Liangqiong Qu, Xiaodan Zhang, Chengxin Zheng, Junzhong Ji, Yanzhao Shi

Open in the Atlas

Code that ran

9 of 11 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; 1 failure of our instrument; 2 no recorded run), measured 2026-11-24; 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/2024.findings-emnlp.965.json · badge: /api/ran/2024.findings-emnlp.965.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
Chauncey-Jheng/PCRL-MRG canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
add_space_to_each_word_Jieba Ran
ran on a synthesized input
Chauncey-Jheng/PCRL-MRG/llama_recipes/pycocoevalcap/metrics_for_chs_mrg.py
code served (permissive licence) · get_code("d0eeb34bc96014b4")
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 jieba

# The function takes a single parameter 'report' which should be a string
# that will be tokenized by jieba.cut()

# Create a simple Chinese text string for testing
report = "这是一个测试文本。我们需要分词处理。"

ARGS = {
    "report": report
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jieba — 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
clip_loss Ran
ran on a synthesized input
Chauncey-Jheng/PCRL-MRG/llama_recipes/models/PCRL_llama/modeling_PCRL_llama.py
code served (permissive licence) · get_code("9cebce9bbb39f3de")
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 Tensor, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# The function clip_loss takes a similarity matrix and two coefficients
# The similarity matrix is used in contrastive_loss which applies cross_entropy
# cross_entropy expects logits of shape (batch_size, num_classes)
# similarity.t() transposes it, so both operations need valid logits

# Create a similarity matrix (batch_size x batch_size)
# Using batch_size=2 for tiny tensors
batch_size = 2
similarity = torch.randn(batch_size, batch_size)

coef_caption_loss = 1.0
coef_image_loss = 1.0

ARGS = {
    "similarity": similarity,
    "coef_caption_loss": coef_caption_loss,
    "coef_image_loss": coef_image_loss,
}
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 Tensor, 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
contrastive_loss Ran
ran on a synthesized input
Chauncey-Jheng/PCRL-MRG/llama_recipes/models/PCRL_llama/modeling_PCRL_llama.py
code served (permissive licence) · get_code("512b42a683272e0d")
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 Tensor, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# The function expects a tensor of logits with shape (batch_size, num_classes)
# It computes cross_entropy loss where targets are torch.arange(len(logits))
# So the batch size determines the number of classes implicitly through the target range

logits = torch.randn(2, 4)  # batch_size=2, num_classes=4

ARGS = {
    "logits": logits
}
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 Tensor, 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
Chauncey-Jheng/PCRL-MRG/llama_recipes/models/PCRL_llama/modeling_PCRL_llama.py
code served (permissive licence) · get_code("8f437ded506e6472")
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 Conv2d. 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)

# The function conv3x3 takes in_planes, out_planes, stride, and dilation
# and returns an nn.Conv2d layer. We need to provide valid integer arguments.

in_planes = 3
out_planes = 64
stride = 1
dilation = 1

ARGS = {
    "in_planes": in_planes,
    "out_planes": out_planes,
    "stride": stride,
    "dilation": dilation
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
generate_entities_from_text Ran
ran on a synthesized input
Chauncey-Jheng/PCRL-MRG/data_peparation/step2_re_extract_entities.py
code served (permissive licence) · get_code("58174005e5d66588")
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 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 re

def generate_entities_from_text(text, keywords):
    sample = {'entities': [], 'entities_lession': []}
    sentences = re.split('(。|;|,)', text)
    for sentence in sentences:
        for keyword in keywords:
            if keyword in sentence:
                continue_flag = False
                for k in keywords:
                    if keyword in k and keyword != k and (k in sentence):
                        continue_flag = True
                        break
                if continue_flag:
                    continue
                if keyword in sample['entities']:
                    sample['entities_lession'][sample['entities'].index(keyword)] += ';' + sentence
                    continue
                sample['entities'].append(keyword)
                sample['entities_lession'].append(sentence)
        else:
            continue
    return (sample['entities'], sample['entities_lession'])


# Setup code
text = "机器学习是人工智能的重要分支。深度学习推动了机器学习的发展,特别是在计算机视觉领域;自然语言处理也受益于深度学习的进步。"

keywords = ["机器学习", "深度学习", "人工智能", "计算机视觉", "自然语言处理"]

ARGS = {
    "text": text,
    "keywords": keywords
}
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 2, 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
image_add_mask Ran
ran on a synthesized input
Chauncey-Jheng/PCRL-MRG/data_peparation/step1_sam_gen_masks.py
code served (permissive licence) · get_code("b38b01195fd87f69")
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 ndarray, ndim 3, dtype family int, shape (10, 12, 3) 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 cv2

# Create a small sample image (3D array: height x width x channels)
image = np.random.randint(0, 256, size=(10, 12, 3), dtype=np.uint8)

# Create annotations with segmentation masks
# Each annotation needs 'area' and 'segmentation' keys
anns = [
    {
        'area': 50,
        'segmentation': np.zeros((10, 12), dtype=bool)
    },
    {
        'area': 30,
        'segmentation': np.zeros((10, 12), dtype=bool)
    },
    {
        'area': 100,
        'segmentation': np.zeros((10, 12), dtype=bool)
    }
]

# Populate some mask regions
anns[0]['segmentation'][1:4, 2:6] = True
anns[1]['segmentation'][5:7, 3:8] = True
anns[2]['segmentation'][0:3, 0:5] = True

ARGS = {
    'image': image,
    'anns': anns
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (10, 12, 3) — shape (10, 12, 3) 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
rebase_manifest Ran
ran on a synthesized input
Chauncey-Jheng/PCRL-MRG/data_peparation/prepare_image_manifest.py
code served (permissive licence) · get_code("391f099292e0fa0b")
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 pathlib import Path

manifest = {
    "sample_001": ["image_a.jpg", "image_b.png"],
    "sample_002": ["photo_1.jpg", "photo_2.jpg", "photo_3.png"],
}

dataset_root = Path("~/dataset")

ARGS = {
    "manifest": manifest,
    "dataset_root": dataset_root,
}
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
remove_sentences_with_keywords Ran
ran on a synthesized input
Chauncey-Jheng/PCRL-MRG/data_peparation/step2_re_extract_entities.py
code served (permissive licence) · get_code("31e034f882c6def8")
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 remove_sentences_with_keywords(text, keywords):
    text = text.replace(',建议', '。建议')
    text = text.replace('。建议进一步检查。', '。')
    text = text.replace('脑千', '脑干')
    text = text.replace('题', '颞')
    text = text.replace('颢', '颞')
    text = text.replace('若侧', '右侧')
    text = text.replace('脑外伤复查示:', '')
    sentences = re.split('(。|;)', text)
    filtered_sentences = []
    for sentence in sentences:
        if any((keyword in sentence for keyword in keywords)):
            continue
        else:
            filtered_sentences.append(sentence)
    text = ''.join(filtered_sentences)
    text = re.sub('[。]+', '。', text)
    text = re.sub('[;]+', ';', text)
    text = re.sub(';。', '。', text)
    text = re.sub('。;', ';', text)
    text = re.sub('[;]+', ';', text)
    text = re.sub('[。]+', '。', text)
    text = re.sub('^[;。]+', '', text)
    text = text.replace('头颅CT平扫:', '')
    text = text.replace('头颅平扫:', '')
    return text


ARGS = {
    'text': '头颅CT平扫:脑干区域未见异常。;建议进一步检查。脑外伤复查示:右侧颞叶有轻微异常。',
    'keywords': ['异常', '脑干', '颞叶']
}
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
validate_manifest Ran
ran on a synthesized input
Chauncey-Jheng/PCRL-MRG/data_peparation/prepare_image_manifest.py
code served (permissive licence) · get_code("105e5c83349b787b")
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 tempfile
from pathlib import Path

# Create temporary directory with test files
temp_dir = tempfile.mkdtemp()

# Create 24 image files for a valid sample
valid_image_paths = []
for i in range(24):
    image_path = Path(temp_dir) / f"image_{i:02d}.jpg"
    image_path.touch()  # Create empty file
    valid_image_paths.append(str(image_path))

# Create 10 image files for an invalid sample (wrong count)
invalid_count_paths = []
for i in range(10):
    image_path = Path(temp_dir) / f"invalid_count_{i:02d}.jpg"
    image_path.touch()
    invalid_count_paths.append(str(image_path))

# Create paths where some files don't exist (missing files)
missing_paths = []
for i in range(24):
    if i < 20:
        # Create some files
        image_path = Path(temp_dir) / f"missing_sample_{i:02d}.jpg"
        image_path.touch()
        missing_paths.append(str(image_path))
    else:
        # Add paths to non-existent files
        image_path = Path(temp_dir) / f"nonexistent_{i:02d}.jpg"
        missing_paths.append(str(image_path))

# Build manifest with samples
manifest = {
    "sample_001": valid_image_paths,
    "sample_002": invalid_count_paths,
    "sample_003": missing_paths,
}

ARGS = {
    "manifest": manifest,
}
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
compute_scores Not yet run
unverified (harvested, no recorded run)
Chauncey-Jheng/PCRL-MRG/llama_recipes/pycocoevalcap/metrics_for_chs_mrg.py
code served (permissive licence) · get_code("8c9e701336fddca5")
How it ran

no invocation recorded.

compute_scores Not yet run
unverified (harvested, no recorded run)
Chauncey-Jheng/PCRL-MRG/llama_recipes/pycocoevalcap/metrics_for_eng_mrg.py
code served (permissive licence) · get_code("0564a1f0ab703869")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
conv3x3 4 other papers
3 dated earlier, 1 same year, order not determinable
1812.11703 (2018-12)
SiamRPN++: Evolution of Siamese Visual Tracking with Very Deep Networks
2112.05006 (2021-12)
Exploring Event-driven Dynamic Context for Accident Scene Segmentation
aaai_20232 (2022 (year only))
Homography Decomposition Networks for Planar Object Tracking
and 1 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-24.

Repositories linked to this paper

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

Abstract

Brain CT report generation is significant to aid physicians in diagnosing cranial diseases. Recent studies concentrate on handling the consistency between visual and textual pathological features to improve the coherence of report. However, there exist some challenges: 1) Redundant visual representing: Massive irrelevant areas in 3D scans distract models from representing salient visual contexts. 2) Shifted semantic representing: Limited medical corpus causes difficulties for models to transfer the learned textual representations to generative layers. This study introduces a Pathological Clue-driven Representation Learning (PCRL) model to build cross-modal representations based on pathological clues and naturally adapt them for accurate report generation. Specifically, we construct pathological clues from perspectives of segmented regions, pathological entities, and report themes, to fully grasp visual pathological patterns and learn cross-modal feature representations. To adapt the representations for the text generation task, we bridge the gap between representation learning and report generation by using a unified large language model (LLM) with task-tailored instructions. These crafted instructions enable the LLM to be flexibly fine-tuned across tasks and smoothly transfer the semantic representation for report generation. Experiments demonstrate that our method outperforms previous methods and achieves SoTA performance. Our code is available at https://github.com/Chauncey-Jheng/PCRL-MRG.

For agents

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

get_harvested_code_for_paper("2024.findings-emnlp.965")
get_code_for_paper("2024.findings-emnlp.965")
have("2024.findings-emnlp.965")

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

curl https://syntology.ai/api/ran/2024.findings-emnlp.965.json

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

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-emnlp.965.svg)](https://syntology.ai/paper/2024.findings-emnlp.965)

Connect an agent — have() is free.