Srikanth0804 commited on
Commit
29f2e90
Β·
verified Β·
1 Parent(s): 9e1c53d

Update pages/3_Deployment.py

Browse files
Files changed (1) hide show
  1. pages/3_Deployment.py +0 -40
pages/3_Deployment.py CHANGED
@@ -17,46 +17,6 @@ st.markdown("""
17
  - 😐 **Neutral**: tech reviews, travel vlogs, gaming walkthroughs
18
  """)
19
 
20
- # User input
21
- user_input = st.text_area("##### **Enter a YouTube comment to analyze:**",
22
- placeholder="E.g., That reunion video was so emotional!")
23
-
24
- # Predict button
25
- if st.button("Predict Sentiment"):
26
- if user_input.strip():
27
- prediction = pipeline.predict([user_input])[0]
28
- st.markdown(f"## βœ… Prediction: `{prediction.capitalize()}`")
29
-
30
- if prediction == "positive":
31
- st.success("😊 Positive Sentiment")
32
- elif prediction == "negative":
33
- st.error("😠 Negative Sentiment")
34
- else:
35
- st.info("😐 Neutral Sentiment")
36
- else:
37
- st.warning("⚠️ Please enter a comment to analyze.")
38
-
39
- # Navigation
40
- if st.button("Go to Model Page"):
41
- st.switch_page("pages/2_Model_Training.py")import streamlit as st
42
- import pickle
43
-
44
- st.set_page_config(page_title="🎯 YouTube Comment Sentiment Predictor")
45
-
46
- st.title("🎯 Live Sentiment Classifier")
47
-
48
- # Load the complete pipeline (TF-IDF + Model)
49
- with open("text_classification.pkl", "rb") as f:
50
- pipeline = pickle.load(f)
51
-
52
- # Helpful context for users
53
- st.markdown("#### πŸ“Œ *This model works best for YouTube comments related to the following topics:*")
54
- st.markdown("""
55
- - 😊 **Positive**: heartwarming reunion, kindness stories, feel-good moments
56
- - 😠 **Negative**: bad customer experience, airline disaster, controversial incident
57
- - 😐 **Neutral**: tech reviews, travel vlogs, gaming walkthroughs
58
- """)
59
-
60
  # User input
61
  user_input = st.text_area("##### **Enter a YouTube comment to analyze:**",
62
  placeholder="E.g., That reunion video was so emotional!")
 
17
  - 😐 **Neutral**: tech reviews, travel vlogs, gaming walkthroughs
18
  """)
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  # User input
21
  user_input = st.text_area("##### **Enter a YouTube comment to analyze:**",
22
  placeholder="E.g., That reunion video was so emotional!")