Downloads · 30 days
0
Samay-Verse/prescription-classifier
prescription-classifier is a text classification model from Samay-Verse. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
A fine-tuned BERT-based text classification model built for the Sanjeevani healthcare platform. It classifies whether a given text input is a valid medical prescription or not, enabling automated prescription validati…
Downloads · 30 days
0
Access
Public
Updated Apr 4, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json712 KB · 99%
From the Hugging Face model README
A fine-tuned BERT-based text classification model built for the Sanjeevani healthcare platform. It classifies whether a given text input is a valid medical prescription or not, enabling automated prescription validation in the Sanjeevani ordering and delivery pipeline.
Sanjeevani is a full-stack healthcare platform that connects patients with pharmacies and delivery agents. It includes:
This model is used by the backend services to verify uploaded prescriptions before allowing controlled medicine orders.
| Property | Value |
|---|---|
| Base Model | bert-base-uncased |
| Task | Text Classification (Binary) |
| Tokenizer | BertTokenizer |
| Max Sequence Length | 512 |
| Language | English |
| Domain | Medical / Pharmaceutical |
| Label | Description |
|---|---|
VALID_PRESCRIPTION | Input is a legitimate medical prescription |
INVALID | Input is not a valid prescription |
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Samay-Verse/prescription-classifier"
)
result = classifier("Tab. Amoxicillin 500mg - 1 tablet twice daily for 5 days. Dr. Sharma")
print(result)
# [{'label': 'VALID_PRESCRIPTION', 'score': 0.97}]
from transformers import BertTokenizer, BertForSequenceClassification
import torch
model_name = "Samay-Verse/prescription-classifier"
tokenizer = BertTokenizer.from_pretrained(model_name)
model = BertForSequenceClassification.from_pretrained(model_name)
text = "Tab. Paracetamol 650mg - 1 tablet SOS. Sig: after food."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=1).item()
print("Valid Prescription" if prediction == 1 else "Invalid")
This model is called by the Sanjeevani backend API when a customer uploads a prescription image (OCR-extracted text) or types a prescription manually via the chatbot.
Customer uploads prescription
↓
OCR / Text Extraction
↓
prescription-classifier (this model)
↓
VALID → Order proceeds
INVALID → User prompted to re-upload
bert-base-uncasedBertTokenizer, max length 512Apache 2.0 — Free to use with attribution.
Built and maintained by the Samay-Verse team. For issues or contributions, open a discussion on the HuggingFace model page.