#Label 1 means relaxed and Label 0 means stressed #To make custom predictions use the below code
Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="sa-rehman/stress_classifier")
def predict(sentence):
pred=pipe.predict(sentence)
if pred[0].get("label")=='LABEL_1':
return "relaxed"
else:
return "stressed"