Downloads · 30 days
0
Fernandosr85/parteirabr-maternal-triage-adapter
parteirabr-maternal-triage-adapter is a text generation model from Fernandosr85. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama3.3.
Downloads · 30 days
0
Access
Public
Updated Jul 4, 2026
Repo size
1.5 GB
Likes
0
Public
Click a slice to open those files.
.tgz1.5 GB · 100%
From the Hugging Face model README

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.
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.
| Model | Win Rate |
|---|---|
Base (Llama-3.3-70B-Instruct) | 21% |
Adapted (parteirabr-adapter) | 80% |
| Metric | Value |
|---|---|
| Initial train loss | ~1.59 |
| Final validation loss | ~0.42 |
| Training steps | 163 |
| LR scheduler | cosine (warmup) |
| Gradient norm | spike → stable |
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.
| Metric | Value |
|---|---|
| Dataset grade | A |
| Score before / after | 9.0 → 10.0 |
| Quality improvement | +11.1% (Adaption Adaptive Data remastering) |
| Medical domain percentile | 43.9 → 57.7 |
| Total examples | 1,200 → 28,700 (augmented) |
| Field | Value |
|---|---|
| Base model | meta-llama/Llama-3.3-70B-Instruct (70B) |
| Trained model name | adaption_llama_3_3_70b_instru_parteira_br_maternal_gui_80fa5adc |
| Training method | Supervised Fine-Tuning (SFT) + LoRA |
| Data format | Chat (instruction/completion) |
| Domain | Brazilian maternal health triage — PT-BR |
| Category | Healthcare |
fernandosr85/parteirabr-signalgrounding
1,200 instruction/completion pairs across 13 clinical signals:
| Tier | Signal | Examples |
|---|---|---|
| 🔴 Vermelho | Sangramento vaginal | 50 |
| 🔴 Vermelho | Dor de cabeça forte com alterações visuais | 50 |
| 🔴 Vermelho | Convulsão | 50 |
| 🔴 Vermelho | Diminuição ou ausência de movimentos do bebê | 50 |
| 🔴 Vermelho | Perda de líquido amniótico antes do termo | 50 |
| 🔴 Vermelho | Febre alta no pós-parto com mau cheiro | 50 |
| 🟡 Amarelo | Inchaço súbito de rosto e mãos | 100 |
| 🟡 Amarelo | Ardência ou dor para urinar | 100 |
| 🟡 Amarelo | Febre baixa persistente | 100 |
| 🟡 Amarelo | Ausência de acompanhamento de pré-natal | 100 |
| 🟢 Verde | Enjoo e náusea no primeiro trimestre | 200 |
| 🟢 Verde | Cansaço e sonolência | 200 |
| 🟢 Verde | Dúvidas sobre amamentação | 200 |
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.
All 13 signals traced to specific pages in official MoH publications:
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.
| Example | |
|---|---|
| ✅ Correto | "Isso é uma emergência. Procure o SAMU 192 AGORA." |
| ❌ Bloqueado | "Tome um chá e veja se melhora até amanhã." |
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))
| Platform | Link |
|---|---|
| HuggingFace Model | Fernandosr85/parteirabr-adapter |
| Kaggle Model | fernandosr85/parteirabr-maternalhealth-adapter |
| Kaggle Dataset | fernandosr85/parteirabr-signalgrounding |
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.