Downloads · 30 days
0
xingqiang/Medical-NER-Qwen-4B-Thinking-plus
Medical-NER-Qwen-4B-Thinking-plus is a text generation model from xingqiang. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This is a fine-tuned medical LLM based on Qwen3-4B-Thinking, specialized for medical entity and relationship extraction.
Downloads · 30 days
0
Access
Public
Updated Nov 15, 2025
Repo size
408 MB
Likes
0
Public
Click a slice to open those files.
.safetensors132 MB · 89%
From the Hugging Face model README
This is a fine-tuned medical LLM based on Qwen3-4B-Thinking, specialized for medical entity and relationship extraction.
| Metric | Entity Extraction | Relationship Extraction |
|---|---|---|
| Precision | 0.000 | 0.000 |
| Recall | 0.000 | 0.000 |
| F1-Score | 0.000 | 0.000 |
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-3B-Thinking",
torch_dtype="auto",
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "xingqiang/Medical-NER-Qwen-4B-Thinking-plus")
tokenizer = AutoTokenizer.from_pretrained("xingqiang/Medical-NER-Qwen-4B-Thinking-plus")
# Generate medical analysis
text = "Hepatitis C virus causes chronic liver infection."
messages = [
{"role": "user", "content": f"Extract medical entities and relationships from: {text}"}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)