初始化项目,由ModelHub XC社区提供模型
Model: EIRTHAIMED/Llama-3.1-EIRAI-8B Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
352
README.md
Normal file
352
README.md
Normal file
@@ -0,0 +1,352 @@
|
||||
---
|
||||
language:
|
||||
- th
|
||||
- en
|
||||
base_model: meta-llama/Meta-Llama-3.1-8B
|
||||
tags:
|
||||
- medical
|
||||
- text-generation-inference
|
||||
- llama-3.1
|
||||
- finetuning
|
||||
license: llama3.1
|
||||
library_name: transformers
|
||||
---
|
||||
<p align="center">
|
||||
<img src="https://cdn-uploads.huggingface.co/production/uploads/66bf1cd096583c59b024a3c5/oG16EyLMfyiqvXrbNPGZd.png" alt="Logo_Website" width="400"/>
|
||||
</p>
|
||||
|
||||
# **Thai Medical Large Language Model**
|
||||
**Github** : [Github Evaluate](https://github.com/EIRAI-Thaimedical/EIRAI)<br>
|
||||
**PaPer** : <br>
|
||||
|
||||
## **Llama-3.1-EIRAI-8B-instruct**
|
||||
|
||||
**Llama-3.1-EIRAI-8B-instruct**: developed an **8-billion parameter model** specifically tailored for **Thai medical applications**, with expertise in both **Thai medical language** and **English medical terminology**. The model has demonstrated its capabilities through key benchmarks such as **MMLU**, **MedQA**, **PubMedQA**, and **MedMCQA**, as well as Thai language assessments like **ThaiExam**, **M3Exam**, **XNLI**, and **XCOPA**. Additionally, we have created a **Clinically Adapted Model Enhanced test** using the **Thai language** to support **clinical use in hospitals** and to further improve the performance of **Thai medical Retrieval-Augmented Generation (RAG)**.
|
||||
|
||||
## Notice
|
||||
While **Eir AI Thai Medical LLM** is designed to encode high-quality medical knowledge, it is **not yet optimized for safe, practical use** in real-world medical settings. The model is still in the research phase and should **not be used for clinical decision-making** without further validation, including randomized controlled trials. It is available for researchers to explore the potential of LLMs in medical contexts, but **real-world deployment is not recommended** in its current version.
|
||||
|
||||
## Safety and Future Work
|
||||
The current version of **Eir AI Thai Medical LLM** is under active development. We advise against using it for medical applications until further testing is completed. Our goal is to continue enhancing the model through **rigorous testing** and **real-world evaluation**, ensuring that it can be safely integrated into healthcare systems in the future.
|
||||
|
||||
## Model Overview
|
||||
- **Model Architecture:** Meta-Llama-3.1-8B-Instruct
|
||||
- **Version:** 1.0
|
||||
- **License(s):** [llama3.1](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B/blob/main/LICENSE)
|
||||
|
||||
|
||||
### Evaluations
|
||||
|
||||
| Medical Model | Clinical KG | Medical Genetics | Anatomy | Pro Medicine | College Biology | College Medicine | MedQA | PubMedQA | MedMCQA | Avg. |
|
||||
|--------------------------|---------------------|---------------------|--------------------|--------------------|--------------------|--------------------|-------------------|-------------------|-------------------|-------------------|
|
||||
| **GPT-3.5 Turbo 1106** | 74.7 | 60.2 | 65.9 | 72.0 | 64.73 | 64.73 | 57.71 | 72.66 | 66.0 | 66.6 |
|
||||
|Thai LLMs | | | | | | | | | | |
|
||||
| **Eir AI-8B** | 75.1 | 80.0 | 69.6 | 76.8 | 77.1 | 66.5 | 64.5 | **79.0** | 58.6 | 71.9 |
|
||||
| **Eir AI-8B + Prob** | **83.8** | **89.0** | **83.0** | **84.9** | **89.6** | **75.7** | **69.6** | 78.8 | **67.1** | **80.2** |
|
||||
| **Typhoon-v1.5x-8B** | 75.9 | 79.0 | 63.7 | 70.6 | 77.1 | 63.6 | 59.7 | 74.4 | 58.0 | 69.1 |
|
||||
| **OpenThaiGPT-beta-7B** | 37.4 | 38.0 | 4.5 | 32.7 | 36.1 | 32.4 | 32.4 | 62.0 | 31.8 | 34.1 |
|
||||
|
||||
## Translation Performance Metrics
|
||||
|
||||
| **Model** | **BLEU Score** | **N-gram Precisions (%)** | **BP** | **Ratio** |
|
||||
|-------------------------------|----------------|---------------------------------|---------|-----------|
|
||||
| Typhoon-v1.5x-8B-Instruct | 34.42 | 71.3/50.6/38.6/29.6 | 0.764 | 0.788 |
|
||||
| Meta Llama 3.1-8B Instruct | 35.74 | 62.8/42.3/31.7/24.1 | 0.946 | 0.948 |
|
||||
| **Eir AI-8B** | **61.10** | **76.1/64.6/56.6/50.1** | **1.000**| **1.006** |
|
||||
| Eir AI-8B-prob | 47.91 | 74.0/58.0/48.2/40.6 | 0.890 | 0.896 |
|
||||
|
||||
## Clinically Adapted Thai Medical Task Performance
|
||||
|
||||
| Task | GPT-3.5 | Typhoon-v1.5x-8B-instruct | GPT-4o | Eir AI-8B |
|
||||
|----------------------------------------|---------|----------------------------|--------|-----------|
|
||||
| Named Entity Recognition | 3.26 | 5.55 | 6.34 | **7.08** |
|
||||
| Temporal Information Extraction | 3.83 | 5.46 | 6.15 | **7.05** |
|
||||
| Paraphrasing | 2.36 | 4.68 | 6.35 | **7.06** |
|
||||
| Natural Language Generation | 2.63 | 4.87 | 6.91 | **7.66** |
|
||||
| Keyword Extraction | 2.60 | 5.15 | 7.01 | **7.35** |
|
||||
| Text Classification | 2.92 | 6.21 | 5.36 | **6.75** |
|
||||
| Relation Extraction | 3.29 | 5.94 | 4.37 | **6.92** |
|
||||
| Question Answering | 3.70 | 4.92 | 6.11 | **6.82** |
|
||||
| Text Summarization | 2.98 | 5.44 | **7.51**| **7.51** |
|
||||
| Abbreviation Expansion | 3.99 | 5.96 | 6.24 | **7.82** |
|
||||
| Clinical Concept Normalization | 2.67 | 5.63 | 5.82 | **6.55** |
|
||||
| Open-ended Question | 3.32 | 5.55 | 6.77 | **7.27** |
|
||||
| Multiple-Choice Question | 3.90 | 5.00 | 5.40 | **6.40** |
|
||||
| Coreference Resolution | 3.48 | 4.55 | 4.88 | **6.43** |
|
||||
| Yes/No Question | 2.71 | 5.86 | 4.86 | **7.38** |
|
||||
| Medical Translation | 3.00 | 4.00 | **7.79**| 7.65 |
|
||||
| Medical Thai Extraction | 2.81 | 7.16 | **8.62**| 8.16 |
|
||||
| Medical ICD Prediction | 2.08 | 3.16 | **8.12**| 6.41 |
|
||||
| **Average Score** | 3.05 | 5.33 | 6.38 | **7.11** |
|
||||
|
||||
|
||||
# Prompt Template
|
||||
|
||||
This model uses `ChatML` prompt template:
|
||||
|
||||
```
|
||||
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
||||
|
||||
{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>
|
||||
|
||||
{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
||||
|
||||
````
|
||||
|
||||
# Example Clinical Adapted ICD 10 Prediction
|
||||
````
|
||||
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
||||
|
||||
You are responsible for accurately assigning ICD-10 codes and to diagnose and document medical records.
|
||||
Your expertise ensures that healthcare providers are properly reimbursed and that patient care is well-documented.
|
||||
In this scenario, you will be presented with a series of medical records and your task is to provide the correct ICD-10 code(s)
|
||||
and ICD-9 CM in procedures based on the information provided.
|
||||
|
||||
<|eot_id|>
|
||||
<|start_header_id|>user<|end_header_id|>
|
||||
|
||||
"Chief Complaint :5วันก่อนมารพ.มีไข้ ไอ มีเสมหะ มีน้ำมูก เหนื่อย ปวดเมื่อยตามตัว \r\n
|
||||
Present illness : 5วันก่อนมารพ.มีไข้ ไอ มีเสมหะ มีน้ำมูก เหนื่อย ปวดเมื่อยตามตัว มีน้ำมูก เลือดกำเดาจาากข้างขวา
|
||||
ปฏิการกระทบกระแทก ไม่มีเจ็บคอ ไม่มีอาการอ่อนเพลีย มีอาการอ่อนเพลีย ไอมาก ไอตลอด มีอาการระคายคอ ปัสสาวะปกติ ไม่มีถ่ายเหลว
|
||||
\r\n\r\nAllergy : |\r\n\r\nOther : no underlying disease\r\n\r\nPlan Treatment Day 1 of hospitalization : admit ward
|
||||
\r\n\r\nReview of System { \r\n\r\n General :a thai adult female ,look sickness fatigue dry lip moderate dehydration
|
||||
\r\n Skin :no MP rash \r\n Eyes :not pale ,no icteric sclera \r\n Chest :secretion sound in both lung ,no crepitation , no wheezing \r
|
||||
\n }
|
||||
VitalSign First : {\n
|
||||
BP : 117.0/63.0 mmHg\n
|
||||
Pulse : 62.0 BPm\n
|
||||
Temperature : 37.0 Celsius\n
|
||||
Respiratory rate : 20.0\n
|
||||
Weight : 50.000 kgs.\n
|
||||
Height : 165.0 cm.\n
|
||||
Painscore: N/A\n
|
||||
O2SAT : 100\n}\n
|
||||
|
||||
Lab Results: \n
|
||||
|
||||
Electrolyte:Sodium (Na), Result : 143 mmol/L\r\n
|
||||
Electrolyte:Potassium (K),Result : 3.8 mmol/L\r\n
|
||||
Electrolyte:Chloride (Cl), Result : 108 mmol/L\r\n
|
||||
Electrolyte:Bicarbonate (CO2),Result : 27.0 mmol/L\r\n
|
||||
Creatinine (Serum):Creatinine, Result : 0.69 mg/dL\r\n
|
||||
Creatinine (Serum):eGFR,Result : 100.41 ml/min/1.73 m^2\r\n
|
||||
AST/SGOT:AST/SGOT, Result : 48 U/L\r\n
|
||||
ALT/SGPT:ALT/SGPT, Result : 42 U/L\r\n
|
||||
CBC:WBC Count,Result : 3.2 10^3/uL\r\n
|
||||
CBC:RBC Count, Result : 3.57 10^6/uL\r\n
|
||||
CBC:Hemoglobin (Hb), Result : 10.7 g/dL\r\n
|
||||
CBC:Hematocrit (HCT),Result : 32.4 %\r\n
|
||||
CBC:MCV, Result : 91 fL\r\n
|
||||
CBC:MCH, Result : 30.0 pg\r\n
|
||||
CBC:MCHC, Result : 33.0 g/dL\r\n
|
||||
CBC:RDW-CV,Result : 12.9 %\r\n
|
||||
CBC:Platelet Count, Result : 226 10^3/uL\r\n
|
||||
CBC:Platelet Estimates, Result : Adequate \r\n
|
||||
CBC:Neutrophils,Result : 41 %\r\n
|
||||
CBC:Lymphocytes, Result : 46 %\r\n
|
||||
CBC:Monocytes, Result : 9 %\r\n
|
||||
CBC:Eosinophils, Result : 4 %\r\n
|
||||
CBC:Basophils,Result : 0 %\r\n
|
||||
COVID-19 Antigen (Rapid Test) For Admit:COVID-19 Antigen (Rapid Test), Result : Positive \r\n
|
||||
Influenza A/B screening:Flu A,Result : Negative \r\n
|
||||
Influenza A/B screening:Flu B, Result : Negative \n
|
||||
|
||||
X-ray Results: 15-05-2567 12:56 CHEST (PA, UPRIGHT)\r\n
|
||||
\r\nHISTORY: Fever with productive cough and dyspnea for 5 days. \r\nCOMPARISON: None.\r\n
|
||||
\r\n
|
||||
FINDINGS:\r\n
|
||||
TUBES/LINES: None.\r\nLUNGS: Normal lung volumes. Band-like opacity at right apical lung. Clear left lung.\r\n
|
||||
PLEURA: No pneumothorax or effusion. Mild bilateral apical pleural thickening. \r\n
|
||||
HEART AND MEDIASTINUM: Normal cardiac silhouette. Normal mediastinal contour.\r\n
|
||||
BONY STRUCTURES: Mild scoliosis of the thoracic spine. \r\n\r\n
|
||||
IMPRESSION:\r\n
|
||||
- Band-like opacity at right apical lung, probably plate atelectasis or fibrosis\r\n- Mild bilateral apical pleural thickening"
|
||||
|
||||
<|eot_id|>
|
||||
<|start_header_id|>assistant<|end_header_id|>
|
||||
|
||||
Let's analyze the provided information and document the appropriate ICD-10 codes based on the patient's symptoms and diagnosis.
|
||||
|
||||
### Step-by-Step Analysis:
|
||||
|
||||
1. **Understand the Symptoms and Diagnosis**:
|
||||
- The patient presents with a range of symptoms including fever, cough with sputum, fatigue, nasal discharge (including blood),
|
||||
and dyspnea. The lab tests returned a positive COVID-19 antigen test, while the influenza test was negative.
|
||||
|
||||
2. **Identify Key Terms**:
|
||||
- Primary key terms include 'COVID-19 positive', 'fever', 'productive cough', 'dyspnea', and pulmonary findings from the X-ray.
|
||||
|
||||
3. **Locate the Main Category**:
|
||||
- The main categories for the conditions noted are:
|
||||
- COVID-19: U07.1
|
||||
- Possible acute bronchitis: J20 (based on the productive cough)
|
||||
- Other symptoms such as dizziness: R42
|
||||
- Evidence of acute respiratory infection: J06.9
|
||||
|
||||
4. **Identify Specific Codes**:
|
||||
- Based on the diagnosis:
|
||||
- COVID-19 confirmed case: U07.1
|
||||
- Acute bronchitis: J20.9 (considering unspecified acute bronchitis)
|
||||
- Dizziness (if noted as significant and problematic): R42
|
||||
- Unspecified acute upper respiratory infection: J06.9
|
||||
|
||||
5. **Check for Additional Codes or Modifiers**:
|
||||
- Considering the details provided, the primary diagnosis is the confirmed COVID-19 infection, while bronchiolitis
|
||||
and dizziness might be secondary diagnoses.
|
||||
|
||||
6. **Validate the Code Selection**:
|
||||
- Confirm that the selected codes reflect the patient's symptoms accurately, including acute bronchitis
|
||||
and any other significant symptoms presented.
|
||||
|
||||
7. **Document the ICD-10 Code**:
|
||||
- The ICD-10 codes are documented for all noted conditions accordingly."
|
||||
|
||||
```json
|
||||
Answer: {
|
||||
"Primary_Diagnosis": {
|
||||
"Code": "U071",
|
||||
"Description": "COVID-19, virus identified"
|
||||
},
|
||||
"Secondary_Diagnosis": [
|
||||
{
|
||||
"Code": "J20",
|
||||
"Description": "Acute bronchitis due to unspecified organism"
|
||||
},
|
||||
{
|
||||
"Code": "R42",
|
||||
"Description": "Dizziness and giddiness"
|
||||
},
|
||||
{
|
||||
"Code": "J069",
|
||||
"Description": "Acute upper respiratory infection, unspecified"
|
||||
}
|
||||
],
|
||||
"ICD9_Procedure": []
|
||||
}
|
||||
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
||||
# Example Clinical Adapted Thai Medical Extraction
|
||||
````
|
||||
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
||||
|
||||
Task : Extract input the following patient information into output format Tone: the following medical text into
|
||||
Thai in a fluent and elegant style.
|
||||
Output Format.1.Age: \n2.Gender: \n3.Weight :\n4.Height : \n5.Chief Complaint: \n6.Symptoms and Signs: \n7.Medical History: \n
|
||||
8.Current Medications: \n9.Laboratory Results: \n10.Imaging Findings: \n11.Allergy: \n12.Drug Allergy:
|
||||
|
||||
|
||||
<|eot_id|>
|
||||
<|start_header_id|>user<|end_header_id|>
|
||||
ผู้ป่วยของเราเป็นชายถนัดทั้งสองมือ อายุ 43 ปี มีประวัติการชักที่ไม่สามารถควบคุมได้มาเป็นเวลา 20 ปี ลักษณะการชักของเขามักจะรวมถึงการรู้สึกร้อนวูบวาบและอาการทางประสาทสัมผัสอื่น ๆ
|
||||
ที่พัฒนาไปสู่การเคลื่อนไหวของกล้ามเนื้อที่มีจุดศูนย์กลางส่วนใหญ่ทางด้านขวา การตรวจหาสาเหตุของการชักรวมถึงการถ่ายภาพด้วยคลื่นแม่เหล็กไฟฟ้า (MRI) ซึ่งเผยให้เห็นเนื้องอกไขมันขนาดใหญ่ที่เส้นกลางสมอง
|
||||
การพัฒนาไม่สมบูรณ์ของคอร์ปัสคาโลซัมบางส่วน และรอยโรคที่อยู่ใกล้เคียงในสมองส่วนหน้าซ้ายที่คาดว่าจะเป็นเนื้องอกกลีอาล (glial neoplasm) ตามลักษณะภาพถ่ายทางรังสี
|
||||
รอยโรคในสมองส่วนหน้าซ้ายด้านหน้าและตรงกลางประกอบด้วยการกลายเป็นหินปูนแบบเป็นก้อนพร้อมการเพิ่มขึ้นของสัญญาณ FLAIR ที่กว้างขวางซึ่งเกี่ยวข้องกับไจรัสซิงกูเลตทั้งสองข้างและสมองส่วนหน้าซ้าย
|
||||
(รูปที่ ).\n\nการจัดการทางการแพทย์ล้มเหลวในการควบคุมการชักของเขาและเขาถูกส่งต่อเพื่อหาทางเลือกในการรักษาด้วยการผ่าตัด รอยโรคที่เพิ่มขึ้นถูกสังเกตด้วยการถ่ายภาพเพิ่มเติมและขอบเขตของอาการบวมน้ำก็เพิ่มขึ้นด้วย
|
||||
ความกังวลเกี่ยวกับการพัฒนาเนื้องอกกลีอาลที่เพิ่มขึ้นและการควบคุมการชักที่ไม่ดีทำให้มีการแนะนำให้ทำการผ่าตัด
|
||||
การตัดสินใจถูกทำขึ้นเพื่อดำเนินการผ่าตัดนำทางด้วยระบบประสาทเพื่อตัดมวลที่เพิ่มขึ้นในสมองส่วนหน้าซ้ายและการตัดสมองส่วนหน้าบางส่วนโดยใช้การตรวจคลื่นไฟฟ้าสมองระหว่างการผ่าตัด
|
||||
(intraoperative electroencephalogram - EEG), การทำแผนที่คอร์ติคอล (cortical mapping) และการตรวจวัดศักย์ไฟฟ้าที่เกิดจากการกระตุ้นประสาทรับความรู้สึก
|
||||
(somatosensory evoked potentials - SSEP)\n\nตัวอย่างที่ส่งไปตรวจทางพยาธิวิทยาแบบแช่แข็งในระหว่างการผ่าตัดพบว่ามีเส้นใยโรเซนธาล (Rosenthal fibers)
|
||||
และการกลายเป็นหินปูนแบบเป็นจุดซึ่งคาดว่าจะเป็นเนื้องอกกลีอาล การประเมินทางพยาธิวิทยาแบบถาวรเผยให้เห็นเนื้องอกไขมัน (lipoma) และความผิดปกติของคอร์ติคอลแบบเฉพาะจุด
|
||||
(focal cortical dysplasia) แบบ Palmini Type IA ในสมองที่อยู่ใกล้เคียง ความผิดปกติเล็กน้อยของโครงสร้างคอร์ติคอลและการเกิดกลีโอซิส (gliosis)
|
||||
ในเนื้อสมองขาวที่เกี่ยวข้องสามารถเห็นได้ในคราบสีฮีมาโทซิลินและอีโอซิน (hematoxylin and eosin - H&E) และคราบสีโปรตีนกรดกลีอาลไฟบริลลารี (glial fibrillary acidic protein - GFAP)
|
||||
และการย้อมสีโปรตีนเส้นประสาท (neurofilament protein - NFP) ในบริเวณที่เกิดกลีโอซิสไม่แสดงหลักฐานของเซลล์ประสาทที่ผิดรูป เซลล์ประสาทขนาดใหญ่ หรือเซลล์ลูกโป่ง (รูปที่ ).\n\n
|
||||
การถ่ายภาพหลังการผ่าตัด (รูปที่ ) แสดงให้เห็นการตัดรอยโรคที่เพิ่มขึ้นใกล้เคียงทั้งหมดในสมองส่วนหน้าซ้ายและไจรัสซิงกูเลต การลดลงอย่างมากของอาการบวมน้ำที่เกิดจากหลอดเลือดถูกสังเกตในภาพ
|
||||
FLAIR เนื้องอกไขมันที่เส้นกลางสมองไม่เปลี่ยนแปลง\n\nการฟื้นตัวหลังการตัดรวมถึงอาการเสริมในบริเวณมอเตอร์ซินโดรมระดับปานกลางรวมถึงอาการอ่อนแรงครึ่งซีก การพูดล่าช้า และการเปลี่ยนแปลงทางอารมณ์
|
||||
การเปลี่ยนแปลงเหล่านี้ค่อยๆ หายไปและพบว่าผู้ป่วยมีความสมบูรณ์ทางระบบประสาทในการติดตามผลที่คลินิก การควบคุมการชักเกิดขึ้นทันทีหลังการตัด ยาต้านการชักถูกใช้อย่างต่อเนื่องและค่อยๆ
|
||||
ถูกถอดออกในเดือนต่อมาโดยไม่มีการกลับมาเป็นซ้ำ ผู้ป่วยไม่มีการชักเป็นเวลา 3 ปีหลังการตัด การถ่ายภาพติดตามผล 18 เดือนพบการเปลี่ยนแปลง T2/FLAIR ที่คงที่พร้อมกับบริเวณเล็ก ๆ
|
||||
|
||||
|
||||
<|eot_id|>
|
||||
<|start_header_id|>assistant<|end_header_id|>
|
||||
1. อายุ: 43 ปี\n
|
||||
2. เพศ: ชาย\n
|
||||
3. น้ำหนัก: ไม่ระบุ\n
|
||||
4. ส่วนสูง: ไม่ระบุ\n
|
||||
5. อาการหลัก: การชักที่ไม่สามารถควบคุมได้\n
|
||||
6. อาการและสัญญาณ: รู้สึกร้อนวูบวาบ, อาการทางประสาทสัมผัส, การเคลื่อนไหวของกล้ามเนื้อที่มีจุดศูนย์กลางส่วนใหญ่ทางด้านขวา\n
|
||||
7. ประวัติการรักษา: การจัดการทางการแพทย์ล้มเหลวในการควบคุมการชัก\n
|
||||
8. ยาที่ใช้ในปัจจุบัน: ยาต้านการชัก\n9. ผลการตรวจทางห้องปฏิบัติการ: ไม่ระบุ\n
|
||||
10. ผลการตรวจภาพ: MRI แสดงเนื้องอกไขมันขนาดใหญ่ที่เส้นกลางสมอง, การพัฒนาไม่สมบูรณ์ของคอร์ปัสคาโลซัมบางส่วน, รอยโรคที่อยู่ใกล้เคียงในสมองส่วนหน้าซ้ายที่คาดว่าจะเป็นเนื้องอกกลีอาล\n
|
||||
11. อาการแพ้: ไม่ระบุ\n
|
||||
12. อาการแพ้ยา: ไม่ระบุ\n
|
||||
การผ่าตัดนำทางด้วยระบบประสาทเพื่อตัดมวลที่เพิ่มขึ้นในสมองส่วนหน้าซ้ายและการตัดสมองส่วนหน้าบางส่วนได้ถูกดำเนินการ
|
||||
และผลการตรวจทางพยาธิวิทยาเผยให้เห็นว่าเป็นเนื้องอกไขมันและความผิดปกติของคอร์ติคอลแบบเฉพาะจุด (focal cortical dysplasia) แบบ Palmini Type IA
|
||||
ในสมองที่อยู่ใกล้เคียง การฟื้นตัวหลังการผ่าตัดรวมถึงอาการเสริมในบริเวณมอเตอร์ซินโดรมระดับปานกลาง แต่การควบคุมการชักเกิดขึ้นทันทีหลังการผ่าตัดและผู้ป่วยไม่มีการชักเป็นเวลา
|
||||
3 ปีหลังการผ่าตัด การถ่ายภาพติดตามผล 18 เดือนพบการเปลี่ยนแปลง T2/FLAIR ที่คงที่พร้อมกับบริเวณเล็ก ๆ ที่เพิ่มขึ้นของการเพิ่มขึ้นใกล้เคียงที่ไม่เปลี่ยนแปลง.
|
||||
````
|
||||
|
||||
|
||||
|
||||
|
||||
# How to use
|
||||
|
||||
|
||||
```python
|
||||
|
||||
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
||||
import torch
|
||||
|
||||
model_id = "EIRTHAIMED/Llama-3.1-EIRAI-8B"
|
||||
|
||||
nf4_config = BitsAndBytesConfig(
|
||||
load_in_4bit=True,
|
||||
bnb_4bit_quant_type="nf4",
|
||||
bnb_4bit_use_double_quant=True,
|
||||
bnb_4bit_compute_dtype=torch.bfloat16
|
||||
)
|
||||
|
||||
# Load the base model
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
||||
model = AutoModelForCausalLM.from_pretrained(
|
||||
model_id,
|
||||
torch_dtype=torch.bfloat16,
|
||||
# quantization_config=nf4_config, # uncomment this line for 4 bit loading
|
||||
device_map="auto",
|
||||
attn_implementation="flash_attention_2"
|
||||
)
|
||||
|
||||
messages = [
|
||||
{"role": "system", "content": "You are an expert medical assistant named EIR , developed by EIR Thai Medical LLM. You are to be a helpful, respectful, and honest assistant."},
|
||||
{"role": "user", "content": "การใช้ clinical tracer มีบทบาทอย่างไรในการพัฒนาคุณภาพการดูแลผู้ป่วย?"}
|
||||
]
|
||||
|
||||
input = tokenizer.apply_chat_template(
|
||||
messages,
|
||||
tokenize = True,
|
||||
add_generation_prompt = True, # Must add for generation
|
||||
return_tensors = "pt",
|
||||
).to("cuda")
|
||||
|
||||
|
||||
from transformers import TextStreamer
|
||||
text_streamer = TextStreamer(tokenizer, skip_prompt = True)
|
||||
_ = model.generate(input, streamer = text_streamer, max_new_tokens = 1500, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
@article{EirAI,
|
||||
title={Eir: Thai Medical Large Language Models},
|
||||
author={Yutthakorn Thiprak and Rungtam Ngodngamthaweesuk and Songtam Ngodngamtaweesuk, MD},
|
||||
year={2024},
|
||||
journal={arXiv preprint arXiv:2409.08523},
|
||||
url={https://arxiv.org/abs/2409.08523}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
**Thank you very much**
|
||||
Asst.Prof.Dr. Ekapol Chuangsuwanich and Praj Bhargava @Meta Research Engineer, for your valuable endorsement of our preprint paper on arXiv.
|
||||
|
||||
**Thank you**
|
||||
Draft Reviewer Report
|
||||
[Kullawat Chaowanawatee](https://www.computing.psu.ac.th/profile/index.php?staffid=coc0051) and [Dr. Jakapan Suaboot](https://www.computing.psu.ac.th/profile/index.php?staffid=coc0056) from Prince of Songkla University, Phuket Campus
|
||||
<br>
|
||||
Draft Industry Reviewer Report
|
||||
[Mr. Piyawat Maneenual](https://ieeexplore.ieee.org/author/37086452350) ,Assistant IT Manager ,Thonburi Rajyindee Hospital<br>
|
||||
39
config.json
Normal file
39
config.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"_name_or_path": "meta-llama/Meta-Llama-3.1-8B-Instruct",
|
||||
"architectures": [
|
||||
"LlamaForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 128000,
|
||||
"eos_token_id": [
|
||||
128001,
|
||||
128008,
|
||||
128009
|
||||
],
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 4096,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 14336,
|
||||
"max_position_embeddings": 131072,
|
||||
"mlp_bias": false,
|
||||
"model_type": "llama",
|
||||
"num_attention_heads": 32,
|
||||
"num_hidden_layers": 32,
|
||||
"num_key_value_heads": 8,
|
||||
"pretraining_tp": 1,
|
||||
"rms_norm_eps": 1e-05,
|
||||
"rope_scaling": {
|
||||
"factor": 8.0,
|
||||
"high_freq_factor": 4.0,
|
||||
"low_freq_factor": 1.0,
|
||||
"original_max_position_embeddings": 8192,
|
||||
"rope_type": "llama3"
|
||||
},
|
||||
"rope_theta": 500000.0,
|
||||
"tie_word_embeddings": false,
|
||||
"torch_dtype": "bfloat16",
|
||||
"transformers_version": "4.44.1",
|
||||
"use_cache": true,
|
||||
"vocab_size": 128256
|
||||
}
|
||||
3
model-00001-of-00004.safetensors
Normal file
3
model-00001-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2453fe828fd8b7a9d52e5aad171c2f3c5cbe0a687363dd2f64a43257882e7e09
|
||||
size 4953586384
|
||||
3
model-00002-of-00004.safetensors
Normal file
3
model-00002-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5e13e4314eefa19b0e6385e98c8e2de0cfe2b2319b13ee2f1e4da970536f86a1
|
||||
size 4999819336
|
||||
3
model-00003-of-00004.safetensors
Normal file
3
model-00003-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6b44fcd1f1932f0a38930b50e2e51e8a1a003e1a4ef70edb6284e4bc15918cea
|
||||
size 4915916144
|
||||
3
model-00004-of-00004.safetensors
Normal file
3
model-00004-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:183b833237f6d0e249511257aabcede8fc222c2b8dab53842b2e827ce4a5dbee
|
||||
size 1191234472
|
||||
1
model.safetensors.index.json
Normal file
1
model.safetensors.index.json
Normal file
File diff suppressed because one or more lines are too long
16
special_tokens_map.json
Normal file
16
special_tokens_map.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"bos_token": {
|
||||
"content": "<|begin_of_text|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"eos_token": {
|
||||
"content": "<|eot_id|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
}
|
||||
}
|
||||
410563
tokenizer.json
Normal file
410563
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
2062
tokenizer_config.json
Normal file
2062
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user