[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73GWTWGS5AYYA14H94VJTH6":3,"skill-same:01M73GWTWGS5AYYA14H94VJTH6":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73GWTWGS5AYYA14H94VJTH6","hypogenic-hypothesis-generation",null,"LLM-driven hypothesis generation\u002Ftesting on tabular data. Three methods: HypoGeniC (data-driven), HypoRefine (literature+data), Union. Iterative refinement, Redis caching, multi-hypothesis inference. Manual: hypothesis-generation; ideation: scientific-brainstorming.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fhypogenic-hypothesis-generation\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: \"hypogenic-hypothesis-generation\"\ndescription: \"LLM-driven hypothesis generation\u002Ftesting on tabular data. Three methods: HypoGeniC (data-driven), HypoRefine (literature+data), Union. Iterative refinement, Redis caching, multi-hypothesis inference. Manual: hypothesis-generation; ideation: scientific-brainstorming.\"\nlicense: \"MIT\"\n---\n\n# HypoGeniC Hypothesis Generation\n\n## Overview\n\nHypoGeniC automates scientific hypothesis generation and testing using LLMs on tabular datasets. Given labeled data (e.g., deception detection, AI-content identification), it generates testable hypotheses, iteratively refines them against validation performance, and runs inference to classify new samples. It supports three approaches: purely data-driven (HypoGeniC), literature-integrated (HypoRefine), and mechanistic union of both.\n\n## When to Use\n\n- Generating testable hypotheses from labeled observational datasets without prior theory\n- Systematically testing multiple competing hypotheses on empirical data\n- Combining insights from research papers with data-driven pattern discovery\n- Accelerating hypothesis ideation in domains like deception detection, content analysis, mental health indicators\n- Benchmarking LLM-based hypothesis generation methods against few-shot baselines\n- For manual hypothesis formulation frameworks, use **hypothesis-generation** knowhow\n- For general-purpose ML classification without hypothesis interpretability, use **scikit-learn-machine-learning**\n\n## Prerequisites\n\n- **Python packages**: `hypogenic`\n- **Optional**: Redis server (port 6832) for LLM response caching; GROBID for PDF literature processing\n- **API keys**: OpenAI, Anthropic, or compatible LLM API key in environment\n- **Data**: Labeled JSON datasets in HypoGeniC format (see Key Concepts)\n\n```bash\npip install hypogenic\n\n# Optional: clone example datasets\ngit clone https:\u002F\u002Fgithub.com\u002FChicagoHAI\u002FHypoGeniC-datasets.git .\u002Fdata\ngit clone https:\u002F\u002Fgithub.com\u002FChicagoHAI\u002FHypothesis-agent-datasets.git .\u002Fdata_lit\n```\n\n## Quick Start\n\n```python\nfrom hypogenic import BaseTask\nimport re\n\n# Custom label extractor (must match dataset label format)\ndef extract_label(text: str) -> str:\n    match = re.search(r'final answer:\\s+(.*)', text, re.IGNORECASE)\n    return match.group(1).strip() if match else text.strip()\n\n# 1. Load task from config\ntask = BaseTask(\n    config_path=\".\u002Fdata\u002Fyour_task\u002Fconfig.yaml\",\n    extract_label=extract_label\n)\n\n# 2. Generate hypotheses (data-driven)\ntask.generate_hypotheses(\n    method=\"hypogenic\",\n    num_hypotheses=20,\n    output_path=\".\u002Foutput\u002Fhypotheses.json\"\n)\n\n# 3. Run inference on test set\nresults = task.inference(\n    hypothesis_bank=\".\u002Foutput\u002Fhypotheses.json\",\n    test_data=\".\u002Fdata\u002Fyour_task\u002Fyour_task_test.json\"\n)\nprint(f\"Accuracy: {results['accuracy']:.3f}\")\n```\n\n## Workflow\n\n### Step 1: Prepare Dataset\n\nCreate train\u002Fval\u002Ftest JSON files with text features and labels.\n\n```python\nimport json\n\n# Dataset: each key maps to a list of equal length\ndataset = {\n    \"headline_1\": [\n        \"What Up, Comet? You Just Got *PROBED*\",\n        \"Scientists Made a Breakthrough in Quantum Computing\"\n    ],\n    \"headline_2\": [\n        \"Scientists Were Holding Their Breath Today. Here's Why.\",\n        \"New Quantum Computer Achieves Milestone\"\n    ],\n    \"label\": [\n        \"Headline 2 has more clicks than Headline 1\",\n        \"Headline 1 has more clicks than Headline 2\"\n    ]\n}\n\n# All lists must have equal length; labels must match extract_label output\nfor split in [\"train\", \"val\", \"test\"]:\n    with open(f\"my_task_{split}.json\", \"w\") as f:\n        json.dump(dataset, f, indent=2)\nprint(f\"Created dataset with {len(dataset['label'])} samples\")\n```\n\n### Step 2: Create Task Configuration\n\nWrite a `config.yaml` defining dataset paths and prompt templates.\n\n```python\n# config.yaml structure (write as YAML file)\nconfig = \"\"\"\ntask_name: my_task\n\ntrain_data_path: .\u002Fmy_task_train.json\nval_data_path: .\u002Fmy_task_val.json\ntest_data_path: .\u002Fmy_task_test.json\n\nprompt_templates:\n  observations: |\n    Feature 1: ${text_features_1}\n    Feature 2: ${text_features_2}\n    Observation: ${label}\n\n  batched_generation:\n    system: \"You are a research scientist generating hypotheses.\"\n    user: \"Generate ${num_hypotheses} testable hypotheses from these observations.\"\n\n  inference:\n    system: \"You are evaluating a hypothesis against data.\"\n    user: \"Hypothesis: ${hypothesis}\\\\nSample: ${sample_text}\\\\nFinal answer: ${label}\"\n\n  is_relevant:\n    system: \"Check hypothesis relevance.\"\n    user: \"Is this hypothesis relevant? ${hypothesis}\"\n\"\"\"\n\nwith open(\"config.yaml\", \"w\") as f:\n    f.write(config)\nprint(\"Configuration written to config.yaml\")\n```\n\n### Step 3: Implement Label Extraction\n\nDefine a custom `extract_label` function matching your label format.\n\n```python\nimport re\n\ndef extract_label(llm_output: str) -> str:\n    \"\"\"Parse LLM output to extract predicted label.\n\n    Must return labels matching the 'label' field values in the dataset.\n    Default: searches for 'final answer: \u003Clabel>' pattern.\n    \"\"\"\n    match = re.search(r'final answer:\\s+(.*)', llm_output, re.IGNORECASE)\n    if match:\n        return match.group(1).strip()\n    # Domain-specific fallback\n    if \"Final prediction:\" in llm_output:\n        return llm_output.split(\"Final prediction:\")[-1].strip()\n    return llm_output.strip()\n\n# Test against expected labels\nassert extract_label(\"Final answer: Headline 1\") == \"Headline 1\"\nprint(\"Label extractor validated\")\n```\n\n### Step 4: Generate Hypotheses (HypoGeniC)\n\nRun data-driven hypothesis generation with iterative refinement.\n\n```python\nfrom hypogenic import BaseTask\n\ntask = BaseTask(\n    config_path=\".\u002Fconfig.yaml\",\n    extract_label=extract_label\n)\n\n# Generate hypotheses: initializes from data subset, iteratively refines\ntask.generate_hypotheses(\n    method=\"hypogenic\",       # Data-driven generation\n    num_hypotheses=20,        # Target number of hypotheses\n    output_path=\".\u002Foutput\u002Fhypotheses.json\"\n)\n# CLI equivalent:\n# hypogenic_generation --config config.yaml --method hypogenic --num_hypotheses 20\nprint(\"Hypothesis bank saved to .\u002Foutput\u002Fhypotheses.json\")\n```\n\n### Step 5: Run Inference\n\nTest generated hypotheses against the test set.\n\n```python\nresults = task.inference(\n    hypothesis_bank=\".\u002Foutput\u002Fhypotheses.json\",\n    test_data=\".\u002Fmy_task_test.json\"\n)\nprint(f\"Test accuracy: {results['accuracy']:.3f}\")\nprint(f\"Predictions: {results['predictions'][:5]}\")\n# CLI equivalent:\n# hypogenic_inference --config config.yaml --hypotheses output\u002Fhypotheses.json\n```\n\n### Step 6: Literature-Integrated Generation (HypoRefine)\n\nCombine literature insights with data-driven hypotheses.\n\n```python\n# Requires GROBID setup and preprocessed PDFs\n# bash .\u002Fmodules\u002Fsetup_grobid.sh  # first time\n# bash .\u002Fmodules\u002Frun_grobid.sh    # start GROBID service\n# python pdf_preprocess.py --task_name my_task\n\ntask.generate_hypotheses(\n    method=\"hyporefine\",\n    num_hypotheses=15,\n    literature_path=\".\u002Fliterature\u002Fmy_task\u002F\",\n    output_path=\".\u002Foutput\u002F\"\n)\n# Generates 3 hypothesis banks:\n# - HypoRefine (integrated literature+data)\n# - Literature-only hypotheses\n# - Literature union HypoRefine\nprint(\"HypoRefine generation complete: 3 hypothesis banks created\")\n```\n\n### Step 7: Multi-Hypothesis Inference\n\nTest multiple hypotheses simultaneously for ensemble classification.\n\n```python\nfrom examples.multi_hyp_inference import run_multi_hypothesis_inference\n\nresults = run_multi_hypothesis_inference(\n    config_path=\".\u002Fconfig.yaml\",\n    hypothesis_bank=\".\u002Foutput\u002Fhypotheses.json\",\n    test_data=\".\u002Fmy_task_test.json\"\n)\nprint(f\"Multi-hypothesis accuracy: {results['accuracy']:.3f}\")\n```\n\n## Key Parameters\n\n| Parameter | Default | Range \u002F Options | Effect |\n|-----------|---------|-----------------|--------|\n| `method` | `\"hypogenic\"` | `\"hypogenic\"`, `\"hyporefine\"`, `\"union\"` | Generation strategy |\n| `num_hypotheses` | `20` | `5`-`50` | Number of hypotheses to generate |\n| `batch_size` | `5` | `3`-`10` | Samples per generation batch |\n| `max_iterations` | `10` | `1`-`50` | Refinement iterations |\n| `temperature` | `0.7` | `0.0`-`1.0` | LLM sampling temperature |\n| `confidence_threshold` | `0.7` | `0.5`-`0.95` | Inference confidence cutoff |\n| `num_papers` | `10` | `5`-`30` | Papers for HypoRefine literature extraction |\n| `inference_method` | `\"voting\"` | `\"voting\"`, `\"weighted\"`, `\"ensemble\"` | How multiple hypotheses combine predictions |\n\n## Key Concepts\n\n### Dataset Format\n\nHypoGeniC expects JSON files with parallel lists:\n\n```json\n{\n  \"text_features_1\": [\"sample_1_feat1\", \"sample_2_feat1\"],\n  \"text_features_2\": [\"sample_1_feat2\", \"sample_2_feat2\"],\n  \"label\": [\"class_A\", \"class_B\"]\n}\n```\n\n- All lists must have equal length\n- Feature keys are customizable (`review_text`, `post_content`, etc.)\n- Labels must match the `extract_label()` output format exactly\n- Three splits required: `\u003CTASK>_train.json`, `\u003CTASK>_val.json`, `\u003CTASK>_test.json`\n\n### Three Generation Methods\n\n| Method | Input | Process | Best For |\n|--------|-------|---------|----------|\n| **HypoGeniC** | Data only | Init from subset, iteratively refine on validation | Exploratory research, novel datasets without literature |\n| **HypoRefine** | Data + PDFs | Extract literature insights, merge with data patterns, refine both | Extending or validating existing theories |\n| **Union** | Literature + HypoGeniC | Mechanistic combination, deduplication | Maximum hypothesis diversity and coverage |\n\n### Configuration Template\n\nMinimal required `config.yaml` structure:\n\n```yaml\ntask_name: my_task\ntrain_data_path: .\u002Fmy_task_train.json\nval_data_path: .\u002Fmy_task_val.json\ntest_data_path: .\u002Fmy_task_test.json\n\nmodel:\n  name: \"gpt-4\"                    # or claude-3, gpt-3.5-turbo\n  api_key_env: \"OPENAI_API_KEY\"\n  temperature: 0.7\n\ngeneration:\n  method: \"hypogenic\"\n  num_hypotheses: 20\n  batch_size: 5\n  max_iterations: 10\n\ncache:\n  enabled: true                    # Redis on localhost:6832\n  host: \"localhost\"\n  port: 6832\n\nprompt_templates:\n  observations: |\n    Feature 1: ${text_features_1}\n    Observation: ${label}\n  batched_generation:\n    system: \"Generate testable hypotheses.\"\n    user: \"Generate ${num_hypotheses} hypotheses.\"\n  inference:\n    system: \"Evaluate hypothesis against sample.\"\n    user: \"Hypothesis: ${hypothesis}\\nSample: ${sample_text}\"\n  is_relevant:\n    system: \"Check relevance.\"\n    user: \"Is ${hypothesis} relevant?\"\n```\n\n## Common Recipes\n\n### Recipe: Custom Task from Scratch\n\nWhen to use: creating a new classification task with domain-specific data.\n\n```python\nimport json\nfrom hypogenic import BaseTask\n\n# 1. Prepare data splits\nfor split_name, data in [(\"train\", train_data), (\"val\", val_data), (\"test\", test_data)]:\n    with open(f\"my_task_{split_name}.json\", \"w\") as f:\n        json.dump(data, f)\n\n# 2. Define domain-specific label extractor\ndef my_extractor(text):\n    if \"positive\" in text.lower():\n        return \"positive\"\n    elif \"negative\" in text.lower():\n        return \"negative\"\n    return text.strip()\n\n# 3. Create task and run full pipeline\ntask = BaseTask(config_path=\".\u002Fmy_task\u002Fconfig.yaml\", extract_label=my_extractor)\ntask.generate_hypotheses(method=\"hypogenic\", num_hypotheses=15, output_path=\".\u002Foutput\u002F\")\nresults = task.inference(hypothesis_bank=\".\u002Foutput\u002Fhypotheses.json\")\nprint(f\"Custom task accuracy: {results['accuracy']:.3f}\")\n```\n\n### Recipe: Literature Processing Setup\n\nWhen to use: setting up GROBID for PDF-to-structured-text conversion before HypoRefine.\n\n```bash\n# 1. Setup GROBID (first time only)\nbash .\u002Fmodules\u002Fsetup_grobid.sh\n\n# 2. Place PDFs in literature directory\nmkdir -p literature\u002Fmy_task\u002Fraw\u002F\ncp papers\u002F*.pdf literature\u002Fmy_task\u002Fraw\u002F\n\n# 3. Start GROBID and process\nbash .\u002Fmodules\u002Frun_grobid.sh\ncd examples && python pdf_preprocess.py --task_name my_task\n# Output: structured text files in literature\u002Fmy_task\u002Fprocessed\u002F\n```\n\n### Recipe: Union Method for Maximum Coverage\n\nWhen to use: combining literature and data-driven hypotheses for comprehensive coverage.\n\n```python\n# Generate literature hypotheses first (via HypoRefine)\ntask.generate_hypotheses(\n    method=\"hyporefine\",\n    num_hypotheses=15,\n    literature_path=\".\u002Fliterature\u002Fmy_task\u002F\",\n    output_path=\".\u002Foutput\u002F\"\n)\n\n# Union combines and deduplicates both banks\n# CLI alternative:\n# hypogenic_generation --config config.yaml --method union \\\n#   --literature_hypotheses output\u002Flit_hypotheses.json\n\n# Compare all three approaches\nfor bank in [\"hypogenic\", \"hyporefine\", \"union\"]:\n    r = task.inference(hypothesis_bank=f\".\u002Foutput\u002F{bank}_hypotheses.json\")\n    print(f\"{bank}: accuracy={r['accuracy']:.3f}\")\n```\n\n## Expected Outputs\n\n- `hypotheses.json` -- hypothesis bank with ranked, testable hypotheses (typically 10-20)\n- Inference results with per-sample predictions and overall accuracy\n- For HypoRefine: three hypothesis banks (literature-only, integrated, union)\n- Reported improvements: ~9% over few-shot baselines, ~16% over literature-only approaches\n- 80-84% hypothesis pair diversity (non-redundant insights)\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| `ModuleNotFoundError: hypogenic` | Package not installed | `pip install hypogenic` |\n| Generic\u002Funtestable hypotheses | Prompt templates too vague | Add domain-specific context to `batched_generation` prompt |\n| Poor inference accuracy | Few training examples or bad label extraction | Increase training data; verify `extract_label` matches dataset labels |\n| GROBID PDF processing fails | GROBID service not running | `bash .\u002Fmodules\u002Frun_grobid.sh`; ensure PDFs are valid papers |\n| Label extraction mismatches | `extract_label` output differs from dataset labels | Print both formats and align; test with `assert extract_label(sample) == expected` |\n| Redis connection errors | Redis not running or wrong port | Start Redis on port 6832 or set `cache.enabled: false` |\n| API rate limit errors | Too many concurrent LLM calls | Reduce `batch_size`; enable Redis caching to avoid duplicate calls |\n| Empty hypothesis bank | Config missing required prompt templates | Include all four templates: observations, batched_generation, inference, is_relevant |\n\n## Bundled Resources\n\nThis entry is self-contained. The original `references\u002Fconfig_template.yaml` (151 lines) has been consolidated into the Key Concepts \"Configuration Template\" subsection, retaining the essential YAML structure, model\u002Fcache\u002Fgeneration parameters, and prompt template patterns. Omitted from the template: evaluation metrics block, logging configuration, task-specific feature\u002Flabel metadata descriptions -- these are standard YAML patterns users can add as needed.\n\n## Related Skills\n\n- **hypothesis-generation** -- knowhow for manual hypothesis formulation frameworks and scientific method\n- **scikit-learn-machine-learning** -- classical ML for classification when hypothesis interpretability is not needed\n- **pubmed-database** -- literature search to find papers for HypoRefine input\n\n## References\n\n- Zhou, Y., Liu, H., Srivastava, T., Mei, H., & Tan, C. (2024). \"Hypothesis Generation with Large Language Models.\" EMNLP Workshop NLP for Science. https:\u002F\u002Faclanthology.org\u002F2024.nlp4science-1.10\u002F\n- Liu, H., Zhou, Y., Li, M., Yuan, C., & Tan, C. (2024). \"Literature Meets Data: A Synergistic Approach to Hypothesis Generation.\" arXiv:2410.17309. https:\u002F\u002Farxiv.org\u002Fabs\u002F2410.17309\n- Liu, H., Huang, S., Hu, J., Zhou, Y., & Tan, C. (2025). \"HypoBench: Towards Systematic and Principled Benchmarking for Hypothesis Generation.\" arXiv:2504.11524. https:\u002F\u002Farxiv.org\u002Fabs\u002F2504.11524\n- GitHub Repository: https:\u002F\u002Fgithub.com\u002FChicagoHAI\u002Fhypothesis-generation\n- PyPI Package: https:\u002F\u002Fpypi.org\u002Fproject\u002Fhypogenic\u002F\n","# HypoGeniC Hypothesis Generation\n\n## Overview\n\nHypoGeniC automates scientific hypothesis generation and testing using LLMs on tabular datasets. Given labeled data (e.g., deception detection, AI-content identification), it generates testable hypotheses, iteratively refines them against validation performance, and runs inference to classify new samples. It supports three approaches: purely data-driven (HypoGeniC), literature-integrated (HypoRefine), and mechanistic union of both.\n\n## When to Use\n\n- Generating testable hypotheses from labeled observational datasets without prior theory\n- Systematically testing multiple competing hypotheses on empirical data\n- Combining insights from research papers with data-driven pattern discovery\n- Accelerating hypothesis ideation in domains like deception detection, content analysis, mental health indicators\n- Benchmarking LLM-based hypothesis generation methods against few-shot baselines\n- For manual hypothesis formulation frameworks, use **hypothesis-generation** knowhow\n- For general-purpose ML classification without hypothesis interpretability, use **scikit-learn-machine-learning**\n\n## Prerequisites\n\n- **Python packages**: `hypogenic`\n- **Optional**: Redis server (port 6832) for LLM response caching; GROBID for PDF literature processing\n- **API keys**: OpenAI, Anthropic, or compatible LLM API key in environment\n- **Data**: Labeled JSON datasets in HypoGeniC format (see Key Concepts)\n\n```bash\npip install hypogenic\n\n# Optional: clone example datasets\ngit clone https:\u002F\u002Fgithub.com\u002FChicagoHAI\u002FHypoGeniC-datasets.git .\u002Fdata\ngit clone https:\u002F\u002Fgithub.com\u002FChicagoHAI\u002FHypothesis-agent-datasets.git .\u002Fdata_lit\n```\n\n## Quick Start\n\n```python\nfrom hypogenic import BaseTask\nimport re\n\n# Custom label extractor (must match dataset label format)\ndef extract_label(text: str) -> str:\n    match = re.search(r'final answer:\\s+(.*)', text, re.IGNORECASE)\n    return match.group(1).strip() if match else text.strip()\n\n# 1. Load task from config\ntask = BaseTask(\n    config_path=\".\u002Fdata\u002Fyour_task\u002Fconfig.yaml\",\n    extract_label=extract_label\n)\n\n# 2. Generate hypotheses (data-driven)\ntask.generate_hypotheses(\n    method=\"hypogenic\",\n    num_hypotheses=20,\n    output_path=\".\u002Foutput\u002Fhypotheses.json\"\n)\n\n# 3. Run inference on test set\nresults = task.inference(\n    hypothesis_bank=\".\u002Foutput\u002Fhypotheses.json\",\n    test_data=\".\u002Fdata\u002Fyour_task\u002Fyour_task_test.json\"\n)\nprint(f\"Accuracy: {results['accuracy']:.3f}\")\n```\n\n## Workflow\n\n### Step 1: Prepare Dataset\n\nCreate train\u002Fval\u002Ftest JSON files with text features and labels.\n\n```python\nimport json\n\n# Dataset: each key maps to a list of equal length\ndataset = {\n    \"headline_1\": [\n        \"What Up, Comet? You Just Got *PROBED*\",\n        \"Scientists Made a Breakthrough in Quantum Computing\"\n    ],\n    \"headline_2\": [\n        \"Scientists Were Holding Their Breath Today. Here's Why.\",\n        \"New Quantum Computer Achieves Milestone\"\n    ],\n    \"label\": [\n        \"Headline 2 has more clicks than Headline 1\",\n        \"Headline 1 has more clicks than Headline 2\"\n    ]\n}\n\n# All lists must have equal length; labels must match extract_label output\nfor split in [\"train\", \"val\", \"test\"]:\n    with open(f\"my_task_{split}.json\", \"w\") as f:\n        json.dump(dataset, f, indent=2)\nprint(f\"Created dataset with {len(dataset['label'])} samples\")\n```\n\n### Step 2: Create Task Configuration\n\nWrite a `config.yaml` defining dataset paths and prompt templates.\n\n```python\n# config.yaml structure (write as YAML file)\nconfig = \"\"\"\ntask_name: my_task\n\ntrain_data_path: .\u002Fmy_task_train.json\nval_data_path: .\u002Fmy_task_val.json\ntest_data_path: .\u002Fmy_task_test.json\n\nprompt_templates:\n  observations: |\n    Feature 1: ${text_features_1}\n    Feature 2: ${text_features_2}\n    Observation: ${label}\n\n  batched_generation:\n    system: \"You are a research scientist generating hypotheses.\"\n    user: \"Generate ${num_hypotheses} testable hypotheses from these observations.\"\n\n  inference:\n    system: \"You are evaluating a hypothesis against data.\"\n    user: \"Hypothesis: ${hypothesis}\\\\nSample: ${sample_text}\\\\nFinal answer: ${label}\"\n\n  is_relevant:\n    system: \"Check hypothesis relevance.\"\n    user: \"Is this hypothesis relevant? ${hypothesis}\"\n\"\"\"\n\nwith open(\"config.yaml\", \"w\") as f:\n    f.write(config)\nprint(\"Configuration written to config.yaml\")\n```\n\n### Step 3: Implement Label Extraction\n\nDefine a custom `extract_label` function matching your label format.\n\n```python\nimport re\n\ndef extract_label(llm_output: str) -> str:\n    \"\"\"Parse LLM output to extract predicted label.\n\n    Must return labels matching the 'label' field values in the dataset.\n    Default: searches for 'final answer: \u003Clabel>' pattern.\n    \"\"\"\n    match = re.search(r'final answer:\\s+(.*)', llm_output, re.IGNORECASE)\n    if match:\n        return match.group(1).strip()\n    # Domain-specific fallback\n    if \"Final prediction:\" in llm_output:\n        return llm_output.split(\"Final prediction:\")[-1].strip()\n    return llm_output.strip()\n\n# Test against expected labels\nassert extract_label(\"Final answer: Headline 1\") == \"Headline 1\"\nprint(\"Label extractor validated\")\n```\n\n### Step 4: Generate Hypotheses (HypoGeniC)\n\nRun data-driven hypothesis generation with iterative refinement.\n\n```python\nfrom hypogenic import BaseTask\n\ntask = BaseTask(\n    config_path=\".\u002Fconfig.yaml\",\n    extract_label=extract_label\n)\n\n# Generate hypotheses: initializes from data subset, iteratively refines\ntask.generate_hypotheses(\n    method=\"hypogenic\",       # Data-driven generation\n    num_hypotheses=20,        # Target number of hypotheses\n    output_path=\".\u002Foutput\u002Fhypotheses.json\"\n)\n# CLI equivalent:\n# hypogenic_generation --config config.yaml --method hypogenic --num_hypotheses 20\nprint(\"Hypothesis bank saved to .\u002Foutput\u002Fhypotheses.json\")\n```\n\n### Step 5: Run Inference\n\nTest generated hypotheses against the test set.\n\n```python\nresults = task.inference(\n    hypothesis_bank=\".\u002Foutput\u002Fhypotheses.json\",\n    test_data=\".\u002Fmy_task_test.json\"\n)\nprint(f\"Test accuracy: {results['accuracy']:.3f}\")\nprint(f\"Predictions: {results['predictions'][:5]}\")\n# CLI equivalent:\n# hypogenic_inference --config config.yaml --hypotheses output\u002Fhypotheses.json\n```\n\n### Step 6: Literature-Integrated Generation (HypoRefine)\n\nCombine literature insights with data-driven hypotheses.\n\n```python\n# Requires GROBID setup and preprocessed PDFs\n# bash .\u002Fmodules\u002Fsetup_grobid.sh  # first time\n# bash .\u002Fmodules\u002Frun_grobid.sh    # start GROBID service\n# python pdf_preprocess.py --task_name my_task\n\ntask.generate_hypotheses(\n    method=\"hyporefine\",\n    num_hypotheses=15,\n    literature_path=\".\u002Fliterature\u002Fmy_task\u002F\",\n    output_path=\".\u002Foutput\u002F\"\n)\n# Generates 3 hypothesis banks:\n# - HypoRefine (integrated literature+data)\n# - Literature-only hypotheses\n# - Literature union HypoRefine\nprint(\"HypoRefine generation complete: 3 hypothesis banks created\")\n```\n\n### Step 7: Multi-Hypothesis Inference\n\nTest multiple hypotheses simultaneously for ensemble classification.\n\n```python\nfrom examples.multi_hyp_inference import run_multi_hypothesis_inference\n\nresults = run_multi_hypothesis_inference(\n    config_path=\".\u002Fconfig.yaml\",\n    hypothesis_bank=\".\u002Foutput\u002Fhypotheses.json\",\n    test_data=\".\u002Fmy_task_test.json\"\n)\nprint(f\"Multi-hypothesis accuracy: {results['accuracy']:.3f}\")\n```\n\n## Key Parameters\n\n| Parameter | Default | Range \u002F Options | Effect |\n|-----------|---------|-----------------|--------|\n| `method` | `\"hypogenic\"` | `\"hypogenic\"`, `\"hyporefine\"`, `\"union\"` | Generation strategy |\n| `num_hypotheses` | `20` | `5`-`50` | Number of hypotheses to generate |\n| `batch_size` | `5` | `3`-`10` | Samples per generation batch |\n| `max_iterations` | `10` | `1`-`50` | Refinement iterations |\n| `temperature` | `0.7` | `0.0`-`1.0` | LLM sampling temperature |\n| `confidence_threshold` | `0.7` | `0.5`-`0.95` | Inference confidence cutoff |\n| `num_papers` | `10` | `5`-`30` | Papers for HypoRefine literature extraction |\n| `inference_method` | `\"voting\"` | `\"voting\"`, `\"weighted\"`, `\"ensemble\"` | How multiple hypotheses combine predictions |\n\n## Key Concepts\n\n### Dataset Format\n\nHypoGeniC expects JSON files with parallel lists:\n\n```json\n{\n  \"text_features_1\": [\"sample_1_feat1\", \"sample_2_feat1\"],\n  \"text_features_2\": [\"sample_1_feat2\", \"sample_2_feat2\"],\n  \"label\": [\"class_A\", \"class_B\"]\n}\n```\n\n- All lists must have equal length\n- Feature keys are customizable (`review_text`, `post_content`, etc.)\n- Labels must match the `extract_label()` output format exactly\n- Three splits required: `\u003CTASK>_train.json`, `\u003CTASK>_val.json`, `\u003CTASK>_test.json`\n\n### Three Generation Methods\n\n| Method | Input | Process | Best For |\n|--------|-------|---------|----------|\n| **HypoGeniC** | Data only | Init from subset, iteratively refine on validation | Exploratory research, novel datasets without literature |\n| **HypoRefine** | Data + PDFs | Extract literature insights, merge with data patterns, refine both | Extending or validating existing theories |\n| **Union** | Literature + HypoGeniC | Mechanistic combination, deduplication | Maximum hypothesis diversity and coverage |\n\n### Configuration Template\n\nMinimal required `config.yaml` structure:\n\n```yaml\ntask_name: my_task\ntrain_data_path: .\u002Fmy_task_train.json\nval_data_path: .\u002Fmy_task_val.json\ntest_data_path: .\u002Fmy_task_test.json\n\nmodel:\n  name: \"gpt-4\"                    # or claude-3, gpt-3.5-turbo\n  api_key_env: \"OPENAI_API_KEY\"\n  temperature: 0.7\n\ngeneration:\n  method: \"hypogenic\"\n  num_hypotheses: 20\n  batch_size: 5\n  max_iterations: 10\n\ncache:\n  enabled: true                    # Redis on localhost:6832\n  host: \"localhost\"\n  port: 6832\n\nprompt_templates:\n  observations: |\n    Feature 1: ${text_features_1}\n    Observation: ${label}\n  batched_generation:\n    system: \"Generate testable hypotheses.\"\n    user: \"Generate ${num_hypotheses} hypotheses.\"\n  inference:\n    system: \"Evaluate hypothesis against sample.\"\n    user: \"Hypothesis: ${hypothesis}\\nSample: ${sample_text}\"\n  is_relevant:\n    system: \"Check relevance.\"\n    user: \"Is ${hypothesis} relevant?\"\n```\n\n## Common Recipes\n\n### Recipe: Custom Task from Scratch\n\nWhen to use: creating a new classification task with domain-specific data.\n\n```python\nimport json\nfrom hypogenic import BaseTask\n\n# 1. Prepare data splits\nfor split_name, data in [(\"train\", train_data), (\"val\", val_data), (\"test\", test_data)]:\n    with open(f\"my_task_{split_name}.json\", \"w\") as f:\n        json.dump(data, f)\n\n# 2. Define domain-specific label extractor\ndef my_extractor(text):\n    if \"positive\" in text.lower():\n        return \"positive\"\n    elif \"negative\" in text.lower():\n        return \"negative\"\n    return text.strip()\n\n# 3. Create task and run full pipeline\ntask = BaseTask(config_path=\".\u002Fmy_task\u002Fconfig.yaml\", extract_label=my_extractor)\ntask.generate_hypotheses(method=\"hypogenic\", num_hypotheses=15, output_path=\".\u002Foutput\u002F\")\nresults = task.inference(hypothesis_bank=\".\u002Foutput\u002Fhypotheses.json\")\nprint(f\"Custom task accuracy: {results['accuracy']:.3f}\")\n```\n\n### Recipe: Literature Processing Setup\n\nWhen to use: setting up GROBID for PDF-to-structured-text conversion before HypoRefine.\n\n```bash\n# 1. Setup GROBID (first time only)\nbash .\u002Fmodules\u002Fsetup_grobid.sh\n\n# 2. Place PDFs in literature directory\nmkdir -p literature\u002Fmy_task\u002Fraw\u002F\ncp papers\u002F*.pdf literature\u002Fmy_task\u002Fraw\u002F\n\n# 3. Start GROBID and process\nbash .\u002Fmodules\u002Frun_grobid.sh\ncd examples && python pdf_preprocess.py --task_name my_task\n# Output: structured text files in literature\u002Fmy_task\u002Fprocessed\u002F\n```\n\n### Recipe: Union Method for Maximum Coverage\n\nWhen to use: combining literature and data-driven hypotheses for comprehensive coverage.\n\n```python\n# Generate literature hypotheses first (via HypoRefine)\ntask.generate_hypotheses(\n    method=\"hyporefine\",\n    num_hypotheses=15,\n    literature_path=\".\u002Fliterature\u002Fmy_task\u002F\",\n    output_path=\".\u002Foutput\u002F\"\n)\n\n# Union combines and deduplicates both banks\n# CLI alternative:\n# hypogenic_generation --config config.yaml --method union \\\n#   --literature_hypotheses output\u002Flit_hypotheses.json\n\n# Compare all three approaches\nfor bank in [\"hypogenic\", \"hyporefine\", \"union\"]:\n    r = task.inference(hypothesis_bank=f\".\u002Foutput\u002F{bank}_hypotheses.json\")\n    print(f\"{bank}: accuracy={r['accuracy']:.3f}\")\n```\n\n## Expected Outputs\n\n- `hypotheses.json` -- hypothesis bank with ranked, testable hypotheses (typically 10-20)\n- Inference results with per-sample predictions and overall accuracy\n- For HypoRefine: three hypothesis banks (literature-only, integrated, union)\n- Reported improvements: ~9% over few-shot baselines, ~16% over literature-only approaches\n- 80-84% hypothesis pair diversity (non-redundant insights)\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| `ModuleNotFoundError: hypogenic` | Package not installed | `pip install hypogenic` |\n| Generic\u002Funtestable hypotheses | Prompt templates too vague | Add domain-specific context to `batched_generation` prompt |\n| Poor inference accuracy | Few training examples or bad label extraction | Increase training data; verify `extract_label` matches dataset labels |\n| GROBID PDF processing fails | GROBID service not running | `bash .\u002Fmodules\u002Frun_grobid.sh`; ensure PDFs are valid papers |\n| Label extraction mismatches | `extract_label` output differs from dataset labels | Print both formats and align; test with `assert extract_label(sample) == expected` |\n| Redis connection errors | Redis not running or wrong port | Start Redis on port 6832 or set `cache.enabled: false` |\n| API rate limit errors | Too many concurrent LLM calls | Reduce `batch_size`; enable Redis caching to avoid duplicate calls |\n| Empty hypothesis bank | Config missing required prompt templates | Include all four templates: observations, batched_generation, inference, is_relevant |\n\n## Bundled Resources\n\nThis entry is self-contained. The original `references\u002Fconfig_template.yaml` (151 lines) has been consolidated into the Key Concepts \"Configuration Template\" subsection, retaining the essential YAML structure, model\u002Fcache\u002Fgeneration parameters, and prompt template patterns. Omitted from the template: evaluation metrics block, logging configuration, task-specific feature\u002Flabel metadata descriptions -- these are standard YAML patterns users can add as needed.\n\n## Related Skills\n\n- **hypothesis-generation** -- knowhow for manual hypothesis formulation frameworks and scientific method\n- **scikit-learn-machine-learning** -- classical ML for classification when hypothesis interpretability is not needed\n- **pubmed-database** -- literature search to find papers for HypoRefine input\n\n## References\n\n- Zhou, Y., Liu, H., Srivastava, T., Mei, H., & Tan, C. (2024). \"Hypothesis Generation with Large Language Models.\" EMNLP Workshop NLP for Science. https:\u002F\u002Faclanthology.org\u002F2024.nlp4science-1.10\u002F\n- Liu, H., Zhou, Y., Li, M., Yuan, C., & Tan, C. (2024). \"Literature Meets Data: A Synergistic Approach to Hypothesis Generation.\" arXiv:2410.17309. https:\u002F\u002Farxiv.org\u002Fabs\u002F2410.17309\n- Liu, H., Huang, S., Hu, J., Zhou, Y., & Tan, C. (2025). \"HypoBench: Towards Systematic and Principled Benchmarking for Hypothesis Generation.\" arXiv:2504.11524. https:\u002F\u002Farxiv.org\u002Fabs\u002F2504.11524\n- GitHub Repository: https:\u002F\u002Fgithub.com\u002FChicagoHAI\u002Fhypothesis-generation\n- PyPI Package: https:\u002F\u002Fpypi.org\u002Fproject\u002Fhypogenic\u002F\n",{"name":5,"license":15,"description":7},"master","63f17866001c5ca854bf2fa0b678ce277133de5b","skills\u002Fawesome-skills\u002Fhypogenic-hypothesis-generation",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill hypogenic-hypothesis-generation",{"tool":40,"command":41},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill hypogenic-hypothesis-generation",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill hypogenic-hypothesis-generation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fhypogenic-hypothesis-generation\u002FSKILL.md",true,[],[49,57,64,71,78,85],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":56},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":56},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":56},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":56},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":56},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":56},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]