Downloads · 30 days
11
6% of all-time downloads
nikhil061307/clinical-classifier-finetuned
clinical-classifier-finetuned is a text classification model from nikhil061307. Use it when you need a label for a piece of text. It is set up for transformers.
Clinical text classification model with fine-tuned contrastive encoder
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
170
Public
Parameters
137M
547 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors547 MB · 99%
From the Hugging Face model README
Clinical text classification model with fine-tuned contrastive encoder
This model is trained for clinical text classification with the following labels: Absent, Hypothetical, Present
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model_name = "nikhil061307/clinical-classifier-finetuned "
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Example usage
text = "Patient presents with [ENTITY]chest pain[/ENTITY] and shortness of breath."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(outputs.logits, dim=-1)
print(f"Predicted class: {predicted_class.item()}")
print(f"Probabilities: {predictions[0].tolist()}")
{
"Absent": 0,
"Hypothetical": 1,
"Present": 2
}
The model was trained on clinical text data with entity mentions marked using [ENTITY] and [/ENTITY] tags.
Please refer to the training logs and evaluation metrics provided during model development.
If you use this model, please cite appropriately.