Downloads · 30 days
12
8% of all-time downloads
keanteng/bert-fatigue-response-classification-wqd7005
bert-fatigue-response-classification-wqd7005 is a text classification model from keanteng. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as agpl-3.0.
This repository contains fine-tuned BERT models for classifying healthcare questionnaire responses into risk categories.
Downloads · 30 days
12
8% of all-time downloads
All-time downloads
159
Public
Parameters
109M
876 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This repository contains fine-tuned BERT models for classifying healthcare questionnaire responses into risk categories.
BERT-base-uncased models have been fine-tuned for healthcare risk assessment:
The models predict three risk categories:
from transformers import BertTokenizer, BertForSequenceClassification
import torch
# Load tokenizer
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
# Load fatigue model
fatigue_model = BertForSequenceClassification.from_pretrained('keanteng/bert-fatigue-response-classification-wqd7005')
def predict_risk(text, model, tokenizer, max_length=128):
# Tokenize input
inputs = tokenizer(
text,
padding='max_length',
truncation=True,
max_length=max_length,
return_tensors='pt'
)
# Make prediction
model.eval()
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(predictions, dim=-1)
# Map to risk categories
risk_labels = ['Low Risk', 'Moderate Risk', 'High Risk']
return risk_labels[predicted_class.item()], predictions[0].tolist()
# Example usage
fatigue_text = "I feel extremely tired all the time and can't complete daily tasks"
risk_category, confidence_scores = predict_risk(fatigue_text, fatigue_model, tokenizer)
print(f"Risk Category: {risk_category}")
print(f"Confidence Scores: {confidence_scores}")
The models were trained and evaluated on healthcare questionnaire data with the following label mapping:
Fatigue Model:
The models were trained on questionnaire responses containing:
Data was split 80/20 for training and validation with stratified sampling.
These models are designed for:
Important: These models are for research and screening purposes only and should not replace professional medical diagnosis.