Update pages/2_Life cycle of NLP.py
Browse files- 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 |
-
#
|
| 60 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
# Caption
|
| 63 |
st.markdown(
|
| 64 |
-
"<div class='caption'
|
| 65 |
unsafe_allow_html=True,
|
| 66 |
)
|
| 67 |
|
| 68 |
-
#
|
| 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 |
-
|
| 79 |
-
unsafe_allow_html=True,
|
| 80 |
-
)
|
| 81 |
elif step == "Data Collection":
|
| 82 |
-
st.markdown(
|
| 83 |
-
|
| 84 |
-
unsafe_allow_html=True,
|
| 85 |
-
)
|
| 86 |
elif step == "Simple EDA":
|
| 87 |
-
st.markdown(
|
| 88 |
-
|
| 89 |
-
unsafe_allow_html=True,
|
| 90 |
-
)
|
| 91 |
elif step == "Data Pre-processing":
|
| 92 |
-
st.markdown(
|
| 93 |
-
|
| 94 |
-
unsafe_allow_html=True,
|
| 95 |
-
)
|
| 96 |
elif step == "EDA":
|
| 97 |
-
st.markdown(
|
| 98 |
-
|
| 99 |
-
unsafe_allow_html=True,
|
| 100 |
-
)
|
| 101 |
elif step == "Feature Engineering":
|
| 102 |
-
st.markdown(
|
| 103 |
-
|
| 104 |
-
unsafe_allow_html=True,
|
| 105 |
-
)
|
| 106 |
elif step == "Training":
|
| 107 |
-
st.markdown(
|
| 108 |
-
|
| 109 |
-
unsafe_allow_html=True,
|
| 110 |
-
)
|
| 111 |
elif step == "Testing":
|
| 112 |
-
st.markdown(
|
| 113 |
-
|
| 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 |
|