| build_prompt |
Ran ran; our contract draft was wrong, not the code |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("c22afcb8a1f118a3") 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
torch.manual_seed(0)
# A sentence is a list of field lists (CoNLL-U format)
# Each row is a list of 10 fields: ID, FORM, LEMMA, UPOS, XPOS, FEATS, HEAD, DEPREL, DEPS, MISC
sentence = [
['1', 'The', 'the', 'DET', 'DT', '_', '2', 'det', '_', '_'],
['2', 'cat', 'cat', 'NOUN', 'NN', '_', '3', 'nsubj', '_', '_'],
['3', 'sat', 'sit', 'VERB', 'VBD', '_', '0', 'root', '_', '_'],
]
latinpipe_sent = [
['1', 'The', 'the', 'DET', 'DT', '_', '2', 'det', '_', '_'],
['2', 'cat', 'cat', 'NOUN', 'NN', '_', '3', 'nsubj', '_', '_'],
['3', 'sat', 'sit', 'VERB', 'VBD', '_', '0', 'root', '_', '_'],
]
# Examples are a list of sentences (each sentence is a list of field lists)
examples = [
[
['1', 'A', 'a', 'DET', 'DT', '_', '2', 'det', '_', '_'],
['2', 'dog', 'dog', 'NOUN', 'NN', '_', '3', 'nsubj', '_', '_'],
['3', 'barked', 'bark', 'VERB', 'VBD', '_', '0', 'root', '_', '_'],
],
[
['1', 'She', 'she', 'PRON', 'PRP', '_', '2', 'nsubj', '_', '_'],
['2', 'ran', 'run', 'VERB', 'VBD', '_', '0', 'root', '_', '_'],
],
[
['1', 'The', 'the', 'DET', 'DT', '_', '2', 'det', '_', '_'],
['2', 'bird', 'bird', 'NOUN', 'NN', '_', '3', 'nsubj', '_', '_'],
['3', 'flew', 'fly', 'VERB', 'VBD', '_', '0', 'root', '_', '_'],
],
[
['1', 'I', 'I', 'PRON', 'PRP', '_', '2', 'nsubj', '_', '_'],
['2', 'saw', 'see', 'VERB', 'VBD', '_', '0', 'root', '_', '_'],
['3', 'it', 'it', 'PRON', 'PRP', '_', '2', 'obj', '_', '_'],
],
[
['1', 'They', 'they', 'PRON', 'PRP', '_', '2', 'nsubj', '_', '_'],
['2', 'walked', 'walk', 'VERB', 'VBD', '_', '0', 'root', '_', '_'],
],
]
guidelines_text = 'Use nsubj for nominal subjects and obj for direct objects. Mark the root with HEAD=0.'
ARGS = {
'sentence': sentence,
'latinpipe_sent': latinpipe_sent,
'examples': examples,
'guidelines_text': guidelines_text,
}
- 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
|
| clean_mwts |
Ran ran; our contract draft was wrong, not the code |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("552974f50537566e") 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
def clean_mwts(sentence_data):
"""Clean Multi-Word Token lines: set HEAD and DEPREL to underscore."""
for line in sentence_data:
if isinstance(line, list) and '-' in line[0]:
line[6] = '_'
line[7] = '_'
return sentence_data
# Construct valid arguments for clean_mwts
# The function expects sentence_data to be an iterable of lists
# Each list should have at least 8 elements (indices 0-7)
# Lines with '-' in the first element (index 0) will have indices 6 and 7 set to '_'
sentence_data = [
['1', 'word1', 'lemma1', 'pos1', 'xpos1', 'feats1', 'head1', 'deprel1'],
['2-3', 'word2', 'lemma2', 'pos2', 'xpos2', 'feats2', 'head2', 'deprel2'],
['4', 'word3', 'lemma3', 'pos3', 'xpos3', 'feats3', 'head3', 'deprel3'],
['5-6', 'word4', 'lemma4', 'pos4', 'xpos4', 'feats4', 'head4', 'deprel4'],
]
ARGS = {
'sentence_data': sentence_data
}
- 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
|
| extract_conllu |
Ran ran; our contract draft was wrong, not the code |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("f639ea70fe375ea9") 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
def extract_conllu(response_text: str) -> str:
"""Extract CoNLL-U block from an LLM response (handles markdown fences)."""
match = re.search('```(?:conllu|text|)\\s*\\n?(.*?)```', response_text, re.DOTALL)
if match:
return match.group(1).strip()
return response_text.strip()
# Test case 1: response with markdown fence containing conllu block
response_with_fence = """Here is the parse:
conllu
1 The the DET _ _ 2 det _ _
2 cat cat NOUN _ _ 3 nsubj _ _
3 sat sit VERB _ _ 0 root _ _
Done."""
# Test case 2: response with plain text (no fence)
response_plain = """1 The the DET _ _ 2 det _ _
2 cat cat NOUN _ _ 3 nsubj _ _"""
# Test case 3: response with text fence
response_text_fence = """```text
1 The the DET _ _ 2 det _ _
"""
# Test case 4: response with no fence marker
response_no_marker = """
1 The the DET _ _ 2 det _ _
"""
ARGS = {
"response_text": response_with_fence
}
- 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
|
| fix_cycles |
Ran ran; our contract draft was wrong, not the code |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("34c09a7850abf158") 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
def create_sentence_data():
"""
Create valid sentence_data structure for fix_cycles function.
The function expects:
- A list of lines
- Each line is a list where:
- line[0] is a digit string (node ID)
- line[6] is a digit string (head/parent ID, or non-digit to skip)
- line[7] is a string (dependency relation)
"""
sentence_data = [
# Format: [id, form, lemma, upos, xpos, feats, head, deprel, ...]
['1', 'The', 'the', 'DET', 'DT', '_', '2', 'det'],
['2', 'dog', 'dog', 'NOUN', 'NN', '_', '3', 'nsubj'],
['3', 'runs', 'run', 'VERB', 'VBZ', '_', '0', 'root'],
['0', 'ROOT', 'ROOT', 'ROOT', 'ROOT', '_', '_', 'root'],
]
return sentence_data
def create_sentence_data_with_cycle():
"""
Create sentence_data with a dependency cycle.
This will test the cycle detection and fixing logic.
"""
sentence_data = [
# Create a cycle: 1 -> 2 -> 3 -> 1
['1', 'word1', 'word1', 'NOUN', 'NN', '_', '2', 'nsubj'],
['2', 'word2', 'word2', 'VERB', 'VBZ', '_', '3', 'root'],
['3', 'word3', 'word3', 'NOUN', 'NN', '_', '1', 'obj'],
['0', 'ROOT', 'ROOT', 'ROOT', 'ROOT', '_', '_', 'root'],
]
return sentence_data
# Use the version with cycle since the function is designed to fix cycles
ARGS = {
'sentence_data': create_sentence_data_with_cycle(),
}
- 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
|
| fix_mwt_heads |
Ran ran; our contract draft was wrong, not the code |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("73304896355a0e4b") 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
# Analyze the function: it processes sentence_data which is a list of lines
# Each line can be:
# 1. A list where line[0] might contain '-' (MWT range indicator like "1-2")
# 2. A list where line[6] might be a HEAD that needs fixing
# The function:
# - Builds a range_map from MWT tokens (lines where line[0] has '-')
# - Maps the range (e.g., "1-2") to its start (e.g., "1")
# - Fixes any HEAD values (line[6]) that point to MWT ranges
# Example CoNLL-U format where each line is a list of token fields
# Indices: 0=ID, 1=FORM, 2=LEMMA, 3=UPOS, 4=XPOS, 5=FEATS, 6=HEAD, 7=DEPREL, ...
sentence_data = [
# Regular token with ID "1"
["1", "The", "the", "DET", "DT", "_", "2", "det", "_", "_"],
# MWT range "2-3" (multiword token)
["2-3", "don't", "_", "_", "_", "_", "_", "_", "_", "_"],
# First word of MWT with ID "2", HEAD points to MWT range "2-3"
["2", "do", "do", "AUX", "VB", "_", "2-3", "aux", "_", "_"],
# Second word of MWT with ID "3", HEAD points to MWT range "2-3"
["3", "n't", "not", "PART", "RP", "_", "2-3", "advmod", "_", "_"],
# Regular token with ID "4"
["4", "go", "go", "VERB", "VB", "_", "0", "root", "_", "_"],
]
ARGS = {
"sentence_data": sentence_data
}
- 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
|
| fix_roots |
Ran ran; our contract draft was wrong, not the code |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("50840caf7cb9358e") 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
# Analyze the function:
# - Takes sentence_data (list of items)
# - Each item can be a list with at least 7 elements
# - First element (index 0) should be a digit string
# - Element at index 6 is checked/set to '0'
# - Element at index 7 is set to strings like 'parataxis' or 'root'
# - Function modifies the list in-place and returns it
# Create valid sentence_data with multiple roots (HEAD=0)
sentence_data = [
['1', 'The', 'DET', 'the', '_', '_', '0', 'root'], # root with HEAD=0
['2', 'cat', 'NOUN', 'cat', '_', '_', '0', 'root'], # another root with HEAD=0
['3', 'sat', 'VERB', 'sit', '_', '_', '1', 'nsubj'], # depends on 1
]
ARGS = {
'sentence_data': sentence_data
}
- 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
|
| parse_response |
Ran ran; our contract draft was wrong, not the code |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("a7e44ce956d21681") 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. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
def extract_conllu(response_text: str) -> str:
"""Extract CoNLL-U block from an LLM response (handles markdown fences)."""
match = re.search('```(?:conllu|text|)\\s*\\n?(.*?)```', response_text, re.DOTALL)
if match:
return match.group(1).strip()
return response_text.strip()
def parse_response(text):
"""Parse CoNLL-U from LLM response text."""
text = extract_conllu(text)
new_sent = []
for line in text.split('\n'):
line = line.strip()
if not line:
continue
if line.startswith('```'):
continue
if line.startswith('#'):
new_sent.append(line)
continue
parts = line.split('\t')
if len(parts) == 10:
new_sent.append(parts)
return new_sent
# Construct valid test arguments
ARGS = {
"text": """```conllu
# sent_id = 1
# text = The quick brown fox
1 The the DET _ _ _ _ _ _
2 quick quick ADJ _ _ _ _ _ _
3 brown brown ADJ _ _ _ _ _ _
4 fox fox NOUN _ _ _ _ _ _
"""
}
- 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 — a list 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
|
| refine_sentence |
Ran ran; our contract draft was wrong, not the code |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("a124ce61d7511eb1") 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. 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
# Mock OpenAI client
class MockOpenAIClient:
def __init__(self):
pass
def chat_completions_create(self, model, messages, temperature=0.7, max_tokens=2000):
# Mock response with a CoNLL-U formatted sentence
return MockResponse()
class MockResponse:
def __init__(self):
self.choices = [MockChoice()]
class MockChoice:
def __init__(self):
self.message = MockMessage()
class MockMessage:
def __init__(self):
self.content = """```conllu
# sent_id = 1
# text = Qui est vir.
1 Qui qui PRON _ _ 2 nsubj _ _
2 est sum AUX _ _ 0 root _ _
3 vir vir NOUN _ _ 2 xcomp _ SpaceAfter=No
4 . . PUNCT _ _ 2 punct _ _
"""
# Sample sentence data in CoNLL-U format
def create_sample_sentence():
return [
'# sent_id = 1',
'# text = Qui est vir.',
['1', 'Qui', 'qui', 'PRON', '_', '_', '2', 'nsubj', '_', '_'],
['2', 'est', 'sum', 'AUX', '_', '_', '0', 'root', '_', '_'],
['3', 'vir', 'vir', 'NOUN', '_', '_', '2', 'xcomp', '_', 'SpaceAfter=No'],
['4', '.', '.', 'PUNCT', '_', '_', '2', 'punct', '_', '_'],
]
def create_sample_examples():
return [
create_sample_sentence(),
create_sample_sentence(),
create_sample_sentence(),
create_sample_sentence(),
create_sample_sentence(),
]
ARGS = {
'client': MockOpenAIClient(),
'sentence': create_sample_sentence(),
'latinpipe_sent': create_sample_sentence(),
'examples': create_sample_examples(),
'guidelines_text': 'Use standard dependency relations. ROOT should attach to 0. All sentences must have exactly one root.',
'idx': 0,
}
- 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 — a list 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
|
| format_conllu |
Not yet run unverified (harvested, no recorded run) |
l-pommeret/THIVLVC/src/pipeline/stage1_rag_with_baseline.py code served (permissive licence) · get_code("4ba8d8b7670b8589") How it ran |