This directory provides a simple example of PRC-Bench data processing. It demonstrates how to convert crawled OpenReview review-rebuttal data into QA items through LLM-based decomposition, rewriting, and filtering.
The example contains four stages:
- Decompose broad review/rebuttal discussions into comment-response pairs.
- Filter low-quality comment-response pairs with GLM-4-Plus.
- Rewrite each pair into taxonomy-based QA with either GLM or DeepSeek.
- Filter rewritten QA items with GLM-4-Plus.
example.json: crawled OpenReview example data in JSONL format.prompt.py: prompts for decomposition, rewriting, and quality filtering.decompose.py: extracts review/rebuttal fields and calls a GPT model for decomposition.rewrite.py: rewrites decomposed pairs with one selected GLM or DeepSeek model.filter.py: filters decomposition-stage pairs or rewrite-stage QA items with a GLM model.output/: generated intermediate and final JSONL files.
Run:
OPENAI_API_KEY=your_key python pipeline/decompose.pyOptional variables:
GPT_MODEL=gpt-4o
OPENAI_BASE_URL=https://...
GPT_SLEEP_SECONDS=0Output:
pipeline/output/example_decompose.jsonl
pipeline/output/example_decompose_raw.jsonl
pipeline/output/example_decompose_errors.jsonl
Run:
FILTER_STAGE=decompose GLM_API_KEY=your_glm_key python pipeline/filter.pyOutput:
pipeline/output/example_decompose_filtered.jsonl
pipeline/output/example_decompose_filter_raw.jsonl
pipeline/output/example_decompose_filter_errors.jsonl
Run GLM:
REWRITE_MODEL=glm GLM_API_KEY=your_glm_key python pipeline/rewrite.pyOutputs:
pipeline/output/example_rewrite_glm.jsonl
pipeline/output/example_rewrite_glm_raw.jsonl
pipeline/output/example_rewrite_glm_errors.jsonl
Run DeepSeek:
REWRITE_MODEL=deepseek DEEPSEEK_API_KEY=your_deepseek_key python pipeline/rewrite.pyOutputs:
pipeline/output/example_rewrite_deepseek.jsonl
pipeline/output/example_rewrite_deepseek_raw.jsonl
pipeline/output/example_rewrite_deepseek_errors.jsonl
Optional variables:
GLM_MODEL=glm-4-plus
DEEPSEEK_MODEL=deepseek-chat
DEEPSEEK_BASE_URL=https://api.deepseek.com
REWRITE_SLEEP_SECONDS=1Filter GLM rewrites:
FILTER_STAGE=rewrite FILTER_MODEL=glm GLM_API_KEY=your_glm_key python pipeline/filter.pyOutputs:
pipeline/output/example_rewrite_glm_filtered.jsonl
pipeline/output/example_rewrite_glm_filter_raw.jsonl
pipeline/output/example_rewrite_glm_filter_errors.jsonl
Filter DeepSeek rewrites:
FILTER_STAGE=rewrite FILTER_MODEL=deepseek GLM_API_KEY=your_glm_key python pipeline/filter.pyOutputs:
pipeline/output/example_rewrite_deepseek_filtered.jsonl
pipeline/output/example_rewrite_deepseek_filter_raw.jsonl
pipeline/output/example_rewrite_deepseek_filter_errors.jsonl
Optional variables:
GLM_MODEL=glm-4-plus
FILTER_SLEEP_SECONDS=1*_raw.jsonlfiles preserve original model outputs and are useful when JSON parsing fails.*_filter_raw.jsonlfiles preserve original GLM filter responses.*_errors.jsonland*_filter_errors.jsonlfiles record parsing failures without stopping the whole run.*_filtered.jsonlfiles contain only item-level rows whose filter decision iskeep=true.