Medichat V2 Llama3 8B
Llama3-8Bを改良した医療対話モデルで、医学Q&Aと臨床テキスト処理に最適化されています
ダウンロード数 21
リリース時間 : 6/2/2024
モデル概要
これは事前学習済み言語モデルの統合バージョンで、構造化/非構造化臨床テキストの処理に特に優れており、専門的な医学Q&Aサービスを提供します
モデル特徴
医学専門能力
専門医学モデルを統合することで、複雑な医学問題を処理する能力を備えています
マルチモデル融合
DARE TIESメソッドを使用して複数の専門モデルを統合し、医学専門性と汎用能力のバランスを取っています
構造化出力
構造化医療データ(JSON形式の診断レポートなど)の生成をサポートしています
モデル能力
医学Q&A
症状分析
鑑別診断
臨床テキスト処理
構造化医療データ生成
使用事例
臨床支援
症状分析
患者の症状説明に基づいて可能な鑑別診断を提供します
複数の可能性のある診断を含む詳細な分析レポートを生成します
検査結果解釈
検査データを解析し診断提案を生成します
診断結果と関連医学的解釈を構造化出力します
医学教育
医学知識Q&A
医学生や医療従事者の専門的な質問に回答します
正確で詳細な医学知識の説明を提供します
🚀 Medichat-V2-Llama3-8B
このモデルは、mergekit を使用して事前学習された言語モデルをマージしたものです。非構造化の臨床テキストを構造化するのに特に有効です。
🚀 クイックスタート
このモデルは、非構造化の臨床テキストを構造化するのに役立ちます。以下に、使用方法の概要を説明します。
✨ 主な機能
モデルの構成と特徴
- ベースモデル:このモデルの基礎は「refuelai/Llama-3-Refueled」で、これ自体はLlama3-8Bモデルの改良版で、命令に従う能力と様々なドメインでの適応性が高いことで知られています。
- マージされたモデル:
- ruslanmv/ai-medical-model-32bit:技術的な医療質問に答えるために特化して微調整されたモデルで、医療知識の堅固な基盤を提供します。
- Locutusque/Llama-3-Hercules-5.0-8B:複雑な命令に従い、会話型のインタラクションを効果的に処理する能力があり、特に科学技術的な文脈で優れています。
このモデルは、refuelai/Llama-3-Refueled をベースに、DARE TIES マージ方法を使用してマージされました。
マージされたモデル
以下のモデルがマージに含まれています。
設定
このモデルを生成するために使用されたYAML設定は次のとおりです。
models:
- model: Locutusque/Llama-3-Hercules-5.0-8B
parameters:
weight: [0.25, 0.35, 0.45, 0.35, 0.25]
density: [0.1, 0.25, 0.5, 0.25, 0.1]
- model: refuelai/Llama-3-Refueled
- model: ruslanmv/ai-medical-model-32bit
parameters:
weight: [0.55, 0.45, 0.35, 0.45, 0.55]
density: [0.1, 0.25, 0.5, 0.25, 0.1]
merge_method: dare_ties
base_model: refuelai/Llama-3-Refueled
parameters:
int8_mask: true
dtype: bfloat16
💻 使用例
基本的な使用法
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
class MedicalAssistant:
def __init__(self, model_name="sethuiyer/Medichat-V2-Llama3-8B", device="cuda"):
self.device = device
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
self.model = AutoModelForCausalLM.from_pretrained(model_name).to(self.device)
self.sys_message = '''
You are an AI Medical Assistant trained on a vast dataset of health information. Please be thorough and
provide an informative answer. If you don't know the answer to a specific medical inquiry, advise seeking professional help.
'''
def format_prompt(self, question):
messages = [
{"role": "system", "content": self.sys_message},
{"role": "user", "content": question}
]
prompt = self.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
return prompt
def generate_response(self, question, max_new_tokens=512):
prompt = self.format_prompt(question)
inputs = self.tokenizer(prompt, return_tensors="pt").to(self.device)
with torch.no_grad():
outputs = self.model.generate(**inputs, max_new_tokens=max_new_tokens, use_cache=True)
answer = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)[0].strip()
return answer
assistant = MedicalAssistant()
question = '''
Symptoms:
Dizziness, headache, and nausea.
What is the differential diagnosis?
'''
response = assistant.generate_response(question)
print(response)
Based on the symptoms of dizziness, headache, and nausea, the differential diagnosis could include several conditions. Here are some possible causes:
1. Vestibular disorders: These can cause dizziness, vertigo, and nausea. Examples include benign paroxysmal positional vertigo (BPPV), labyrinthitis, and vestibular neuritis.
2. Migraine: Migraines can cause severe headaches, nausea, and dizziness. They can be triggered by various factors, such as stress, changes in sleep patterns, or certain foods.
3. Inner ear infections: Infections in the inner ear, such as labyrinthitis or otitis media, can cause dizziness, nausea, and headache.
4. Meniere's disease: This is a disorder of the inner ear that can cause episodes of vertigo, nausea, and hearing loss.
5. Motion sickness: This can occur when the body receives conflicting signals from the eyes, inner ear, and other sensory systems. It can cause dizziness, nausea, and headache.
6. Anxiety or panic attacks: Anxiety or panic attacks can cause dizziness, nausea, and headache.
7. Low blood sugar (hypoglycemia): Low blood sugar can cause dizziness, headache, and nausea.
8. Medication side effects: Certain medications, such as antibiotics, antihistamines, and antidepressants, can cause dizziness, headache, and nausea as side effects.
9. Stroke or transient ischemic attack (TIA): These can cause sudden onset of dizziness, headache, and nausea.
10. Brain tumor or other central nervous system disorders: Rarely, a brain tumor or other central nervous system disorder can cause dizziness, headache, and nausea.
It is essential to consult a healthcare professional for a proper evaluation and diagnosis. They will likely perform a physical examination, take a detailed medical history, and order appropriate tests to determine the underlying cause of the symptoms. Treatment will depend on the specific diagnosis and may include medications, lifestyle changes, or other interventions.
prompt = '''
A 52-year-old woman comes to the physician because of a 6-month history of generalized fatigue, low-grade fever, and a 10-kg (22-lb) weight loss. Physical examination shows generalized pallor and splenomegaly. Her hemoglobin concentration is 7.5 g/dL and leukocyte count is 41,800/mm3. Leukocyte alkaline phosphatase activity is low. Peripheral blood smear shows basophilia with myelocytes and metamyelocytes. Bone marrow biopsy shows cellular hyperplasia with proliferation of immature granulocytic cells. Which of the following mechanisms is most likely responsible for this patient's condition?
Output JSON in this format.
{
"age":
"gender"
"past medicial history"
"present symptoms"
"interventions"
"lab tests"
"medications"
"possible diseases"
}
PLEASE WRITE ONLY JSON
'''
response = assistant.generate_response(prompt)
print(response)
{
"age": 52,
"gender": "female",
"past medical history": "unknown",
"present symptoms": "generalized fatigue, low-grade fever, 10-kg (22-lb) weight loss",
"interventions": "bone marrow biopsy",
"lab tests": "hemoglobin concentration: 7.5 g/dL, leukocyte count: 41,800/mm3, leukocyte alkaline phosphatase activity: low, peripheral blood smear: basophilia with myelocytes and metamyelocytes",
"medications": "none",
"possible diseases": "chronic myeloid leukemia"
}
📚 ドキュメント
このモデルの量子化バージョンは mradermacher/Medichat-V2-Llama3-8B-GGUF で入手できます。
📄 ライセンス
このモデルのライセンスは「other」です。
Phi 2 GGUF
その他
Phi-2はマイクロソフトが開発した小型ながら強力な言語モデルで、27億のパラメータを持ち、効率的な推論と高品質なテキスト生成に特化しています。
大規模言語モデル 複数言語対応
P
TheBloke
41.5M
205
Roberta Large
MIT
マスク言語モデリングの目標で事前学習された大型英語言語モデルで、改良されたBERTの学習方法を採用しています。
大規模言語モデル 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERTはBERT基礎モデルの蒸留バージョンで、同等の性能を維持しながら、より軽量で高効率です。シーケンス分類、タグ分類などの自然言語処理タスクに適しています。
大規模言語モデル 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instructは多言語大規模言語モデルで、多言語対話ユースケースに最適化されており、一般的な業界ベンチマークで優れた性能を発揮します。
大規模言語モデル 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM - RoBERTaは、100言語の2.5TBのフィルタリングされたCommonCrawlデータを使って事前学習された多言語モデルで、マスク言語モデリングの目標で学習されています。
大規模言語モデル 複数言語対応
X
FacebookAI
9.6M
664
Roberta Base
MIT
Transformerアーキテクチャに基づく英語の事前学習モデルで、マスク言語モデリングの目標を通じて大量のテキストでトレーニングされ、テキスト特徴抽出と下流タスクの微調整をサポートします。
大規模言語モデル 英語
R
FacebookAI
9.3M
488
Opt 125m
その他
OPTはMeta AIが公開したオープンプリトレーニングトランスフォーマー言語モデルスイートで、パラメータ数は1.25億から1750億まであり、GPT-3シリーズの性能に対抗することを目指しつつ、大規模言語モデルのオープンな研究を促進するものです。
大規模言語モデル 英語
O
facebook
6.3M
198
1
transformersライブラリに基づく事前学習モデルで、様々なNLPタスクに適用可能
大規模言語モデル
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1はMetaが発表した多言語大規模言語モデルシリーズで、8B、70B、405Bのパラメータ規模を持ち、8種類の言語とコード生成をサポートし、多言語対話シーンを最適化しています。
大規模言語モデル
Transformers 複数言語対応

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5ベーシック版はGoogleによって開発されたテキスト-to-テキスト変換Transformerモデルで、パラメータ規模は2.2億で、多言語NLPタスクをサポートしています。
大規模言語モデル 複数言語対応
T
google-t5
5.4M
702
おすすめAIモデル
Llama 3 Typhoon V1.5x 8b Instruct
タイ語専用に設計された80億パラメータの命令モデルで、GPT-3.5-turboに匹敵する性能を持ち、アプリケーションシナリオ、検索拡張生成、制限付き生成、推論タスクを最適化
大規模言語モデル
Transformers 複数言語対応

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-TinyはSODAデータセットでトレーニングされた超小型対話モデルで、エッジデバイス推論向けに設計されており、体積はCosmo-3Bモデルの約2%です。
対話システム
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
RoBERTaアーキテクチャに基づく中国語抽出型QAモデルで、与えられたテキストから回答を抽出するタスクに適しています。
質問応答システム 中国語
R
uer
2,694
98