用途:Hypogenic 用大语言模型在表格数据集上自动生成并检验科学假设,加速实证研究。支持三种方法:HypoGeniC(纯数据驱动)、HypoRefine(文献与数据协同)、Union(文献假设与数据驱动假设的机制化组合)。
主要能力:从数据中生成 10–20+ 条可检验假设并迭代精炼;通过 PDF 与 GROBID 提取文献洞见;支持 OpenAI、Anthropic 及 vllm、huggingface 本地模型;Redis 缓存降低 API 成本;并行处理与自适应精炼;冗余检查剔除近重复假设。据 arXiv:2410.17309,较 few-shot 提升 8.97%、较纯文献提升 15.75%、较纯数据驱动提升 3.37%。
使用方式:安装 uv pip install hypogenic(0.3.5 固定 numpy~=1.26、pandas~=2.1、torch~=2.4、transformers~=4.45、openai~=1.40、anthropic~=0.32,Python 3.10–3.12,建议独立环境)。克隆示例数据:git clone https://github.com/ChicagoHAI/HypoGeniC-datasets.git ./data。生成:hypogenic_generation --task_config_path ./data/your_task/config.yaml --model_type gpt --model_name <name> --max_num_hypotheses 20 --output_folder ./outputs/your_task。推理:hypogenic_inference --task_config_path ... --hypothesis_file ./outputs/your_task/<hypotheses_*.json> --model_type gpt --model_name <name>。HypoRefine/Union 需用 examples/ 脚本,并先 bash ./modules/setup_grobid.sh、bash ./modules/run_grobid.sh、python pdf_preprocess.py --task_name YOUR_TASK_NAME。数据须为 HuggingFace 格式,含 <TASK>_train/val/test.json,键为 text_features_1..n 与 label,各列表等长。需编写 config.yaml 定义提示模板,并实现 extract_label()。
适用场景:从观测数据生成假设、系统检验竞争假设、结合文献与实证模式,如欺骗检测、AI 生成内容识别、心理健康指标、预测建模等。
限制:非单行 fluent API,需按 init/update 循环适配示例脚本;文献自动检索暂未支持;GROBID 与 s2orc-doc2json 为可选依赖;依赖版本固定,不宜装入主分析环境。许可 MIT。