CoolFace
Apppublic

Ahsancs777/prioritypredictor

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
app.py47 linesDownload Raw Back to root
1import streamlit as st
2import joblib
3
4# Page configuration
5st.set_page_config(page_title="Task Predictor", page_icon="โœ…")
6
7# 1. Load the models
8try:
9    cat_model = joblib.load('category_model.pkl')
10    pri_model = joblib.load('priority_model.pkl')
11except:
12    st.error("Model files (.pkl) not found! Please check if the files are in the correct folder.")
13
14# 2. Main Title & Description
15st.title("Prority Predictor")
16st.write("Enter your task in the box below and click the Predict button.")
17
18# 3. User Input
19task_input = st.text_input("Enter your task here:", placeholder="e.g., Finish the financial report")
20
21# Prediction Button
22if st.button("Predict Results"):
23    if task_input:
24        # Prediction logic
25        category_pred = cat_model.predict([task_input])[0]
26        priority_pred = pri_model.predict([task_input])[0]
27        
28        st.markdown("---")
29        st.subheader("๐Ÿ“Œ Analysis Results")
30        
31        # Result Display in clear boxes
32        col1, col2 = st.columns(2)
33        with col1:
34            st.success(f"**Category:**\n\n {category_pred}")
35        with col2:
36            st.info(f"**Priority:**\n\n {priority_pred}")
37            
38        # Analysis summary
39        st.write("---")
40        st.markdown(f"**Quick Stats:**")
41        st.write(f"๐Ÿ”น Task length: {len(task_input)} characters")
42        st.write(f"๐Ÿ”น Total words: {len(task_input.split())}")
43    else:
44        st.warning("Please enter a task first!")
45
46# Simple Footer
47st.markdown("<br><br><small>Created by AHSAN KHAN</small>", unsafe_allow_html=True)