技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
hypogenic【数据与研究】Automated LLM-driven hypothesis generation and testing for tabular datasets; use when you need systematic exploration of empirical patterns (e.g., fraud detection, content analysis) and want to combine literature insights with data-driven hypothesis evaluation.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
${text_features_1}, ${num_hypotheses}) for generation and inference.hypogenic (install via PyPI; version depends on your environment)redis (server; used for caching repeated LLM calls)GROBID (service; used for PDF preprocessing)s2orc-doc2json (PDF-to-structured conversion used in literature pipelines)Install:
uv pip install hypogenic
The following example is a minimal end-to-end workflow (dataset + config + CLI + Python). Adjust paths and prompts for your task.
Create three files:
./data/my_task_train.json./data/my_task_val.json./data/my_task_test.jsonExample schema (feature keys can be renamed, but must match your config placeholders):
{
"text_features_1": ["Text A1", "Text A2"],
"text_features_2": ["Text B1", "Text B2"],
"label": ["Class1", "Class2"]
}
./data/my_task/config.yamltask_name: my_task
train_data_path: ./data/my_task_train.json
val_data_path: ./data/my_task_val.json
test_data_path: ./data/my_task_test.json
prompt_templates:
observations: |
Feature 1: ${text_features_1}
Feature 2: ${text_features_2}
Label: ${label}
batched_generation:
system: |
You are a scientific assistant. Propose testable, falsifiable hypotheses that map features to labels.
user: |
Given examples and labels, generate ${num_hypotheses} distinct hypotheses.
Return a JSON list of hypotheses, each with a short name and a testable statement.
inference:
system: |
You are a careful classifier. Use the provided hypothesis to predict the label.
user: |
Hypothesis: ${hypothesis}
Feature 1: ${text_features_1}
Feature 2: ${text_features_2}
Output the final answer as: "final answer: <LABEL>"
# Generate hypotheses (HypoGeniC)
hypogenic_generation \
--config ./data/my_task/config.yaml \
--method hypogenic \
--num_hypotheses 20
# Evaluate generated hypotheses
hypogenic_inference \
--config ./data/my_task/config.yaml \
--hypotheses ./output/hypotheses.json
from hypogenic import BaseTask
import re
def extract_label(llm_output: str) -> str:
m = re.search(r"final answer:\s*(.*)", llm_output, re.IGNORECASE)
return m.group(1).strip() if m else llm_output.strip()
task = BaseTask(
config_path="./data/my_task/config.yaml",
extract_label=extract_label,
)
task.generate_hypotheses(
method="hypogenic",
num_hypotheses=20,
output_path="./output/hypotheses.json",
)
results = task.inference(
hypothesis_bank="./output/hypotheses.json",
test_data="./data/my_task_test.json",
)
print(results)
HypoGeniC (data-driven)
HypoRefine (literature + data)
Union
Literature ∪ HypoGeniCLiterature ∪ HypoRefine${text_features_1}, ${text_features_2}, … (from dataset JSON)${label} (ground truth label, typically used in observation templates)${num_hypotheses} (generation-time control)${hypothesis} (inference-time hypothesis text)extract_label):
label values.final answer: ...; customize for your output format.