← all repositories
YeYzheng/KGQA-Based-On-medicine

A medical chatbot that speaks SPARQL so you don't have to

This Chinese-language project turns plain questions about drugs and diseases into graph queries, though you'll need to wrangle Java, Python, and a Baidu download first.

1.3k stars JavaScript RAG · SearchAgents
KGQA-Based-On-medicine
Velocity · 7d
+0.4
★ / day
Trend
steady
star history

What it does

You type a question like “What are the symptoms of diabetes?” in Chinese. The system parses it with jieba and REfO, generates a SPARQL query, and fetches the answer from an Apache Jena Fuseki backend loaded with a TDB medical knowledge base. A Django web UI and a command-line mode are both provided.

The interesting bit

The project is essentially a working tutorial in the forgotten art of rule-based semantic parsing: REfO (regular expressions for objects) turns natural language into structured queries without touching a neural network. In an era of LLM-powered everything, this is deliberately retro—more 2015 than 2025.

Key highlights

  • Parses Chinese medical questions into SPARQL via REfO pattern matching
  • Covers disease symptoms, drug indications, and medication lookups
  • Ships with a pre-built TDB knowledge base (download from Baidu Pan)
  • Dual interface: Django web app or plain CLI via query_main.py
  • Includes ontology and inference rule files for Jena configuration

Caveats

  • Single-turn only; no follow-up questions or context memory
  • Knowledge base is static and closed—if the data isn’t in TDB, you get silence
  • Setup involves manual file shuffling between directories, path tweaks in setting.py, and a Java runtime for Fuseki
  • UI is self-described as “crude” (简陋)
  • Python 3.5.2 era; dependencies may need pinning to run today

Verdict

Worth a look if you’re teaching or learning classical KBQA pipelines, or need a deterministic, explainable baseline for medical Q&A. Skip it if you want modern conversational AI, multi-hop reasoning, or something that runs in one docker compose up.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.