SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1909.02151 · 2019

KagNet: Knowledge-Aware Graph Networks for Commonsense Reasoning

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 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, 0 violated it and 9 have no contract verdict; 1 failure of our instrument; 1 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/1909.02151.json · badge: /api/ran/1909.02151.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
INK-USC/KagNet canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran, honoured the contract we drafted
INK-USC/KagNet/baselines/extract_csqa_bert.py
code served (permissive licence) · get_code("eb725d5794b15f6b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned int64, ndim 0, dtype family int, 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 numpy as np

# Create sample outputs from a model (e.g., logits for 2 samples, 5 classes)
out = np.array([
    [0.1, 0.3, 0.8, 0.2, 0.1],  # argmax = 2
    [0.9, 0.1, 0.2, 0.3, 0.05]  # argmax = 0
])

# Create corresponding labels
labels = np.array([2, 0])

ARGS = {
    'out': out,
    'labels': labels
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int64, ndim 0, dtype family int, 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
collate_csqa_paths Ran
ran on a synthesized input
INK-USC/KagNet/models/csqa_dataset.py
code served (permissive licence) · get_code("59331830eb0526c2")
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. 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)

# Create sample data that matches what collate_csqa_paths expects
# The function expects samples to be tuples of:
# (statements, correct_labels, cpt_path_data, rel_path_data, qa_pair_data, qa_text)

# Create 2 samples for the batch
samples = []

# Sample 1
statement_1 = torch.randn(4, 3)  # small statement vector
correct_label_1 = 1
cpt_path_data_1 = {"concept_path": [1, 2, 3]}
rel_path_data_1 = {"relation_path": [4, 5, 6]}
qa_pair_data_1 = {"question": "What?", "answer": "Yes"}
qa_text_1 = "This is question 1"

sample_1 = (
    statement_1,
    correct_label_1,
    cpt_path_data_1,
    rel_path_data_1,
    qa_pair_data_1,
    qa_text_1
)
samples.append(sample_1)

# Sample 2
statement_2 = torch.randn(4, 3)  # small statement vector
correct_label_2 = 0
cpt_path_data_2 = {"concept_path": [7, 8, 9]}
rel_path_data_2 = {"relation_path": [10, 11, 12]}
qa_pair_data_2 = {"question": "When?", "answer": "Now"}
qa_text_2 = "This is question 2"

sample_2 = (
    statement_2,
    correct_label_2,
    cpt_path_data_2,
    rel_path_data_2,
    qa_pair_data_2,
    qa_text_2
)
samples.append(sample_2)

ARGS = {
    "samples": samples
}
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 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
convert_examples_to_features Ran
ran on a synthesized input
INK-USC/KagNet/baselines/extract_csqa_bert.py
code served (permissive licence) · get_code("324da0e6c0b20893")
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
from transformers import AutoTokenizer

# Create a simple tokenizer stand-in
class SimpleTokenizer:
    def __init__(self):
        self.vocab = {
            '[CLS]': 101,
            '[SEP]': 102,
            '[PAD]': 0,
            'the': 1,
            'context': 2,
            'is': 3,
            'here': 4,
            'ending': 5,
            'choice': 6,
            'one': 7,
            'two': 8,
            'three': 9,
        }
    
    def tokenize(self, text):
        # Simple tokenization: split on spaces and lowercase
        return text.lower().split()
    
    def convert_tokens_to_ids(self, tokens):
        # Convert tokens to IDs, using vocab or assigning new IDs
        ids = []
        for token in tokens:
            if token in self.vocab:
                ids.append(self.vocab[token])
            else:
                # Assign a consistent ID for unknown tokens
                ids.append(len(self.vocab) + hash(token) % 100)
        return ids

# Create a simple example class
class SimpleExample:
    def __init__(self, swag_id, context_sentence, start_ending, endings, label):
        self.swag_id = swag_id
        self.context_sentence = context_sentence
        self.start_ending = start_ending
        self.endings = endings
        self.label = label

# Build examples
examples = [
    SimpleExample(
        swag_id='example_1',
        context_sentence='the context is here',
        start_ending='ending',
        endings=['choice one', 'choice two', 'choice three', 'choice four'],
        label=1
    ),
    SimpleExample(
        swag_id='example_2',
        context_sentence='another context sentence',
        start_ending='beginning',
        endings=['option one', 'option two', 'option three', 'option four'],
        label=2
    ),
]

tokenizer = SimpleTokenizer()
max_seq_length = 20
is_training = True

ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'max_seq_length': max_seq_length,
    'is_training': is_training,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — 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
create_hypothesis Ran
ran on a synthesized input
INK-USC/KagNet/baselines/run_csqa_bert.py
code served (permissive licence) · get_code("f92024b299799ce7")
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

BLANK_STR = '___'

def create_hypothesis(fitb: str, choice: str) -> str:
    if '. ' + BLANK_STR in fitb or fitb.startswith(BLANK_STR):
        choice = choice[0].upper() + choice[1:]
    else:
        choice = choice.lower()
    if not fitb.endswith(BLANK_STR):
        choice = choice.rstrip('.')
    hypothesis = re.sub('__+', choice, fitb)
    return hypothesis

ARGS = {
    'fitb': 'The quick brown fox jumps over the ___ dog.',
    'choice': 'Lazy'
}
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
del_pos Ran
ran on a synthesized input
INK-USC/KagNet/conceptnet/extract_cpnet.py
code served (permissive licence) · get_code("5f4eefd99c11e698")
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

# Create valid arguments for the del_pos function
ARGS = {
    "s": "example/n"
}
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
get_fitb_from_question Ran
ran; our contract draft was wrong, not the code
INK-USC/KagNet/baselines/run_csqa_bert.py
code served (permissive licence) · get_code("fea5bb325776f21f")
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

BLANK_STR = '___'

def replace_wh_word_with_blank(question_str: str):
    if 'What is the name of the government building that houses the U.S. Congress?' in question_str:
        print()
    question_str = question_str.replace("What's", 'What is')
    question_str = question_str.replace('whats', 'what')
    question_str = question_str.replace('U.S.', 'US')
    wh_word_offset_matches = []
    wh_words = ['which', 'what', 'where', 'when', 'how', 'who', 'why']
    for wh in wh_words:
        if wh == 'who' and 'people who' in question_str:
            continue
        m = re.search(wh + '\\?[^\\.]*[\\. ]*$', question_str.lower())
        if m:
            wh_word_offset_matches = [(wh, m.start())]
            break
        else:
            m = re.search(wh + '[ ,][^\\.]*[\\. ]*$', question_str.lower())
            if m:
                wh_word_offset_matches.append((wh, m.start()))
    if len(wh_word_offset_matches):
        wh_word_offset_matches.sort(key=lambda x: x[1])
        wh_word_found = wh_word_offset_matches[0][0]
        wh_word_start_offset = wh_word_offset_matches[0][1]
        question_str = re.sub('\\?$', '.', question_str.strip())
        fitb_question = question_str[:wh_word_start_offset] + BLANK_STR + question_str[wh_word_start_offset + len(wh_word_found):]
        final = fitb_question.replace(BLANK_STR + ' of the following', BLANK_STR)
        final = final.replace(BLANK_STR + ' of these', BLANK_STR)
        return final
    elif ' them called?' in question_str:
        return question_str.replace(' them called?', ' ' + BLANK_STR + '.')
    elif ' meaning he was not?' in question_str:
        return question_str.replace(' meaning he was not?', ' he was not ' + BLANK_STR + '.')
    elif ' one of these?' in question_str:
        return question_str.replace(' one of these?', ' ' + BLANK_STR + '.')
    elif re.match('.*[^\\.\\?] *$', question_str):
        return question_str + ' ' + BLANK_STR
    else:
        return re.sub(' this[ \\?]', ' ___ ', question_str)

def get_fitb_from_question(question_text: str) -> str:
    fitb = replace_wh_word_with_blank(question_text)
    if not re.match('.*_+.*', fitb):
        fitb = re.sub('[\\.\\? ]*$', '', question_text.strip()) + ' ' + BLANK_STR
    return fitb

ARGS = {
    'question_text': 'What is the capital of France?'
}
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
get_fitb_from_question Ran
ran on a synthesized input
INK-USC/KagNet/datasets/convert_csqa.py
code served (permissive licence) · get_code("692d601c35015e13")
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

BLANK_STR = '___'

def replace_wh_word_with_blank(question_str: str):
    if 'What is the name of the government building that houses the U.S. Congress?' in question_str:
        print()
    question_str = question_str.replace("What's", 'What is')
    question_str = question_str.replace('whats', 'what')
    question_str = question_str.replace('U.S.', 'US')
    wh_word_offset_matches = []
    wh_words = ['which', 'what', 'where', 'when', 'how', 'who', 'why']
    for wh in wh_words:
        if wh == 'who' and 'people who' in question_str:
            continue
        m = re.search(wh + '\\?[^\\.]*[\\. ]*$', question_str.lower())
        if m:
            wh_word_offset_matches = [(wh, m.start())]
            break
        else:
            m = re.search(wh + '[ ,][^\\.]*[\\. ]*$', question_str.lower())
            if m:
                wh_word_offset_matches.append((wh, m.start()))
    if len(wh_word_offset_matches):
        wh_word_offset_matches.sort(key=lambda x: x[1])
        wh_word_found = wh_word_offset_matches[0][0]
        wh_word_start_offset = wh_word_offset_matches[0][1]
        question_str = re.sub('\\?$', '.', question_str.strip())
        fitb_question = question_str[:wh_word_start_offset] + BLANK_STR + question_str[wh_word_start_offset + len(wh_word_found):]
        final = fitb_question.replace(BLANK_STR + ' of the following', BLANK_STR)
        final = final.replace(BLANK_STR + ' of these', BLANK_STR)
        return final
    elif ' them called?' in question_str:
        return question_str.replace(' them called?', ' ' + BLANK_STR + '.')
    elif ' meaning he was not?' in question_str:
        return question_str.replace(' meaning he was not?', ' he was not ' + BLANK_STR + '.')
    elif ' one of these?' in question_str:
        return question_str.replace(' one of these?', ' ' + BLANK_STR + '.')
    elif re.match('.*[^\\.\\?] *$', question_str):
        return question_str + ' ' + BLANK_STR
    else:
        return re.sub(' this[ \\?]', ' ___ ', question_str)

def get_fitb_from_question(question_text: str) -> str:
    fitb = replace_wh_word_with_blank(question_text)
    if not re.match('.*_+.*', fitb):
        print("Can't create hypothesis from: '{}'. Appending {} !".format(question_text, BLANK_STR))
        fitb = re.sub('[\\.\\? ]*$', '', question_text.strip()) + ' ' + BLANK_STR
    return fitb

ARGS = {
    'question_text': 'What is the capital of France?'
}
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
load_embeddings Ran
ran on a synthesized input
INK-USC/KagNet/models/csqa_dataset.py
code served (permissive licence) · get_code("9b0d6be3854d5d6d")
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 2, dtype family float, shape (4, 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 tempfile
import os

# Create a temporary numpy file to serve as the embeddings file
temp_dir = tempfile.mkdtemp()
temp_path = os.path.join(temp_dir, "embeddings.npy")

# Create a small embeddings array (4x3 - distinct sizes)
embeddings_array = np.random.randn(4, 3).astype(np.float32)
np.save(temp_path, embeddings_array)

ARGS = {
    "path": temp_path
}
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 ndarray, ndim 2, dtype family float, shape (4, 3) — shape (4, 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
most_frequent Ran
ran on a synthesized input
INK-USC/KagNet/baselines/ensemble.py
code served (permissive licence) · get_code("08149da7e3c7cab3")
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 int, ndim 0, dtype family int, 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

torch.manual_seed(0)

ARGS = {
    "List": [1, 2, 2, 3, 2, 1],
    "qid": 0
}
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 int, ndim 0, dtype family int, 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
read_csqa_examples Ran
ran on a synthesized input
INK-USC/KagNet/baselines/extract_csqa_bert.py
code served (permissive licence) · get_code("ce2f5b8a15be67db")
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 json
import tempfile
import os

# Create a temporary file with JSONL content for SWAG/CSQA format
temp_dir = tempfile.mkdtemp()
input_file = os.path.join(temp_dir, "test_input.jsonl")

# Write sample CSQA data in JSONL format
sample_data = [
    {
        "id": "q1",
        "question": {
            "stem": "What is the capital of France?",
            "choices": [
                {"text": "London"},
                {"text": "Paris"},
                {"text": "Berlin"},
                {"text": "Madrid"},
                {"text": "Rome"}
            ]
        },
        "answerKey": "B"
    },
    {
        "id": "q2",
        "question": {
            "stem": "What is the largest planet?",
            "choices": [
                {"text": "Mars"},
                {"text": "Venus"},
                {"text": "Jupiter"},
                {"text": "Saturn"},
                {"text": "Neptune"}
            ]
        },
        "answerKey": "C"
    }
]

with open(input_file, 'w', encoding='utf-8') as f:
    for item in sample_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    'input_file': input_file,
    'have_answer': True
}
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
replace_wh_word_with_blank Ran
ran on a synthesized input
INK-USC/KagNet/baselines/run_csqa_bert.py
code served (permissive licence) · get_code("f46246d74e1f7b3e")
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

BLANK_STR = '___'

def replace_wh_word_with_blank(question_str: str):
    if 'What is the name of the government building that houses the U.S. Congress?' in question_str:
        print()
    question_str = question_str.replace("What's", 'What is')
    question_str = question_str.replace('whats', 'what')
    question_str = question_str.replace('U.S.', 'US')
    wh_word_offset_matches = []
    wh_words = ['which', 'what', 'where', 'when', 'how', 'who', 'why']
    for wh in wh_words:
        if wh == 'who' and 'people who' in question_str:
            continue
        m = re.search(wh + '\\?[^\\.]*[\\. ]*$', question_str.lower())
        if m:
            wh_word_offset_matches = [(wh, m.start())]
            break
        else:
            m = re.search(wh + '[ ,][^\\.]*[\\. ]*$', question_str.lower())
            if m:
                wh_word_offset_matches.append((wh, m.start()))
    if len(wh_word_offset_matches):
        wh_word_offset_matches.sort(key=lambda x: x[1])
        wh_word_found = wh_word_offset_matches[0][0]
        wh_word_start_offset = wh_word_offset_matches[0][1]
        question_str = re.sub('\\?$', '.', question_str.strip())
        fitb_question = question_str[:wh_word_start_offset] + BLANK_STR + question_str[wh_word_start_offset + len(wh_word_found):]
        final = fitb_question.replace(BLANK_STR + ' of the following', BLANK_STR)
        final = final.replace(BLANK_STR + ' of these', BLANK_STR)
        return final
    elif ' them called?' in question_str:
        return question_str.replace(' them called?', ' ' + BLANK_STR + '.')
    elif ' meaning he was not?' in question_str:
        return question_str.replace(' meaning he was not?', ' he was not ' + BLANK_STR + '.')
    elif ' one of these?' in question_str:
        return question_str.replace(' one of these?', ' ' + BLANK_STR + '.')
    elif re.match('.*[^\\.\\?] *$', question_str):
        return question_str + ' ' + BLANK_STR
    else:
        return re.sub(' this[ \\?]', ' ___ ', question_str)

ARGS = {
    'question_str': 'Which country is the largest in Europe?'
}
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
patch_replication_callback Not yet run
unverified (harvested, no recorded run)
INK-USC/KagNet/models/parallel.py
code served (permissive licence) · get_code("e50200dbeffa0133")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 5 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 4 later) and 7 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
accuracy 21 other papers
12 dated earlier, 2 the same month, 7 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.08746 (2019-01)
BioBERT: a pre-trained biomedical language representation model for biomedical text mining
1904.03323 (2019-04)
Publicly Available Clinical BERT Embeddings
and 18 more not named here
patch_replication_callback 16 other papers
3 dated earlier, 13 later
1612.01105 (2016-12)
Pyramid Scene Parsing Network
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
1904.01941 (2019-04)
Character Region Awareness for Text Detection
and 13 more not named here
del_pos 5 other papers
5 later
2104.06378 (2021-04)
QA-GNN: Reasoning with Language Models and Knowledge Graphs for Question Answering
2022.findings-naacl.131 (2022 (year only))
Great Truths are Always Simple: A Rather Simple Knowledge Encoder for Enhancing the Commonsense Reasoning Capacity of Pre-Trained Models
2210.09338 (2022-10)
Deep Bidirectional Language-Knowledge Graph Pretraining
and 2 more not named here
get_fitb_from_question 4 other papers
4 later
2104.06378 (2021-04)
QA-GNN: Reasoning with Language Models and Knowledge Graphs for Question Answering
2022.findings-naacl.131 (2022 (year only))
Great Truths are Always Simple: A Rather Simple Knowledge Encoder for Enhancing the Commonsense Reasoning Capacity of Pre-Trained Models
2210.09338 (2022-10)
Deep Bidirectional Language-Knowledge Graph Pretraining
and 1 more not named here
create_hypothesis 1 other paper
1 dated earlier
1809.02789 (2018-09)
Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book 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-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

Commonsense reasoning aims to empower machines with the human ability to make presumptions about ordinary situations in our daily life. In this paper, we propose a textual inference framework for answering commonsense questions, which effectively utilizes external, structured commonsense knowledge graphs to perform explainable inferences. The framework first grounds a question-answer pair from the semantic space to the knowledge-based symbolic space as a schema graph, a related sub-graph of external knowledge graphs. It represents schema graphs with a novel knowledge-aware graph network module named KagNet, and finally scores answers with graph representations. Our model is based on graph convolutional networks and LSTMs, with a hierarchical path-based attention mechanism. The intermediate attention scores make it transparent and interpretable, which thus produce trustworthy inferences. Using ConceptNet as the only external resource for Bert-based models, we achieved state-of-the-art performance on the CommonsenseQA, a large-scale dataset for commonsense reasoning.

For agents

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

get_harvested_code_for_paper("1909.02151")
get_code_for_paper("1909.02151")
have("1909.02151")

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

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

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

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

Connect an agent — have() is free.