技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
data-preparation【数据与研究】Validate and transform XrayGLM image, prompt, and label data with deterministic, local-only workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when a Researcher must inspect, convert, merge, or validate the image/report records consumed by XrayGLM fine-tuning. Keep the data operation separate from fine-tuning, adapters, and inference: this skill produces or checks JSON and Markdown; it does not launch training or model runtime code.
--base-dir explicitly.--force; the same rule applies when output equals an
input path.--help. They do not download images, call translation services, or read
credentials.The repository's data/openi-en.json and data/Xray/openi-zh.json are OpenI
wrappers: an object containing annotations, where each item has image_id
and caption. data/openi-ch-random.json is already a training-record array.
data/demo/dataset.json is another training-record array, but its image paths
are demo-relative and are not interchangeable with the X-ray image directory.
The source prompt builders map an annotation's image_id to
./data/Xray/{image_id}.png, then emit {img, prompt, label}. The fixed
builder uses one diagnostic prompt. The random builder chooses from six
Chinese prompts using an unseeded random choice; do not reproduce that
nondeterminism. convert_xray_json.py --prompt-index 0..5 selects the same six
choices deterministically, or --prompt supplies an explicit prompt.
finetune_XrayGLM.py reads a top-level array and requires non-empty string
fields img, prompt, and label. It opens img as a local image and uses
prompt/label as text. This skill validates that data contract but does not
validate image pixels or medical correctness.
python /ABS/PATH/scripts/validate_xray_records.py INPUT.json.
It accepts either a training array or an OpenI wrapper, reports every schema
error, and rejects repeated image IDs. For a training array add
--check-images --base-dir IMAGE_BASE; relative image paths are resolved
under that base, while absolute paths are used as written.python /ABS/PATH/scripts/convert_xray_json.py SOURCE.json OUTPUT.json
for a training array. Use --format captions for a compact JSON list of
{image_id, caption}, or --format markdown for human-readable caption
blocks headed by image ID. The default image template is
./data/Xray/{image_id}.png; change it with --image-template without
baking a checkout-specific absolute path into data.--prompt-index 0 through 5 for
one deterministic source prompt across all converted records. Use an
explicit --prompt for a project-specific prompt. Never use random choice
when a record manifest must be reproducible.python /ABS/PATH/scripts/merge_xray_records.py RECORDS.json CAPTIONS.json OUT.json.
The default keys are the image stem from record img and image_id from
caption items; captions replace label by key, never by list position.
Counts and key sets must match. --allow-length-mismatch permits an
intentional keyed subset only; unknown keys still fail and unmatched
records remain visibly unchanged in the command note.Translation, XML parsing, and image acquisition are not local helper
operations. data/translation_en2zh.py contains an OpenAI key placeholder and
external ChatCompletion calls; it is evidence of a credentialed external step,
not runnable behavior to copy. Stop if credentials, an approved provider,
privacy review, rate limits, or reproducibility requirements are missing.
data/from_xml_get_images_id.py requires an external OpenI/XML directory and
source image tree; data/build_images_data.py copies files from a source image
folder. Stop rather than guessing those locations or bulk-copying images.
Obtain the dataset through an approved process, record its license and local
base, then use --check-images. No helper in this skill downloads, translates,
scrapes XML, or copies images.
Before a write, confirm the output path, source provenance, image base, prompt
choice, and whether --force is intentional. Keep medical captions as
untrusted source text and retain the original for audit or rollback. Report
record counts, duplicate/key checks, image-check status, and any missing
external evidence to the next agent. A successful JSON transformation is not
a claim that the report is clinically accurate.