emotion / app.py
ikshit2004's picture
Update app.py
0eccf80 verified
raw
history blame contribute delete
509 Bytes
import gradio as gr
import joblib
# Load your model
model = joblib.load("emotion_classifier_pipe_lr.pkl")
def predict_emotion(text):
prediction = model.predict([text])[0]
return prediction
iface = gr.Interface(
fn=predict_emotion,
inputs=gr.Textbox(lines=2, placeholder="Enter your diary text here..."),
outputs="text",
title="Dementia Diary Emotion Predictor",
description="Enter diary text, and the model predicts the emotion."
)
if __name__ == "__main__":
iface.launch()