Downloads · 30 days
4
17% of all-time downloads
hsilvosa/BETO-ATC-Hierarchical-Classifier
BETO-ATC-Hierarchical-Classifier is a text classification model from hsilvosa. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This model is a multi-label transformer encoder based on dccuchile/bert-base-spanish-wwm-cased (BETO) fine-tuned on the official AEMPS CIMA Research Dataset (hsilvosa/aemps-cima) and integrated with procurement metada…
Downloads · 30 days
4
17% of all-time downloads
All-time downloads
24
Public
Parameters
110M
439 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors439 MB · 100%
From the Hugging Face model README
This model is a multi-label transformer encoder based on dccuchile/bert-base-spanish-wwm-cased (BETO) fine-tuned on the official AEMPS CIMA Research Dataset (hsilvosa/aemps-cima) and integrated with procurement metadata from (hsilvosa/openplacsp).
Given a drug description, active ingredients, dosage form, or patient leaflet snippet in Spanish, it predicts its 5-level ATC (Anatomical Therapeutic Chemical) code taxonomy classification.
Intended exclusively for medical research and pharmaceutical data analytics. Not intended for clinical prescribing or medical advice.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("your-hf-username/BETO-ATC-Hierarchical-Classifier")
model = AutoModelForSequenceClassification.from_pretrained("your-hf-username/BETO-ATC-Hierarchical-Classifier")
text = "Medicamento: Omeprazol 20 mg | Forma farmacéutica: COMPRIMIDO | Principios activos: Omeprazol"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)
print(probs)