| bio_to_entities |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/evaluate_conll_predictions.py code served (permissive licence) · get_code("5a82a9027d979c92") 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 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 torch
import numpy as np
from typing import Dict, List, Sequence, Tuple
# The function bio_to_entities takes a sequence of BIO tags and converts them to entities
# BIO tags are strings like "B-PER", "I-PER", "O", etc.
# The function iterates through tags and extracts entity spans
# Create a simple valid input: a sequence of BIO tags
tags = [
"B-PER", # Begin Person entity at index 0
"I-PER", # Inside Person entity at index 1
"O", # Outside any entity at index 2
"B-LOC", # Begin Location entity at index 3
"I-LOC", # Inside Location entity at index 4
"O", # Outside any entity at index 5
]
ARGS = {
"tags": tags
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 2, 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
|
| build_tag_vocab |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/train_bert_ner.py code served (permissive licence) · get_code("2b7457bfbe0035ee") 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
import numpy as np
from typing import Dict, Iterable, List, Sequence, Tuple
# Setup: create valid arguments for build_tag_vocab
entity_labels = ['PERSON', 'ORG', 'LOCATION', 'DATE']
ARGS = {
'entity_labels': entity_labels
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| compute_metrics_from_tags |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/evaluate_conll_predictions.py code served (permissive licence) · get_code("6720ad9ffde1acbe") 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 torch
import numpy as np
from collections import Counter
from typing import Dict, List, Sequence, Tuple
# Set seed for reproducibility
torch.manual_seed(0)
# Create sample BIO-tagged sequences
# BIO format: B-LABEL (beginning), I-LABEL (inside), O (outside)
gold_sequences = [
['B-PER', 'I-PER', 'O', 'B-LOC', 'I-LOC'],
['B-ORG', 'O', 'B-PER', 'O', 'O'],
['O', 'O', 'B-LOC', 'O', 'O']
]
pred_sequences = [
['B-PER', 'I-PER', 'O', 'B-LOC', 'O'],
['B-ORG', 'O', 'B-PER', 'I-PER', 'O'],
['O', 'B-LOC', 'I-LOC', 'O', 'O']
]
ARGS = {
'gold_sequences': gold_sequences,
'pred_sequences': pred_sequences
}
- 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 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
|
| dedupe_preserve_order |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/export_w2ner_dataset.py code served (permissive licence) · get_code("b5c74fe7c41b8170") 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 int; 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)
ARGS = {
"values": [1, 2, 3, 2, 1, 4, 5, 4, 3]
}
- 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 int — 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
|
| extract_spanned_text |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/brat_to_json_conll.py code served (permissive licence) · get_code("5ee3b795e4dd2cf7") 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.
from dataclasses import dataclass
from typing import Sequence
@dataclass(frozen=True)
class Span:
start: int
end: int
# Setup
text = "hello world from python"
spans = [
Span(start=0, end=5), # "hello"
Span(start=6, end=11), # "world"
Span(start=17, end=23), # "python"
]
ARGS = {
"text": text,
"spans": spans,
}
- 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
|
| filter_annotation_lines |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/prepare_raw_split.py code served (permissive licence) · get_code("d2efbeec4e89afa5") 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
import numpy as np
from typing import Iterable, List
# The function filter_annotation_lines takes lines (an Iterable[str])
# It iterates through lines, strips whitespace, skips empty lines,
# skips lines containing '\tChoose_', and keeps the rest
# Create a list of test annotation lines
test_lines = [
"annotation 1",
" ", # empty/whitespace line
"\tannotation 2",
"line with \tChoose_ in it", # excluded
"valid annotation 3",
"", # empty line
"\tChoose_something", # excluded prefix
" final annotation ", # whitespace to be stripped
]
ARGS = {
"lines": test_lines
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_json |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/convert_w2ner_output_to_brat.py code served (permissive licence) · get_code("f5868f251e1785a0") 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 json
import tempfile
from pathlib import Path
# Create a temporary JSON file with some valid JSON content
with tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False, encoding='utf-8') as f:
json.dump({"key": "value", "number": 42, "list": [1, 2, 3]}, f)
temp_path = Path(f.name)
ARGS = {
"path": 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 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_label_map |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/build_coarse_dataset.py code served (permissive licence) · get_code("4c52123532019b99") 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 json
from pathlib import Path
from tempfile import TemporaryDirectory
# Create a minimal valid schema JSON structure
schema_dict = {
"entity_types": [
{
"coarse_type": "PERSON",
"fine_types": [
{
"fine_type": "person_name",
"brat_label": "PERSON_NAME"
},
{
"fine_type": "person_title",
"brat_label": "PERSON_TITLE"
}
]
},
{
"coarse_type": "LOCATION",
"fine_types": [
{
"fine_type": "city",
"brat_label": "CITY"
},
{
"fine_type": "country",
"brat_label": "COUNTRY"
}
]
},
{
"coarse_type": "ORGANIZATION",
"fine_types": [
{
"fine_type": "company",
"brat_label": "COMPANY"
}
]
}
]
}
# Create a temporary directory and file with the schema
temp_dir = TemporaryDirectory()
schema_path = Path(temp_dir.name) / "schema.json"
schema_path.write_text(json.dumps(schema_dict), encoding='utf-8')
ARGS = {
"schema_path": schema_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 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_pairs |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/prepare_raw_split.py code served (permissive licence) · get_code("e4b6a2d6715aa493") 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 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 tempfile
from pathlib import Path
# Create a temporary directory with test .txt and .ann files
temp_dir = tempfile.TemporaryDirectory()
input_dir = Path(temp_dir.name)
# Create paired .txt and .ann files
txt_file_1 = input_dir / "document1.txt"
ann_file_1 = input_dir / "document1.ann"
txt_file_2 = input_dir / "document2.txt"
ann_file_2 = input_dir / "document2.ann"
txt_file_1.write_text("Sample text content 1")
ann_file_1.write_text("Sample annotation 1")
txt_file_2.write_text("Sample text content 2")
ann_file_2.write_text("Sample annotation 2")
ARGS = {
'input_dir': input_dir
}
- 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 2, 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_w2ner_modules |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/run_w2ner_no_dev.py code served (permissive licence) · get_code("a9afd9edaa0f26eb") 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 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 sys
from pathlib import Path
from unittest.mock import MagicMock
import tempfile
import os
# Create a temporary directory to act as w2ner_root
temp_dir = tempfile.mkdtemp()
w2ner_root = Path(temp_dir)
# Create minimal module files that will be imported
config_content = """
class Config:
def __init__(self):
self.hidden_size = 768
self.num_layers = 2
"""
data_loader_content = """
def create_data_loader(dataset, batch_size=32):
return []
"""
model_content = """
class W2NERModel:
def __init__(self, config):
self.config = config
"""
utils_content = """
def setup_logging():
pass
"""
# Write the module files
(w2ner_root / 'config.py').write_text(config_content)
(w2ner_root / 'data_loader.py').write_text(data_loader_content)
(w2ner_root / 'model.py').write_text(model_content)
(w2ner_root / 'utils.py').write_text(utils_content)
ARGS = {
'w2ner_root': w2ner_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 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
|
| merge_token_indexes |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
daotuanan/PrionNER/code/convert_w2ner_output_to_brat.py code served (permissive licence) · get_code("278255e94d2f1fe6") 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 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from typing import Dict, Sequence, List, Tuple
# The function merge_token_indexes takes:
# 1. indexes: Sequence[int] - a sequence of token indices
# 2. token_offsets: Sequence[Dict[str, int]] - a sequence of dicts with 'start' and 'end' keys
# Looking at the function body:
# - It accesses token_offsets[index]['start'] and token_offsets[index]['end']
# - indexes contains valid indices into token_offsets
# - The function sorts indexes and merges consecutive ones based on token offsets
# Build valid arguments
indexes = [0, 1, 2, 4, 5] # Some indices, with a gap at 3
token_offsets = [
{'start': 0, 'end': 5}, # index 0
{'start': 5, 'end': 10}, # index 1
{'start': 10, 'end': 15}, # index 2
{'start': 20, 'end': 25}, # index 3
{'start': 15, 'end': 20}, # index 4
{'start': 20, 'end': 25}, # index 5
]
ARGS = {
"indexes": indexes,
"token_offsets": token_offsets,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 2, dtype family int — 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
|
| normalize_formats |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/brat_to_json_conll.py code served (permissive licence) · get_code("1f662b56e813d43f") 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 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 torch
import numpy as np
from typing import Dict, Sequence, Tuple
# Construct valid arguments for normalize_formats
raw_formats_basic = ('json', 'conll', 'xml')
raw_formats_with_both = ('json', 'both', 'conll')
raw_formats_single = ('json',)
raw_formats_both_only = ('both',)
ARGS = {
'raw_formats': ('json', 'conll', 'xml')
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| normalize_label_input_mode |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/gliner2_conll_predict.py code served (permissive licence) · get_code("9d34db2fe7dfc5d8") 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 torch
ARGS = {
"label_input_mode": "short"
}
- 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 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_label_list |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/gliner2_conll_predict.py code served (permissive licence) · get_code("6e7770475cd00bc3") 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
import numpy as np
from typing import List
# Define the arguments for normalize_label_list
labels = [
"B-PER",
"I-PER",
"O",
"B-LOC",
"S-ORG",
"E-MISC",
" ",
"PER",
"B-PER", # duplicate
"",
"LOC",
"I-LOC"
]
ARGS = {
"labels": labels
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| parse_span_list |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/brat_to_json_conll.py code served (permissive licence) · get_code("8accd4a1e98e7093") 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 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.
from dataclasses import dataclass
from typing import Dict, Iterable, List, Sequence, Tuple
@dataclass(frozen=True)
class Span:
start: int
end: int
def parse_span_list(raw: str) -> Tuple[Span, ...]:
spans: List[Span] = []
for chunk in raw.split(';'):
start_str, end_str = chunk.split()
start = int(start_str)
end = int(end_str)
if start >= end:
raise ValueError(f'Invalid span {chunk!r}.')
spans.append(Span(start=start, end=end))
return tuple(spans)
ARGS = {
'raw': '0 5;10 20;3 8'
}
- 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
|
| read_conll |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/evaluate_conll_predictions.py code served (permissive licence) · get_code("5149436dbbc79df7") 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 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.
from pathlib import Path
import tempfile
# Create a temporary CoNLL-formatted file
with tempfile.NamedTemporaryFile(mode='w', suffix='.conll', delete=False, encoding='utf-8') as f:
f.write("The\tDET\n")
f.write("cat\tNOUN\n")
f.write("sat\tVERB\n")
f.write("\n")
f.write("Dogs\tNOUN\n")
f.write("run\tVERB\n")
f.write("\n")
temp_path = f.name
conll_path = Path(temp_path)
ARGS = {
'path': conll_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 — 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
|
| read_schema_labels |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/gliner2_conll_predict.py code served (permissive licence) · get_code("ccc172ad50696aa8") 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 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 json
from pathlib import Path
from tempfile import TemporaryDirectory
import os
# Create a temporary directory and schema file
temp_dir = TemporaryDirectory()
schema_path = os.path.join(temp_dir.name, "schema.json")
# Create a valid schema JSON file
schema_data = {
"entity_types": [
{
"coarse_type": "PERSON",
"definition": "A person's name",
"examples": ["John", "Alice"],
"fine_types": [
{
"fine_type": "PERSON_FIRST",
"definition": "First name of a person",
"examples": ["John", "Alice"]
},
{
"fine_type": "PERSON_LAST",
"definition": "Last name of a person",
"examples": ["Smith", "Johnson"]
}
]
},
{
"coarse_type": "LOCATION",
"definition": "A geographic location",
"examples": ["New York", "Paris"],
"fine_types": [
{
"fine_type": "LOCATION_CITY",
"definition": "A city name",
"examples": ["New York", "Paris"]
}
]
},
{
"coarse_type": "ORGANIZATION",
"definition": "An organization name",
"examples": ["Google", "Microsoft"],
"fine_types": []
}
]
}
# Write schema file
with open(schema_path, 'w', encoding='utf-8') as f:
json.dump(schema_data, f)
ARGS = {
"schema_file": schema_path,
"label_input_mode": "def"
}
- 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 — 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
|
| resolve_model_name |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/train_bert_ner.py code served (permissive licence) · get_code("57dfe5261a9134b3") 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 torch
import torch.nn as nn
# resolve_model_name takes a single parameter 'raw' which is a string
# The function calls raw.lower() and uses it as a key in MODEL_ALIASES.get()
# It returns either the aliased model name or the original raw string
ARGS = {
'raw': 'biobert'
}
- 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 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
|
| resolve_model_name |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/train_gliner2_ner.py code served (permissive licence) · get_code("ea7bb9a0ef66200b") 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 torch
MODEL_ALIASES = {'gliner2_base': 'fastino/gliner2-base-v1', 'gliner2_large': 'fastino/gliner2-large-v1'}
def resolve_model_name(raw: str) -> str:
return MODEL_ALIASES.get(raw.lower(), raw)
ARGS = {
'raw': 'gliner2_base'
}
- 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 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
|
| span_text |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/build_coarse_dataset.py code served (permissive licence) · get_code("2ec905b7f5d5735d") 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.
class Span:
def __init__(self, start, end):
self.start = start
self.end = end
span1 = Span(0, 5)
span2 = Span(10, 15)
span3 = Span(20, 25)
ARGS = {
'spans': (span1, span2, span3)
}
- 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
|
| span_texts |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
daotuanan/PrionNER/code/convert_w2ner_output_to_brat.py code served (permissive licence) · get_code("d22dd17ae17f7ed6") 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 torch
import numpy as np
# Construct arguments for span_texts function
# The function takes a text string and an iterable of (start, end) tuples
# and returns a string joining the text spans
text = "The quick brown fox jumps over the lazy dog"
spans = [(0, 3), (4, 9), (10, 15), (20, 23)]
ARGS = {
"text": text,
"spans": spans
}
- 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
|
| strip_footer_markers |
Ran ran; our contract draft was wrong, not the code |
daotuanan/PrionNER/code/prepare_raw_split.py code served (permissive licence) · get_code("ccb47bea461c7c85") 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 torch
import numpy as np
# Analyze the function:
# - strip_footer_markers takes a single parameter: text (str)
# - It processes the text by iterating through lines
# - It breaks when a line starts with one of the MARKER_PREFIXES
# - It returns the kept lines joined with newlines, with trailing newlines stripped
# Create test cases for the text parameter
test_text_with_marker = """This is line 1
This is line 2
<Related> This line should not be included
This line also should not be included"""
test_text_without_marker = """This is line 1
This is line 2
This is line 3"""
test_text_with_done_marker = """Header line 1
Header line 2
[DONE] This should not appear
Footer line"""
test_text_with_check_marker = """Some content
[CHECK] Stop here
More content"""
# Use one of the test cases
ARGS = {
"text": test_text_with_marker
}
- 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
|