-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
29 lines (26 loc) · 1.08 KB
/
Copy pathapp.py
File metadata and controls
29 lines (26 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import streamlit as st
from src.pipeline.predict_pipeline import PredictionPipeline
st.set_page_config(
page_title="Support Ticket Classification System",
page_icon="🎫",
layout="centered")
st.title("🎫 Support Ticket Classification")
st.write("Enter your support ticket description below to predict Ticket Type and Priority.")
user_input = st.text_area(
"Enter Ticket Description",
height=150,
placeholder="Example: My product keeps crashing after the latest update...")
if st.button("Predict"):
if user_input.strip() == "":
st.warning("Please enter a ticket description.")
else:
try:
with st.spinner("Predicting..."):
pipeline = PredictionPipeline()
result = pipeline.predict(user_input)
st.success("Prediction Successful")
st.subheader("📌 Prediction Results")
st.write(f"**Ticket Type:** {result['Ticket Type']}")
st.write(f"**Ticket Priority:** {result['Ticket Priority']}")
except Exception as e:
st.error(f"Error occurred: {e}")