SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2023.findings-emnlp.672 · EMNLP Findings · 2023

FactSpotter: Evaluating the Factual Faithfulness of Graph-to-Text Generation

Kun Zhang, Oana Balalau, Ioana Manolescu

Open in the Atlas

Code that ran

10 of 14 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; 1 honoured the contract we drafted, 1 violated it and 5 have no contract verdict; 3 failures of our instrument; 4 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/2023.findings-emnlp.672.json · badge: /api/ran/2023.findings-emnlp.672.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
guihuzhang/FactSpotter canonical (classifier label)
classifier basis: census
10 ran · 4 no recorded run
FunctionStatusWhere it lives
evaluation Ran
ran on a synthesized input
guihuzhang/FactSpotter/fact_spotter_training/train_classifier_dart.py
code served (permissive licence) · get_code("5643f5f42fea6fd2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. 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 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
from unittest.mock import Mock
import logging

torch.manual_seed(0)

# Create a minimal tokenizer that returns the expected dict structure
class MinimalTokenizer:
    def __init__(self):
        self.pad_token_id = 0
    
    def __call__(self, sequences):
        # Return dict with input_ids and attention_mask as lists of lists
        batch_size = len(sequences)
        return {
            'input_ids': [[1, 2, 3] for _ in range(batch_size)],
            'attention_mask': [[1, 1, 1] for _ in range(batch_size)]
        }

# Create a minimal model that returns logits
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, input_ids, attention_mask):
        # Return an object with logits attribute
        batch_size = input_ids.shape[0]
        logits = self.linear(input_ids.float().mean(dim=1, keepdim=True).expand(batch_size, 4))
        result = Mock()
        result.logits = logits
        return result
    
    def eval(self):
        super().eval()
        return self

# Create a minimal data loader (list of tuples)
inf_loader = [
    (['text1', 'text2'], torch.tensor([0, 1])),
    (['text3', 'text4'], torch.tensor([1, 0]))
]

# Create a minimal logger
logger_inf = logging.getLogger('test_logger')
logger_inf.info = Mock()

# Create model and tokenizer
inf_model = MinimalModel()
tokenizer_inf = MinimalTokenizer()

# Epoch number
epoch_num = 1

