| comprehensiveness |
Ran ran, violated the contract we drafted |
ukplab/catfood/src/faithfulness/faithfulness.py code served (permissive licence) · get_code("048fad94afc1d3f6") How it ranRan 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 float64, ndim 0, 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
# Analyze the function:
# - full_text_pred: a single prediction score (float)
# - masked_text_pred: an iterable of prediction scores (list/array)
# The function computes comprehensiveness by comparing full_text_pred
# against each score in masked_text_pred
# full_text_pred is a scalar confidence score
full_text_pred = 0.85
# masked_text_pred is a list/array of confidence scores after masking
# (simulating multiple runs with different masked versions)
masked_text_pred = np.array([0.45, 0.52, 0.38, 0.61])
ARGS = {
"full_text_pred": full_text_pred,
"masked_text_pred": masked_text_pred,
}
- 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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- 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
|
| exact_match_score |
Ran ran, honoured the contract we drafted |
ukplab/catfood/src/shortcuts/evaluate.py code served (permissive licence) · get_code("e35cb1727750ade1") How it ranRan 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 re
import string
def normalize_answer(s):
"""
Lower text and remove punctuation, articles and extra whitespace.
"""
def remove_articles(text):
return re.sub('\\b(a|an|the)\\b', ' ', text)
def white_space_fix(text):
return ' '.join(text.split())
def remove_punc(text):
exclude = set(string.punctuation)
return ''.join((ch for ch in text if ch not in exclude))
def lower(text):
return text.lower()
return white_space_fix(remove_articles(remove_punc(lower(s))))
def exact_match_score(prediction, ground_truth):
"""
Exact match for Squad evaluation
:param prediction:
:param ground_truth:
:return:
"""
if normalize_answer(prediction) == normalize_answer(ground_truth):
return 1
else:
return 0
ARGS = {
"prediction": "The quick brown fox jumps over the lazy dog.",
"ground_truth": "the quick brown fox jumps over the lazy dog"
}
- 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 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
|
| exact_match_score |
Ran ran, honoured the contract we drafted |
ukplab/catfood/src/calibration/baseline/calibration_metrics.py code served (permissive licence) · get_code("ee7ee45b82d4949f") How it ranRan 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 string
import re
def normalize_answer(s):
"""
Lower text and remove punctuation, articles and extra whitespace.
"""
def remove_articles(text):
return re.sub('\\b(a|an|the)\\b', ' ', text)
def white_space_fix(text):
return ' '.join(text.split())
def remove_punc(text):
exclude = set(string.punctuation)
return ''.join((ch for ch in text if ch not in exclude))
def lower(text):
return text.lower()
return white_space_fix(remove_articles(remove_punc(lower(s))))
def exact_match_score(prediction, ground_truth):
"""
Exact match for Squad evaluation
:param prediction:
:param ground_truth:
:return:
"""
if normalize_answer(prediction) == normalize_answer(ground_truth):
return 1
else:
return 0
ARGS = {
"prediction": "The quick brown fox jumps over the lazy dog.",
"ground_truth": "the quick brown fox jumps over the lazy dog"
}
- 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 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
|
| f1_score |
Ran ran, honoured the contract we drafted |
ukplab/catfood/src/shortcuts/evaluate.py code served (permissive licence) · get_code("5e88f388713168c7") How it ranRan 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 float, 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.
from collections import Counter
import re
import string
def normalize_answer(s):
"""
Lower text and remove punctuation, articles and extra whitespace.
"""
def remove_articles(text):
return re.sub('\\b(a|an|the)\\b', ' ', text)
def white_space_fix(text):
return ' '.join(text.split())
def remove_punc(text):
exclude = set(string.punctuation)
return ''.join((ch for ch in text if ch not in exclude))
def lower(text):
return text.lower()
return white_space_fix(remove_articles(remove_punc(lower(s))))
def f1_score(prediction, ground_truth):
"""
Compute f1 score of prediction
:param prediction:
:param ground_truth:
:return:
"""
prediction_tokens = normalize_answer(prediction).split()
ground_truth_tokens = normalize_answer(ground_truth).split()
common = Counter(prediction_tokens) & Counter(ground_truth_tokens)
num_same = sum(common.values())
if num_same == 0:
return 0
precision = 1.0 * num_same / len(prediction_tokens)
recall = 1.0 * num_same / len(ground_truth_tokens)
f1 = 2 * precision * recall / (precision + recall)
return f1
ARGS = {
"prediction": "The quick brown fox jumps over the lazy dog",
"ground_truth": "A quick brown fox jumps over a lazy dog"
}
- 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 float, 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
|
| f1_score |
Ran ran, honoured the contract we drafted |
ukplab/catfood/src/calibration/baseline/calibration_metrics.py code served (permissive licence) · get_code("8cf315af1221f8a1") How it ranRan 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 float, 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 string
import re
from collections import Counter
def normalize_answer(s):
"""
Lower text and remove punctuation, articles and extra whitespace.
"""
def remove_articles(text):
return re.sub('\\b(a|an|the)\\b', ' ', text)
def white_space_fix(text):
return ' '.join(text.split())
def remove_punc(text):
exclude = set(string.punctuation)
return ''.join((ch for ch in text if ch not in exclude))
def lower(text):
return text.lower()
return white_space_fix(remove_articles(remove_punc(lower(s))))
def f1_score(prediction, ground_truth):
"""
Compute f1 score of prediction
:param prediction:
:param ground_truth:
:return:
"""
prediction_tokens = normalize_answer(prediction).split()
ground_truth_tokens = normalize_answer(ground_truth).split()
common = Counter(prediction_tokens) & Counter(ground_truth_tokens)
num_same = sum(common.values())
if num_same == 0:
return 0
precision = 1.0 * num_same / len(prediction_tokens)
recall = 1.0 * num_same / len(ground_truth_tokens)
f1 = 2 * precision * recall / (precision + recall)
return f1
ARGS = {
"prediction": "The quick brown fox jumps over the lazy dog.",
"ground_truth": "A quick brown fox jumps over a lazy dog."
}
- 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 float, 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
|
| get_dev_examples |
Ran ran; our contract draft was wrong, not the code |
ukplab/catfood/src/calibration/baseline/dataloader.py code served (permissive licence) · get_code("69a30240b39852df") How it ranRan 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 os
import json
import tempfile
# Create a temporary directory and JSON file with the expected structure
temp_dir = tempfile.mkdtemp()
# Create sample data matching the structure expected by get_dev_examples
sample_data = {
"data": [
{
"title": "Sample Article 1",
"paragraphs": [
{
"context": "This is a sample context about machine learning.",
"qas": [
{
"id": "q1",
"question": "What is machine learning?",
"question_type": "definition",
"is_yesno": False,
"is_impossible": False,
"answers": [
{
"text": "machine learning",
"answer_start": 10
}
]
},
{
"id": "q2",
"question": "Is this about AI?",
"question_type": "yn",
"is_yesno": True,
"is_impossible": False,
"answers": [
{
"text": "Yes",
"answer_start": 0
}
]
}
]
}
]
},
{
"title": "Sample Article 2",
"paragraphs": [
{
"context": "Python is a programming language.",
"qas": [
{
"id": "q3",
"question": "What is Python?",
"question_type": "definition",
"is_yesno": False,
"is_impossible": True,
"answers": []
}
]
}
]
}
]
}
# Write the sample data to a JSON file
file_name = "dev.json"
file_path = os.path.join(temp_dir, file_name)
with open(file_path, 'w', encoding='utf-8') as f:
json.dump(sample_data, f)
ARGS = {
"data_dir": temp_dir,
"file_name": file_name
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- tqdm — 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
|
| load_bin |
Ran ran; our contract draft was wrong, not the code |
ukplab/catfood/src/shortcuts/eval_metrics.py code served (permissive licence) · get_code("c89cf751ddcfdb07") How it ranRan 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.
import pickle
import tempfile
import os
# Create a temporary binary file with pickled data
temp_dir = tempfile.gettempdir()
temp_file = os.path.join(temp_dir, "test_load_bin.pkl")
# Create some simple test data and pickle it
test_data = {"key": "value", "number": 42, "list": [1, 2, 3]}
with open(temp_file, 'wb') as f:
pickle.dump(test_data, f)
ARGS = {
"fname": temp_file
}
- 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
|
| load_torch_data |
Ran ran, honoured the contract we drafted |
ukplab/catfood/src/shortcuts/eval_metrics.py code served (permissive licence) · get_code("20043e8d5730af16") How it ranRan 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 (2, 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
import tempfile
import os
torch.manual_seed(0)
# Create a temporary file and save a simple tensor to it
temp_dir = tempfile.gettempdir()
fname = os.path.join(temp_dir, "test_tensor.pt")
# Create a small tensor and save it
test_tensor = torch.randn(2, 4)
torch.save(test_tensor, fname)
ARGS = {
"fname": fname
}
- 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 2, dtype family float, shape (2, 4) — shape (2, 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
|
| normalize_answer |
Ran ran; our contract draft was wrong, not the code |
ukplab/catfood/src/shortcuts/evaluate.py code served (permissive licence) · get_code("89c5a532983ce170") How it ranRan 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
import string
def normalize_answer(s):
"""
Lower text and remove punctuation, articles and extra whitespace.
"""
def remove_articles(text):
return re.sub('\\b(a|an|the)\\b', ' ', text)
def white_space_fix(text):
return ' '.join(text.split())
def remove_punc(text):
exclude = set(string.punctuation)
return ''.join((ch for ch in text if ch not in exclude))
def lower(text):
return text.lower()
return white_space_fix(remove_articles(remove_punc(lower(s))))
ARGS = {
"s": "The Quick Brown Fox! Is it a test? Yes, the answer is: great."
}
- 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
|
| normalize_answer |
Ran ran; our contract draft was wrong, not the code |
ukplab/catfood/src/calibration/baseline/calibration_metrics.py code served (permissive licence) · get_code("4f656af1dfa55eb8") How it ranRan 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 string
import re
def normalize_answer(s):
"""
Lower text and remove punctuation, articles and extra whitespace.
"""
def remove_articles(text):
return re.sub('\\b(a|an|the)\\b', ' ', text)
def white_space_fix(text):
return ' '.join(text.split())
def remove_punc(text):
exclude = set(string.punctuation)
return ''.join((ch for ch in text if ch not in exclude))
def lower(text):
return text.lower()
return white_space_fix(remove_articles(remove_punc(lower(s))))
ARGS = {
"s": "The Quick Brown Fox! A lazy dog, and the rest."
}
- 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
|
| sufficiency |
Ran ran, violated the contract we drafted |
ukplab/catfood/src/faithfulness/faithfulness.py code served (permissive licence) · get_code("20e359e157b001eb") How it ranRan 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 float64, ndim 0, 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
# Build arguments for sufficiency function
# sufficiency(full_text_pred, masked_text_pred)
# The function expects:
# - full_text_pred: a scalar prediction score for original text
# - masked_text_pred: an array of prediction scores for masked versions
full_text_pred = 0.85
# masked_text_pred should be an array/list of scores
# Based on the function body, it iterates over masked_text_pred with len()
masked_text_pred = np.array([0.45, 0.52, 0.61, 0.58])
ARGS = {
"full_text_pred": full_text_pred,
"masked_text_pred": masked_text_pred
}
- 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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- 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
|
| top_k |
Ran ran; our contract draft was wrong, not the code |
ukplab/catfood/src/shortcuts/eval_metrics.py code served (permissive licence) · get_code("7eabcc356bd276af") How it ranRan 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
torch.manual_seed(0)
# Construct valid arguments for top_k function
# The function expects:
# - data: a dict with 'feature' (containing a list of tokens) and 'attribution' (tensor)
# - k: an integer for top-k selection
# Create sample tokens (strings)
tokens = ['hello', 'world', 'python', 'code']
# Create attribution scores (tensor with same length as tokens)
attribution = torch.tensor([0.9, 0.3, 0.7, 0.2], dtype=torch.float32)
# Construct the data dict as expected by the function
data = {
'feature': [tokens], # wrapped in a list, accessed as data['feature'][0]
'attribution': attribution
}
# Set k to be less than the number of tokens
k = 2
ARGS = {
'data': data,
'k': k
}
- 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 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
|