evo-defect-pipeline
Orchestration pipeline for defect text normalization.
Key Functions
safe_read_csv(file_path)- Read CSV with encoding fallbacks (utf-8, gbk, replace)discover_codebooks(directory)- Find codebook CSVs, map product_id to filepathbuild_codebook_mapping(codebook_df)- Build preprocessed label -> code dictprocess_record(row, codebook_dict, standard_texts, threshold)- Process single recordexport_results_to_json(records, output_path)- Write JSON with numpy-safe encodingrun_pipeline(data_dir, output_path, threshold)- Full end-to-end pipeline
Usage
import sys
sys.path.insert(0, '/app/environment/skills/evo-defect-pipeline/scripts')
from utils import run_pipeline
run_pipeline('/app/data', '/app/output/solution.json')