ARGS = {
    'inf_model': inf_model,
    'inf_loader': inf_loader,
    'tokenizer_inf': tokenizer_inf,
    'logger_inf': logger_inf,
    'epoch_num': epoch_num
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_antonyms Ran
ran on a synthesized input
guihuzhang/FactSpotter/fact_spotter_training/get_antonym_conceptnet.py
code served (permissive licence) · get_code("6192c51ddf8c8a9d")
How it ran

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

import csv
import tempfile
import os

# Create a temporary CSV file with sample data in the expected format
temp_fd, temp_path = tempfile.mkstemp(suffix='.csv', text=True)
try:
    with os.fdopen(temp_fd, 'w') as f:
        # Write sample rows in tab-delimited format
        # Format: [0]id [1]relation [2]word1_path [3]word2_path [4+]other
        f.write("1\t/r/Antonym\t/c/en/hot/a\t/c/en/cold/a\n")
        f.write("2\t/r/Antonym\t/c/en/big/a\t/c/en/small/a\n")
        f.write("3\t/r/Synonym\t/c/en/happy/a\t/c/en/joyful/a\n")
        f.write("4\t/r/Synonym\t/c/en/fast/a\t/c/en/quick/a\n")
        f.write("5\t/r/Antonym\t/c/en/light/a\t/c/en/dark/a\n")
    
    ARGS = {
        'csv_file': temp_path
    }
except:
    pass
finally:
    # Note: temp file will persist for the function call
    pass

ARGS = {
    'csv_file': temp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_attn_key_pad_mask Ran
ran on a synthesized input
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_kgpt.py
code served (permissive licence) · get_code("01d7142796d717bd")
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 3, dtype family float, shape (2, 3, 4) 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

torch.manual_seed(0)

# seq_k: a tensor of token indices that will be compared against pad_idx
# seq_q: a tensor of token indices, we only need its size(1) dimension
# pad_idx: an integer representing the padding token index

seq_k = torch.randint(0, 10, (2, 4))  # batch_size=2, seq_len=4
seq_q = torch.randint(0, 10, (2, 3))  # batch_size=2, query_seq_len=3
pad_idx = 0

ARGS = {
    "seq_k": seq_k,
    "seq_q": seq_q,
    "pad_idx": pad_idx
}
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) 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
get_non_pad_mask Ran
ran on a synthesized input
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_kgpt.py
code served (permissive licence) · get_code("20adbfe9d1d7262f")
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 3, dtype family float, shape (2, 4, 1) 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

torch.manual_seed(0)

# Create a 2D tensor (batch_size=2, sequence_length=4)
seq = torch.tensor([[1, 2, 3, 0],
                    [1, 2, 0, 0]], dtype=torch.long)

# Define padding index
pad_idx = 0

ARGS = {
    'seq': seq,
    'pad_idx': pad_idx
}
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 3, dtype family float, shape (2, 4, 1) — shape (2, 4, 1) 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
get_sinusoid_encoding_table Ran
ran, honoured the contract we drafted
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_kgpt.py
code served (permissive licence) · get_code("38165c64626f844a")
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 2, dtype family float, shape (8, 4) 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 torch

torch.manual_seed(0)

ARGS = {
    "n_position": 8,
    "d_hid": 4,
    "padding_idx": 0,
}
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 Tensor, ndim 2, dtype family float, shape (8, 4) — shape (8, 4) 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
invert_mask Ran
ran, violated the contract we drafted
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_bart.py
pointer only (licence: MIT); the stored copy get_code serves, from yeliu918/KG-BART, is pointer only (licence: NONE) · get_code("874a42377fa0659f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yeliu918/KG-BART, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

make_padding_mask Ran
ran; our contract draft was wrong, not the code
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_bart.py
pointer only (licence: MIT); the stored copy get_code serves, from yeliu918/KG-BART, is pointer only (licence: NONE) · get_code("f20c9b1aead27fea")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yeliu918/KG-BART, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

phrase_in_sent_set Ran
ran on a synthesized input
guihuzhang/FactSpotter/fact_spotter_training/dart_analysis.py
code served (permissive licence) · get_code("9c68882a7b9f4600")
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 bool, 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

ARGS = {
    "phrase": "hello",
    "sent_set": ["hello world", "this is a test", "HELLO THERE"]
}
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 bool, 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
shift_tokens_right Ran
ran; our contract draft was wrong, not the code
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_bart.py
pointer only (licence: MIT); the stored copy get_code serves, from yeliu918/KG-BART, is pointer only (licence: NONE) · get_code("e00ccf7847d12b59")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yeliu918/KG-BART, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

shift_tokens_right Ran
ran; our contract draft was wrong, not the code
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_bart_new.py
pointer only (licence: MIT); the stored copy get_code serves, from facebookresearch/ssvp_slt, is pointer only (licence: NOASSERTION) · get_code("9dfcf8b13847c65f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from facebookresearch/ssvp_slt, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

convert_length_to_mask Not yet run
unverified (harvested, no recorded run)
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_t5.py
code served (permissive licence) · get_code("ffbab796dd9456fa")
How it ran

no invocation recorded.

evaluation Not yet run
unverified (harvested, no recorded run)
guihuzhang/FactSpotter/fact_spotter_training/train_classifier_grail.py
code served (permissive licence) · get_code("daa28a651a2a68dd")
How it ran

no invocation recorded.

evaluation Not yet run
unverified (harvested, no recorded run)
guihuzhang/FactSpotter/fact_spotter_training/train_classifier_spq.py
code served (permissive licence) · get_code("e8d700e822c0b074")
How it ran

no invocation recorded.

load_tf_weights_in_t5 Not yet run
unverified (harvested, no recorded run)
guihuzhang/FactSpotter/g2t_gen_code/code/modeling_t5.py
pointer only (licence: MIT); the stored copy get_code serves, from upper9527/gerea, is pointer only (licence: NONE) · get_code("52fdf83141474e49")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from upper9527/gerea, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 8 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 2 later) and 6 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
shift_tokens_right 18 other papers
4 dated earlier, 8 later, 6 same year, order not determinable · 1 only as an assembly brick
2021.acl-demo.21 (2021 (year only))
KuiLeiXi: a Chinese Open-Ended Text Adventure Game
2203.07836 (2022-03)
Graph Pre-training for AMR Parsing and Generation
2203.11239 (2022-03)
DQ-BART: Efficient Sequence-to-Sequence Model via Joint Distillation and Quantization
and 15 more not named here
get_sinusoid_encoding_table 12 other papers
12 dated earlier · 2 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1910.02481 (2019-10)
Learn to Explain Efficiently via Neural Logic Inductive Learning
and 9 more not named here
shift_tokens_right 11 other papers
9 dated earlier, 2 same year, order not determinable
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2009.12005 (2020-09)
MinTL: Minimalist Transfer Learning for Task-Oriented Dialogue Systems
2009.12677 (2020-09)
KG-BART: Knowledge Graph-Augmented BART for Generative Commonsense Reasoning
and 8 more not named here
invert_mask 10 other papers
8 dated earlier, 2 same year, order not determinable
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2009.12005 (2020-09)
MinTL: Minimalist Transfer Learning for Task-Oriented Dialogue Systems
2009.12677 (2020-09)
KG-BART: Knowledge Graph-Augmented BART for Generative Commonsense Reasoning
and 7 more not named here
make_padding_mask 9 other papers
9 dated earlier
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2009.12005 (2020-09)
MinTL: Minimalist Transfer Learning for Task-Oriented Dialogue Systems
2009.12677 (2020-09)
KG-BART: Knowledge Graph-Augmented BART for Generative Commonsense Reasoning
and 6 more not named here
get_attn_key_pad_mask 1 other paper
1 dated earlier
2020.emnlp-main.697 (2020 (year only))
KGPT: Knowledge-Grounded Pre-Training for Data-to-Text Generation
get_non_pad_mask 1 other paper
1 dated earlier
2020.emnlp-main.697 (2020 (year only))
KGPT: Knowledge-Grounded Pre-Training for Data-to-Text Generation
load_tf_weights_in_t5 1 other paper
1 later
2402.02503 (2024-02)
GeReA: Question-Aware Prompt Captions for Knowledge-based Visual Question Answering

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

Graph-to-text (G2T) generation takes a graph as input and aims to generate a fluent and faithful textual representation of the information in the graph. The task has many applications, such as dialogue generation and question answering. In this work, we investigate to what extent the G2T generation problem is solved for previously studied datasets, and how proposed metrics perform when comparing generated texts. To help address their limitations, we propose a new metric that correctly identifies factual faithfulness, i.e., given a triple (subject, predicate, object), it decides if the triple is present in a generated text. We show that our metric FactSpotter achieves the highest correlation with human annotations on data correctness, data coverage, and relevance. In addition, FactSpotter can be used as a plug-in feature to improve the factual faithfulness of existing models. Finally, we investigate if existing G2T datasets are still challenging for state-of-the-art models. Our code is available online: https: //github.com/guihuzhang/FactSpotter.

For agents

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

get_harvested_code_for_paper("2023.findings-emnlp.672")
get_code_for_paper("2023.findings-emnlp.672")
have("2023.findings-emnlp.672")

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

curl https://syntology.ai/api/ran/2023.findings-emnlp.672.json

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

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

Connect an agent — have() is free.