deepcoder2024/Qwen3-8B-LoRA-Cochrane-Screening
016
Qwen3-8B-LoRA-Cochrane-Screening
LoRA adapter for Cochrane-style title/abstract screening, fine-tuned on top of Qwen/Qwen3-8B.
This repository contains adapter weights only. You still need the original Qwen3-8B base model.
Training summary
Files
Load and run
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE_MODEL = "Qwen/Qwen3-8B"
ADAPTER_ID = "deepcoder2024/Qwen3-8B-LoRA-Cochrane-Screening"
tokenizer = AutoTokenizer.from_pretrained(ADAPTER_ID, trust_remote_code=True)
base = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(base, ADAPTER_ID)
model.eval()
messages = [
{
"role": "system",
"content": (
"You are an expert systematic reviewer performing title and abstract screening.\n"
"Given the review Selection_criteria, the study Title, and the Abstract, "
"decide whether the study should be included.\n\n"
"Labels:\n"
"- include: clearly meets selection criteria\n"
"- exclude: clearly does not meet selection criteria\n"
"- uncertain: insufficient information to decide\n\n"
"Respond with ONLY a JSON object in this exact format:\n"
'{"label": "include" | "exclude" | "uncertain", "reason": "<brief explanation>"}\n'
"Do not output any other text."
),
},
{
"role": "user",
"content": (
"Selection_criteria:\n...\n\n"
"Title:\n...\n\n"
"Abstract:\n...\n\n"
"Decide the screening label and provide a brief reason."
),
},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output_ids = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(output_ids[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))Intended use
Research / assistance for systematic-review title and abstract screening. Not a substitute for expert reviewer judgment or clinical decision-making.
Framework versions
- transformers
- peft >= 0.19
- torch
