{"repo":"Haohao-end/GPT-2-Based-Medical-Dialogue-System","free":true,"listed":false,"github":"https://github.com/Haohao-end/GPT-2-Based-Medical-Dialogue-System","clone":"git clone https://github.com/Haohao-end/GPT-2-Based-Medical-Dialogue-System.git","description":"A medical question-answering system built on the GPT-2 language model, fine-tuned on a large corpus of doctor-patient dialogues. The system supports multi-turn conversations and provides both command-line and web-based interfaces for interaction.","language":"Python","stars":207,"topics":["python","gpt2","transformer","pytorch","flask"],"license":null,"category":"machine-learning","readme_excerpt":"GPT-2 Based Medical Dialogue System A medical question-answering system built on the GPT-2 language model, fine-tuned on a large corpus of doctor-patient dialogues. The system supports multi-turn conversations and provides both command-line and web-based interfaces for interaction. English 中文 Features - Specialized in medical domain, trained on over 30,000 real doctor-patient conversations - Fine-tuned from pre-trained GPT-2 for coherent and context-aware response generation - Supports multi-turn dialogue with configurable history length - Provides two deployment options: interactive command-line tool and Flask-based web service - Complete training, preprocessing, and inference pipeline Quick Start Environment Requirements - Python ≥ 3.6 - PyTorch ≥ 1.7.0 - Transformers ≥ 4.2.0 Install dependencies: Data Preparation Place the training and validation text files in the data directory: Preprocess the data (if not already done): Training Training parameters such as batch size, learning rate, and number of epochs can be adjusted in parameter config.py . Inference 1. Command-line interaction: 2. Web interface: Then visit http://localhost:5000 in your browser. Project Structure Model Architecture The system uses GPT2LMHeadModel with a custom tokenizer (BertTokenizerFast) configured with [CLS] and [SEP] tokens to handle dialogue turns. Input sequences are formatted as: [CLS] utterance1 [SEP] utterance2 [SEP] ... Generation employs top-k sampling with repetition penalty to produce flu","default_branch":null,"files":null,"tree":[],"storefront":"/r/Haohao-end","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Haohao-end/GPT-2-Based-Medical-Dialogue-System/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}