How to Use
Here is an example of how to use this model to get predictions and convert them back to labels:
import tensorflow as tf
from transformers import TFAutoModelForSequenceClassification, AutoTokenizer
import joblib
# Load the model and tokenizer
model = TFAutoModelForSequenceClassification.from_pretrained("NeuEraAI/Stress_Classifier_BERT")
tokenizer = AutoTokenizer.from_pretrained("NeuEraAI/Stress_Classifier_BERT")
# Load your label encoder
label_encoder = joblib.load("label_encoder.joblib")
def decode_predictions(predictions):
# Extract predicted indices (assuming predictions is a list of dicts with 'label' keys)
predicted_indices = [int(pred['label'].split('_')[-1]) for pred in predictions]
# Decode the indices to original labels
decoded_labels = label_encoder.inverse_transform(predicted_indices)
return decoded_labels
# Example usage
text = "Your example input text here."
decode_predictions(model.predict(text))
- Downloads last month
- 9
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.