ChatMed  by michael-wzhu

Chinese medical LLM for answering health-related questions

created 2 years ago
590 stars

Top 56.0% on sourcepulse

GitHubView on GitHub
Project Summary

ChatMed is a series of Chinese medical large language models designed to answer user's daily medical questions. It aims to advance LLM capabilities in the Chinese healthcare domain, offering more human-like and informative responses than base models. The project targets users seeking medical information and provides open-source datasets, code, and model weights for research.

How It Works

ChatMed-Consult, a flagship model, is fine-tuned from LLaMA-7b using a dataset of over 500,000 online medical consultations and ChatGPT responses. It incorporates LoRA weights from Chinese-LlaMA-Alpaca and an extended Chinese vocabulary. ShenNong-TCM-LLM focuses on Traditional Chinese Medicine (TCM), trained on a TCM instruction dataset generated using an entity-centric self-instruct method with ChatGPT, leveraging an open-source TCM knowledge graph.

Quick Start & Requirements

  • Install/Run: Requires a LLaMA-7b base model. Download ChatMed-Consult LoRA weights. Run python src/web_services/web_service_simple.py to start a Flask web service, then python src/web_services/web_service_test.py for testing.
  • Prerequisites: LLaMA-7b base model, 3090 GPU or stronger.
  • Resources: Training utilizes DeepSpeed (ZeRO stage 3) for distributed training, with example scripts using 4 GPUs.
  • Links: ChatMed-Consult Training Code, ChatMed-Consult Model Weights, LLaMA-7b Model Preparation.

Highlighted Details

  • ChatMed-Consult demonstrates improved understanding of noisy user inputs and provides more empathetic and detailed responses compared to base LLaMA-7b.
  • It offers more actionable suggestions and avoids making definitive medical conclusions, adopting a more cautious tone.
  • The project also includes ShenNong-TCM-LLM, specializing in Traditional Chinese Medicine.
  • Open-sourced datasets: ChatMed_Consult_Dataset and ChatMed_TCM_Dataset, along with a TCM knowledge graph.

Maintenance & Community

The project is actively iterating, with regular model weight updates planned. Community engagement channels are not explicitly mentioned in the README.

Licensing & Compatibility

  • License: The project states "严禁用于商业用途" (strictly prohibited for commercial use), indicating a non-commercial research license.
  • Compatibility: Not suitable for commercial applications due to usage restrictions.

Limitations & Caveats

The models are intended for academic research only and cannot replace professional medical diagnosis or advice. The medical knowledge is limited by the quality and quantity of the training data, and the models are subject to ongoing improvements and updates.

Health Check
Last commit

2 years ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
1
Star History
24 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.