v13-f1 Task 1.10: popupSelect+popupAttr+relationFormAttr+RelationQuery 0 误差 (52/52 PASS)
Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
fb7511068c
commit
1d148ac286
17 files changed
+1294
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""从 35 form baseline 提取所有 popupAttr 控件的 formData 真实样本.
|
||||
popupAttr 控件判定: __config__.jnpfKey == 'popupAttr'."""
|
||||
import json, glob, os
|
||||
|
||||
OUT = "scripts/popupAttr-baseline-samples.jsonl"
|
||||
samples = []
|
||||
for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"):
|
||||
try:
|
||||
d = json.load(open(path))['data']
|
||||
fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {}
|
||||
for f in fd.get('fields', []):
|
||||
if isinstance(f, dict):
|
||||
cfg = f.get('__config__', {})
|
||||
if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'popupAttr':
|
||||
samples.append({
|
||||
"source": os.path.basename(path),
|
||||
"label": f.get('label') or cfg.get('label'),
|
||||
"formData": f
|
||||
})
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
with open(OUT, 'w') as out:
|
||||
for s in samples:
|
||||
out.write(json.dumps(s, ensure_ascii=False) + "\n")
|
||||
|
||||
print(f"Extracted {len(samples)} popupAttr 控件 samples to {OUT}")
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""从 35 form baseline 提取所有 popupSelect 控件的 formData 真实样本.
|
||||
popupSelect 控件判定: __config__.jnpfKey == 'popupSelect'."""
|
||||
import json, glob, os
|
||||
|
||||
OUT = "scripts/popupSelect-baseline-samples.jsonl"
|
||||
samples = []
|
||||
for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"):
|
||||
try:
|
||||
d = json.load(open(path))['data']
|
||||
fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {}
|
||||
for f in fd.get('fields', []):
|
||||
if isinstance(f, dict):
|
||||
cfg = f.get('__config__', {})
|
||||
if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'popupSelect':
|
||||
samples.append({
|
||||
"source": os.path.basename(path),
|
||||
"label": f.get('label') or cfg.get('label'),
|
||||
"formData": f
|
||||
})
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
with open(OUT, 'w') as out:
|
||||
for s in samples:
|
||||
out.write(json.dumps(s, ensure_ascii=False) + "\n")
|
||||
|
||||
print(f"Extracted {len(samples)} popupSelect 控件 samples to {OUT}")
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""从 35 form baseline 提取所有 relationFormAttr 控件的 formData 真实样本.
|
||||
relationFormAttr 控件判定: __config__.jnpfKey == 'relationFormAttr'."""
|
||||
import json, glob, os
|
||||
|
||||
OUT = "scripts/relationFormAttr-baseline-samples.jsonl"
|
||||
samples = []
|
||||
for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"):
|
||||
try:
|
||||
d = json.load(open(path))['data']
|
||||
fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {}
|
||||
for f in fd.get('fields', []):
|
||||
if isinstance(f, dict):
|
||||
cfg = f.get('__config__', {})
|
||||
if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'relationFormAttr':
|
||||
samples.append({
|
||||
"source": os.path.basename(path),
|
||||
"label": f.get('label') or cfg.get('label'),
|
||||
"formData": f
|
||||
})
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
with open(OUT, 'w') as out:
|
||||
for s in samples:
|
||||
out.write(json.dumps(s, ensure_ascii=False) + "\n")
|
||||
|
||||
print(f"Extracted {len(samples)} relationFormAttr 控件 samples to {OUT}")
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""从 35 form baseline 提取所有 relationQuery 控件的 formData 真实样本.
|
||||
relationQuery 控件判定: __config__.jnpfKey == 'relationQuery'."""
|
||||
import json, glob, os
|
||||
|
||||
OUT = "scripts/relationQuery-baseline-samples.jsonl"
|
||||
samples = []
|
||||
for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"):
|
||||
try:
|
||||
d = json.load(open(path))['data']
|
||||
fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {}
|
||||
for f in fd.get('fields', []):
|
||||
if isinstance(f, dict):
|
||||
cfg = f.get('__config__', {})
|
||||
if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'relationQuery':
|
||||
samples.append({
|
||||
"source": os.path.basename(path),
|
||||
"label": f.get('label') or cfg.get('label'),
|
||||
"formData": f
|
||||
})
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
with open(OUT, 'w') as out:
|
||||
for s in samples:
|
||||
out.write(json.dumps(s, ensure_ascii=False) + "\n")
|
||||
|
||||
print(f"Extracted {len(samples)} relationQuery 控件 samples to {OUT}")
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Reference in new issue
Block a user