How rsinghlab/k-paths works
Project type and purpose
• This is a research‐oriented ML/AI pipeline for knowledge‐graph–based drug repurposing and interaction prediction.
• It combines:
• A text-based LLM inference branch
• A graph-neural-network (GNN) training & evaluation branch
• Purpose: produce explainable, biologically meaningful reasoning paths from a KG, then use those for zero-shot LLM inference and for GNN prediction.
File structure
• Top-level scripts and dirs:
• llm/: zero-shot inference & evaluation of paths with large language models
• requirements.txt, README.md
• k-paths substructure:
• create_augmented_network.py
• get-Kpaths.py → extracts path lists
• utils/ → shared helper modules (path filtering, network utils)
• llm substructure:
• llm_inference.py / v2 → drives LLM calls (Hugging Face, Meta-Llama, etc.)
• evaluate_llm_regex.py / evaluate_llm_bertscore.py
• gnn substructure:
• train.py → RGCN training pipeline
• eval.py → model evaluation
• data_utils.py, train_eval_utils.py → input formatting, metrics, logging
Extract architectural insights from README
• Four sequential steps:
1. Download and unpack dataset
2. Create augmented KG
3. Extract K-reasoning paths
• Two parallel “consumers” of the paths:
• Branch A: natural‐language conversion → LLM inference → automatic evaluation (regex, BERTScore)
• External dependencies / services:
• Hugging Face dataset (pre-extracted paths)
• Large language models (Meta-Llama or Tx-Gemma via the Hugging Face Hub)
• Standard Python ML libs (PyTorch, DGL, scikit-learn, etc.)