RefSeg-CA / source /code /annotate_parser_audit.py
nmsofficial's picture
Add verified public availability and human-evaluation guide
9126e0d verified
Raw
History Blame Contribute Delete
2.77 kB
"""Encode the assistant's text-only inspection; never a human accuracy audit."""
from pathlib import Path
import csv,json,collections
ROOT=Path(__file__).resolve().parents[1];path=ROOT/'review/parser_audit_122.csv'
rows=list(csv.DictReader(path.open()))
labels={
'exact_cardinality_lost':[3,5,14,18,22,25,26,39,41,43,47,50,52,53,62,63,64,66,70,71,74],
'decomposition_artifact':[1,2,6,8,13,78,82,83],
'morphology_or_plurality_artifact':[12,31,94],
'complex_scope_unverified':[0,15,16,17,19,20,21,23,24,27,28,29,30,32,42,77,79,85,95,102,105,114,115],
'modifier_scope_retained':[4,9,11,33],
}
notes={
'exact_cardinality_lost':'The plural flag does not enforce the exact number requested by two/both/three. Incidental correct cardinality is not parsing correctness.',
'decomposition_artifact':'A dangling preposition or adverb remains in the target phrase. The target/anchor boundary is not a clean noun-phrase decomposition.',
'morphology_or_plurality_artifact':'Naive final-token singularization or the explicit plural-keyword rule changes an inflection or loses implicit plural scope.',
'complex_scope_unverified':'The expression contains coordination, nested modifiers, ambiguous attachment or multiple spatial constraints; one target/anchor slot does not verify full scope.',
'modifier_scope_retained':'A modifier remains inside a target/anchor phrase and the outer relation is separable. The new lexical guard conservatively rejects this case.',
'simple_representable':'The text admits the implemented plural-union or unary-extreme form, or an unambiguous outer relation. This is a text-only judgment, not verification of visual grounding.'
}
assigned={i:label for label,ids in labels.items() for i in ids};assert sum(map(len,labels.values()))==len(assigned)
for i,r in enumerate(rows):
label=assigned.get(i,'simple_representable');r.update(ai_audit_category=label,ai_audit_note=notes[label],audit_authority='AI assistant; text-only; provisional',human_verdict='',human_notes='')
with path.open('w') as f:
w=csv.DictWriter(f,fieldnames=rows[0]);w.writeheader();w.writerows(rows)
meta=dict(n=len(rows),authority='AI assistant; not independent human adjudication',scope='Original 122 accepted expressions in the 1,800-image Phase 1 natural evaluation; all read as text',counts=dict(collections.Counter(r['ai_audit_category'] for r in rows)),guard_accepted_counts=dict(collections.Counter(r['ai_audit_category'] for r in rows if r['scope_safe']=='True')),precision_reported=False,reason='Several categories require image context and two independent human judgments; no certified parser precision or inter-rater agreement is claimed.')
(ROOT/'review/parser_audit_summary.json').write_text(json.dumps(meta,indent=2));print(json.dumps(meta,indent=2))