"""Manual synthetic claim/source labels and annotator agreement."""
import json
claims=['C1','C2','C3','C4'];links=[('C1','S1'),('C2','S1'),('C3','S2')];supports={('C1','S1'),('C3','S2')}
coverage=len({c for c,s in links if (c,s) in supports})/len(claims)
precision=sum(e in supports for e in links)/len(links)
a=[1,1,1,1,0,0,0,0];b=[1,1,1,0,0,0,0,0];po=sum(x==y for x,y in zip(a,b))/8;pa=sum(a)/8;pb=sum(b)/8;pe=pa*pb+(1-pa)*(1-pb);k=(po-pe)/(1-pe)
print(json.dumps({'label':'人工构造支持标签，不是自动语义判断','claim_coverage':coverage,'supported_link_fraction':precision,'agreement':po,'expected_agreement':pe,'cohen_kappa':k},ensure_ascii=False,indent=2))
