Fernandosr85/parteirabr-maternal-triage-adapter

ParteiraBR — Maternal Health Triage Adapter
LoRA adapter for maternal health triage in Brazilian Portuguese — designed for riverine, quilombola, and backland communities where traditional midwives are often the first point of care and formal healthcare services are distant.
Fine-tuned on Llama-3.3-70B-Instruct via Adaption's AutoScientist platform.
Covers 13 structured clinical risk signals across 3 urgency tiers (vermelho / amarelo / verde), grounded in official Brazilian Ministry of Health publications — all responses in PT-BR.
Evaluation results
Training Winrates
The adapted model outperforms the base model with 80% win rate vs 21% on held-out medical evaluation — a +281% relative improvement over the base model.
Train/Eval Metrics
Train loss converged steadily over 163 steps. Validation loss tracked closely, confirming generalization without overfitting. Learning rate followed cosine schedule with warmup. Gradient norm stabilized after initial spike, indicating stable optimization throughout.
Dataset quality
Model details
Training dataset
[fernandosr85/parteirabr-signalgrounding](https://www.kaggle.com/datasets/fernandosr85/parteirabr-signalgrounding)
1,200 instruction/completion pairs across 13 clinical signals:
Quality controls
8-dimension rubric (16 pts max): correct referral, welcoming tone, simple language, respect for traditional knowledge, no risk minimization, no prescription or diagnosis, concrete referral pathway, structural clarity. Dataset mean: 15.41/16.
3-tier safety gate: blocks home remedies for emergencies, wait-and-see language for red signals, diagnosis, and prescription. All 1,200 examples passed with safety_flag: ok.
Grounding
All 13 signals traced to specific pages in official MoH publications:
- Caderneta Brasileira da Gestante (2026)
- Estratificação de Risco Gestacional — SES-MG (2025)
- Atenção ao Pré-Natal de Baixo Risco — CAB nº 32 (2012)
- Saúde da Criança: Aleitamento Materno — CAB nº 23 (2015)
- Manual de Gestação de Alto Risco (2022)
Safety Principle
The core constraint of this adapter: when any risk signal is present, always refer to formal healthcare services — immediately for red signals, within 24–48h for yellow signals.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE_MODEL = "meta-llama/Llama-3.3-70B-Instruct"
ADAPTER_PATH = (
"/kaggle/input/parteirabr-maternalhealth-adapter/"
"other/llama-3-3-70b-instruct-lora/1"
)
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
device_map="auto",
torch_dtype="auto",
)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
model = PeftModel.from_pretrained(
base_model,
ADAPTER_PATH,
)
prompt = """ParteiraBR — Guia de Orientação em Saúde Materna Tradicional
Você é um assistente de acolhimento e navegação em saúde materna.
Diante de qualquer sinal de risco, encaminhe imediatamente ao serviço
de saúde. Nunca diagnostique, prescreva ou sugira remédios caseiros
para emergências.
Contexto: uma gestante de uma comunidade ribeirinha no Amazonas
perguntou:
Estou grávida e tive um sangramento forte agora. Estou com medo.
O que eu faço?"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
generated_tokens = outputs[0][inputs["input_ids"].shape[1]:]
print(tokenizer.decode(generated_tokens, skip_special_tokens=True))Model repositories
Credits
- Fine-tuning platform: Adaption — AutoScientist & Adaptive Data
- Challenge: AutoScientist Challenge 2026
- Training infrastructure: Adaption compute credits
- Dataset remastering: Adaption Adaptive Data pipeline (Grade A, +11.1% improvement)
- Grounding validator: ParteiraBR
- Author: Fernando Rodrigues · Kaggle: fernandosr85 · HuggingFace: Fernandosr85
Disclaimer
Experimental research artifact submitted to the AutoScientist Challenge 2026 (Healthcare category). The adapter does not replace evaluation by a qualified healthcare professional. All clinical guidance generated by the model must be reviewed before use in real community health settings. Traditional midwifery knowledge is respected and valued — this adapter is designed to complement, not replace, community health networks.
