Harika22 commited on
Commit
aac424c
·
verified ·
1 Parent(s): a6e3c11

Update pages/2_Life cycle of NLP.py

Browse files
Files changed (1) hide show
  1. pages/2_Life cycle of NLP.py +121 -0
pages/2_Life cycle of NLP.py CHANGED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ # Custom CSS for styling, animations, and a light background
4
+ st.markdown(
5
+ """
6
+ <style>
7
+ body {
8
+ background-color: #f9f9f9; /* Light gray background */
9
+ font-family: 'Arial', sans-serif;
10
+ }
11
+ @keyframes fadeIn {
12
+ 0% { opacity: 0; transform: translateY(-20px); }
13
+ 100% { opacity: 1; transform: translateY(0); }
14
+ }
15
+ .title {
16
+ text-align: center;
17
+ color: #2c3e50; /* Deep gray-blue */
18
+ font-size: 3rem;
19
+ font-weight: bold;
20
+ animation: fadeIn 1s ease-in-out;
21
+ }
22
+ .caption {
23
+ text-align: center;
24
+ font-style: italic;
25
+ font-size: 1.2rem;
26
+ color: #7f8c8d; /* Soft gray */
27
+ animation: fadeIn 1.5s ease-in-out;
28
+ }
29
+ .section {
30
+ font-size: 1.1rem;
31
+ text-align: justify;
32
+ line-height: 1.8;
33
+ color: #34495e; /* Muted gray */
34
+ background: #ffffff; /* White card-style background */
35
+ padding: 20px;
36
+ border-radius: 10px;
37
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
38
+ animation: fadeIn 2s ease-in-out;
39
+ margin: 10px 0;
40
+ }
41
+ .image-container {
42
+ text-align: center;
43
+ margin: 20px 0;
44
+ animation: fadeIn 2.5s ease-in-out;
45
+ }
46
+ .image-container img {
47
+ border-radius: 15px;
48
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
49
+ transition: transform 0.3s ease-in-out;
50
+ }
51
+ .image-container img:hover {
52
+ transform: scale(1.05); /* Subtle zoom effect */
53
+ }
54
+ </style>
55
+ """,
56
+ unsafe_allow_html=True,
57
+ )
58
+
59
+ # Title with animation
60
+ st.markdown("<div class='title'>NLP Life Cycle</div>", unsafe_allow_html=True)
61
+
62
+ # Caption with animation
63
+ st.markdown(
64
+ "<div class='caption'>***Explore the Journey from Problem Statement to Deployment in NLP!***</div>",
65
+ unsafe_allow_html=True,
66
+ )
67
+
68
+ # Radio buttons for navigation through the steps
69
+ step = st.radio(
70
+ "Choose a step in the NLP Life Cycle:",
71
+ ["Problem Statement", "Data Collection", "Simple EDA", "Data Pre-processing",
72
+ "EDA", "Feature Engineering", "Training", "Testing", "Deployment/Monitoring"],
73
+ )
74
+
75
+ # Step-by-step description with animations
76
+ if step == "Problem Statement":
77
+ st.markdown(
78
+ "<div class='section'><b>1. Problem Statement</b><br>In this initial stage, we define the problem to be solved using NLP. The problem statement sets the direction for the entire project, ensuring that all efforts align with the objectives and scope.</div>",
79
+ unsafe_allow_html=True,
80
+ )
81
+ elif step == "Data Collection":
82
+ st.markdown(
83
+ "<div class='section'><b>2. Data Collection</b><br>Here, we gather the necessary data from various sources such as text, audio, or images. High-quality, relevant data is crucial to the success of the model and the problem-solving process.</div>",
84
+ unsafe_allow_html=True,
85
+ )
86
+ elif step == "Simple EDA":
87
+ st.markdown(
88
+ "<div class='section'><b>3. Simple EDA</b><br>Exploratory Data Analysis (EDA) is performed to understand the dataset better. Simple statistical summaries and visualizations help to identify data patterns, anomalies, and initial insights.</div>",
89
+ unsafe_allow_html=True,
90
+ )
91
+ elif step == "Data Pre-processing":
92
+ st.markdown(
93
+ "<div class='section'><b>4. Data Pre-processing</b><br>At this stage, the data is cleaned and transformed for model compatibility. This involves tasks like tokenization, lowercasing, removing stop words, and handling missing values.</div>",
94
+ unsafe_allow_html=True,
95
+ )
96
+ elif step == "EDA":
97
+ st.markdown(
98
+ "<div class='section'><b>5. EDA</b><br>In-depth Exploratory Data Analysis is performed to gain further insights. Visualizations like word clouds, bar plots, and histograms are used to understand relationships and distributions in the dataset.</div>",
99
+ unsafe_allow_html=True,
100
+ )
101
+ elif step == "Feature Engineering":
102
+ st.markdown(
103
+ "<div class='section'><b>6. Feature Engineering</b><br>Feature engineering involves creating new features or modifying existing ones to improve model performance. Techniques like word embeddings, TF-IDF, and vectorization are commonly used.</div>",
104
+ unsafe_allow_html=True,
105
+ )
106
+ elif step == "Training":
107
+ st.markdown(
108
+ "<div class='section'><b>7. Training</b><br>In this step, the data is split into training and validation sets, and machine learning models are trained using the processed features. Model selection and hyperparameter tuning are key parts of this phase.</div>",
109
+ unsafe_allow_html=True,
110
+ )
111
+ elif step == "Testing":
112
+ st.markdown(
113
+ "<div class='section'><b>8. Testing</b><br>Once the model is trained, it is tested on unseen data to evaluate its performance. Metrics like accuracy, precision, recall, and F1 score are used to assess the model's quality.</div>",
114
+ unsafe_allow_html=True,
115
+ )
116
+ elif step == "Deployment/Monitoring":
117
+ st.markdown(
118
+ "<div class='section'><b>9. Deployment/Monitoring</b><br>After testing, the model is deployed into a production environment where it can make predictions. Continuous monitoring ensures the model performs well and adapts to new data over time.</div>",
119
+ unsafe_allow_html=True,
120
+ )
121
+