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

Update pages/2_Life cycle of NLP.py

Browse files
Files changed (1) hide show
  1. pages/2_Life cycle of NLP.py +33 -48
pages/2_Life cycle of NLP.py CHANGED
@@ -1,5 +1,7 @@
1
  import streamlit as st
2
 
 
 
3
  # Custom CSS for styling, animations, and a light background
4
  st.markdown(
5
  """
@@ -51,71 +53,54 @@ st.markdown(
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
 
 
1
  import streamlit as st
2
 
3
+ import streamlit as st
4
+
5
  # Custom CSS for styling, animations, and a light background
6
  st.markdown(
7
  """
 
53
  .image-container img:hover {
54
  transform: scale(1.05); /* Subtle zoom effect */
55
  }
56
+ .sidebar {
57
+ width: 200px;
58
+ }
59
  </style>
60
  """,
61
  unsafe_allow_html=True,
62
  )
63
 
64
+ # Sidebar navigation with radio buttons
65
+ st.sidebar.title("NLP Life Cycle Navigation")
66
+ step = st.sidebar.radio("Choose a step in NLP Life Cycle",
67
+ ("Problem Statement", "Data Collection", "Simple EDA", "Data Pre-processing", "EDA",
68
+ "Feature Engineering", "Training", "Testing", "Deployment/Monitoring"))
69
+
70
+ # Title for the NLP Life Cycle
71
+ st.markdown("<div class='title'>Life Cycle of NLP</div>", unsafe_allow_html=True)
72
 
73
+ # Caption
74
  st.markdown(
75
+ "<div class='caption'>Navigating the journey of NLP from start to deployment!...</div>",
76
  unsafe_allow_html=True,
77
  )
78
 
79
+ # Display content based on the selected step from the sidebar
 
 
 
 
 
 
 
80
  if step == "Problem Statement":
81
+ st.markdown("<div class='section'><b>Problem Statement</b><br>Every NLP project begins by identifying the problem that needs solving. It could range from sentiment analysis to machine translation, based on the requirements.</div>", unsafe_allow_html=True)
82
+
 
 
83
  elif step == "Data Collection":
84
+ st.markdown("<div class='section'><b>Data Collection</b><br>The next step is to gather relevant text data from various sources such as servers, web-scrapping(text).</div>", unsafe_allow_html=True)
85
+
 
 
86
  elif step == "Simple EDA":
87
+ st.markdown("<div class='section'><b>Simple EDA</b><br>Before diving deep into modeling, it's crucial to understand the data. Simple EDA gives the quality of the collected text data.</div>", unsafe_allow_html=True)
88
+
 
 
89
  elif step == "Data Pre-processing":
90
+ st.markdown("<div class='section'><b>Data Pre-processing</b><br>Pre-processing includes cleaning the data and pre-processing using different techniques based on the problem statement.</div>", unsafe_allow_html=True)
91
+
 
 
92
  elif step == "EDA":
93
+ st.markdown("<div class='section'><b>EDA (Exploratory Data Analysis)</b><br>In this deeper phase of EDA, visualizations like word clouds, bar plots, and heatmaps are created to gain insights into the data. Identifying correlations, trends, and outliers is crucial here.</div>", unsafe_allow_html=True)
94
+
 
 
95
  elif step == "Feature Engineering":
96
+ st.markdown("<div class='section'><b>Feature Engineering</b><br>Feature engineering involves creating new features or transforming existing ones to better represent the data for machine learning models.Convert text into numerical format(**Vectorization**)</div>", unsafe_allow_html=True)
97
+
 
 
98
  elif step == "Training":
99
+ st.markdown("<div class='section'><b>Training</b><br>The model is trained using the pre-processed data.</div>", unsafe_allow_html=True)
100
+
 
 
101
  elif step == "Testing":
102
+ st.markdown("<div class='section'><b>Testing</b><br>After training, the model is evaluated on a separate test dataset.</div>", unsafe_allow_html=True)
103
+
 
 
104
  elif step == "Deployment/Monitoring":
105
+ st.markdown("<div class='section'><b>Deployment and Monitoring</b><br>Once the model is trained and tested, it is deployed into a real-world environment. Continuous monitoring is needed to ensure the model performs well over time, especially as new data comes in.</div>", unsafe_allow_html=True)
 
 
 
106