Scrape, graph, answer: a zero-to-one medical knowledge base
An educational walkthrough that scrapes Chinese medical websites to build a Neo4j knowledge graph and a rule-based QA system on top of it.

What it does
This is a tutorial project that constructs a disease-centered medical knowledge graph from scraped Chinese vertical health websites, stores it in Neo4j, and layers a rule-based question-answering system on top. It covers roughly 44,000 entities across seven types—Disease, Symptom, Drug, Food, Check, Producer, and Department—and about 294,000 relationships. The QA module classifies user questions into 18 intent categories, parses them, and queries the graph to return structured answers about symptoms, causes, treatments, and dietary advice.
The interesting bit
The value is in the plumbing, not the polish. The author exposes the full pipeline—web scraping, dictionary-based segmentation, graph ingestion, and hand-crafted question parsing—making it a practical reference for anyone learning how to bootstrap a vertical-domain knowledge graph without pre-trained LLMs. It is essentially glue code connecting scrapers to Neo4j with a template-matching chatbot front end, which is exactly what makes it useful as a teaching tool.
Key highlights
- ~44,111 medical entities and ~294,149 relations extracted from Chinese health websites
- 18 supported question types, from symptom-to-disease lookup to drug-disease compatibility
- Full pipeline exposed:
prepare_data/datasoider.py,max_cut.py,build_medicalgraph.py, and QAquestion_classifier.py/question_parser.py Neo4j-backed graph with explicit schema for entities, relations, and disease attributes- Primarily a Chinese-language system with demonstrated QA examples in Chinese
Caveats
- The README contains duplicated script descriptions and truncated example output, suggesting the documentation is not meticulously maintained
- It relies on rule-based question classification and parsing rather than modern semantic retrieval or LLMs, so robustness to natural language variation is likely limited
- Data import is described as slow (hours), and the project is framed as an educational build rather than a production system
Verdict Worth a look if you are learning knowledge-graph construction or need a starter template for a Chinese-language medical QA demo. Skip it if you want a production-ready diagnostic tool or a modern RAG pipeline.
Frequently asked
- What is liuhuanyong/QASystemOnMedicalKG?
- An educational walkthrough that scrapes Chinese medical websites to build a Neo4j knowledge graph and a rule-based QA system on top of it.
- Is QASystemOnMedicalKG open source?
- Yes — liuhuanyong/QASystemOnMedicalKG is an open-source project tracked on heatdrop.
- What language is QASystemOnMedicalKG written in?
- liuhuanyong/QASystemOnMedicalKG is primarily written in Python.
- How popular is QASystemOnMedicalKG?
- liuhuanyong/QASystemOnMedicalKG has 7.3k stars on GitHub.
- Where can I find QASystemOnMedicalKG?
- liuhuanyong/QASystemOnMedicalKG is on GitHub at https://github.com/liuhuanyong/QASystemOnMedicalKG.