Update app.py
Browse files
app.py
CHANGED
|
@@ -60,18 +60,18 @@ if st.session_state.selected_page == 'What is NLP? π§ ':
|
|
| 60 |
# Content for NLP Lifecycle
|
| 61 |
elif st.session_state.selected_page == "NLP Lifecycle π":
|
| 62 |
lifecycle_option = sidebar.radio("Select NLP Lifecycle Step:", [
|
| 63 |
-
"Overview of the NLP Life Cycle
|
| 64 |
-
"Problem Definition
|
| 65 |
-
"Data Collection
|
| 66 |
-
"Simple EDA
|
| 67 |
-
"Data Preprocessing
|
| 68 |
-
"Feature Engineering
|
| 69 |
-
"Model Training
|
| 70 |
-
"Evaluation
|
| 71 |
-
"Deployment
|
| 72 |
])
|
| 73 |
|
| 74 |
-
if lifecycle_option == "Overview of the NLP Life Cycle":
|
| 75 |
st.write("""
|
| 76 |
#### Overview of the NLP Life Cycle:
|
| 77 |
The NLP life cycle is a structured process for building, using, and maintaining systems that work with human language. It turns unstructured text into meaningful insights or automated actions. This process ensures continuous improvement and adapts to real-world needs.
|
|
@@ -111,7 +111,7 @@ elif st.session_state.selected_page == "NLP Lifecycle π":
|
|
| 111 |
10. **Monitoring and Maintenance** π οΈ
|
| 112 |
""")
|
| 113 |
|
| 114 |
-
elif lifecycle_option == "Problem Definition":
|
| 115 |
st.write("""
|
| 116 |
#### π§ 1. Problem Definition
|
| 117 |
- The first step in the NLP lifecycle is defining the problem. This means understanding the goal and figuring out how NLP can help solve the problem.
|
|
@@ -124,7 +124,7 @@ elif st.session_state.selected_page == "NLP Lifecycle π":
|
|
| 124 |
**Example of a problem statement**: The goal could be to classify customer reviews as either positive or negative, or to find the main topics in product reviews.
|
| 125 |
""")
|
| 126 |
|
| 127 |
-
elif lifecycle_option == "Data Collection":
|
| 128 |
st.write("""
|
| 129 |
#### π 2. Data Collection
|
| 130 |
Data collection is the second step in the NLP lifecycle. It involves gathering data from various sources based on the problem statement, so it can be analyzed and processed.
|
|
@@ -182,7 +182,7 @@ elif st.session_state.selected_page == "NLP Lifecycle π":
|
|
| 182 |
""")
|
| 183 |
|
| 184 |
|
| 185 |
-
elif lifecycle_option == "Simple EDA":
|
| 186 |
st.write("""
|
| 187 |
#### π 3. Simple EDA
|
| 188 |
#### Simple Exploratory Data Analysis (Simple EDA)
|
|
@@ -217,7 +217,7 @@ elif st.session_state.selected_page == "NLP Lifecycle π":
|
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
-
elif lifecycle_option == "Data Preprocessing":
|
| 221 |
st.write("""
|
| 222 |
#### π§Ή 4. Text Preprocessing
|
| 223 |
Text preprocessing prepares raw text for further analysis. This stage involves cleaning and transforming the data into a structured format that machine learning models can understand.
|
|
@@ -275,7 +275,7 @@ elif st.session_state.selected_page == "NLP Lifecycle π":
|
|
| 275 |
""")
|
| 276 |
|
| 277 |
|
| 278 |
-
elif lifecycle_option == "Feature Engineering":
|
| 279 |
st.write("""
|
| 280 |
#### π 5. Text Representation
|
| 281 |
After preprocessing, the text data needs to be converted into a numerical format for use in machine learning models. There are several methods for text representation:
|
|
@@ -288,7 +288,7 @@ elif st.session_state.selected_page == "NLP Lifecycle π":
|
|
| 288 |
- Vector: [1, 1, 1] (word frequency representation)
|
| 289 |
""")
|
| 290 |
|
| 291 |
-
elif lifecycle_option == "Model Training":
|
| 292 |
st.write("""
|
| 293 |
#### ποΈββοΈ 6. Model Training
|
| 294 |
In the model training stage, machine learning algorithms are trained on the preprocessed and represented text data. The choice of model depends on the task:
|
|
@@ -299,7 +299,7 @@ elif st.session_state.selected_page == "NLP Lifecycle π":
|
|
| 299 |
**Example**: Training a Naive Bayes classifier to categorize news articles into topics such as "Sports", "Politics", etc.
|
| 300 |
""")
|
| 301 |
|
| 302 |
-
elif lifecycle_option == "Evaluation":
|
| 303 |
st.write("""
|
| 304 |
#### π
7. Evaluation
|
| 305 |
After training the model, it's important to evaluate its performance using metrics such as accuracy, precision, recall, and F1-score.
|
|
@@ -311,7 +311,7 @@ elif st.session_state.selected_page == "NLP Lifecycle π":
|
|
| 311 |
**Example**: Evaluating a sentiment analysis model using accuracy and F1-score on a test dataset.
|
| 312 |
""")
|
| 313 |
|
| 314 |
-
elif lifecycle_option == "Deployment":
|
| 315 |
st.write("""
|
| 316 |
#### π 8. Deployment
|
| 317 |
Once the model is evaluated and tuned, it is deployed into production where it can be used by end users. Deployment involves:
|
|
|
|
| 60 |
# Content for NLP Lifecycle
|
| 61 |
elif st.session_state.selected_page == "NLP Lifecycle π":
|
| 62 |
lifecycle_option = sidebar.radio("Select NLP Lifecycle Step:", [
|
| 63 |
+
"πOverview of the NLP Life Cycle",
|
| 64 |
+
"π― Problem Definition",
|
| 65 |
+
"πData Collection",
|
| 66 |
+
"πSimple EDA",
|
| 67 |
+
"π§ΉData Preprocessing ",
|
| 68 |
+
"πFeature Engineering",
|
| 69 |
+
"ποΈββοΈModel Training",
|
| 70 |
+
"π
Evaluation",
|
| 71 |
+
"πDeployment"
|
| 72 |
])
|
| 73 |
|
| 74 |
+
if lifecycle_option == "Overview of the NLP Life Cycle π":
|
| 75 |
st.write("""
|
| 76 |
#### Overview of the NLP Life Cycle:
|
| 77 |
The NLP life cycle is a structured process for building, using, and maintaining systems that work with human language. It turns unstructured text into meaningful insights or automated actions. This process ensures continuous improvement and adapts to real-world needs.
|
|
|
|
| 111 |
10. **Monitoring and Maintenance** π οΈ
|
| 112 |
""")
|
| 113 |
|
| 114 |
+
elif lifecycle_option == "π― Problem Definition":
|
| 115 |
st.write("""
|
| 116 |
#### π§ 1. Problem Definition
|
| 117 |
- The first step in the NLP lifecycle is defining the problem. This means understanding the goal and figuring out how NLP can help solve the problem.
|
|
|
|
| 124 |
**Example of a problem statement**: The goal could be to classify customer reviews as either positive or negative, or to find the main topics in product reviews.
|
| 125 |
""")
|
| 126 |
|
| 127 |
+
elif lifecycle_option == "πData Collection":
|
| 128 |
st.write("""
|
| 129 |
#### π 2. Data Collection
|
| 130 |
Data collection is the second step in the NLP lifecycle. It involves gathering data from various sources based on the problem statement, so it can be analyzed and processed.
|
|
|
|
| 182 |
""")
|
| 183 |
|
| 184 |
|
| 185 |
+
elif lifecycle_option == "πSimple EDA":
|
| 186 |
st.write("""
|
| 187 |
#### π 3. Simple EDA
|
| 188 |
#### Simple Exploratory Data Analysis (Simple EDA)
|
|
|
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
+
elif lifecycle_option == "π§ΉData Preprocessing ":
|
| 221 |
st.write("""
|
| 222 |
#### π§Ή 4. Text Preprocessing
|
| 223 |
Text preprocessing prepares raw text for further analysis. This stage involves cleaning and transforming the data into a structured format that machine learning models can understand.
|
|
|
|
| 275 |
""")
|
| 276 |
|
| 277 |
|
| 278 |
+
elif lifecycle_option == "πFeature Engineering":
|
| 279 |
st.write("""
|
| 280 |
#### π 5. Text Representation
|
| 281 |
After preprocessing, the text data needs to be converted into a numerical format for use in machine learning models. There are several methods for text representation:
|
|
|
|
| 288 |
- Vector: [1, 1, 1] (word frequency representation)
|
| 289 |
""")
|
| 290 |
|
| 291 |
+
elif lifecycle_option == "ποΈββοΈModel Training":
|
| 292 |
st.write("""
|
| 293 |
#### ποΈββοΈ 6. Model Training
|
| 294 |
In the model training stage, machine learning algorithms are trained on the preprocessed and represented text data. The choice of model depends on the task:
|
|
|
|
| 299 |
**Example**: Training a Naive Bayes classifier to categorize news articles into topics such as "Sports", "Politics", etc.
|
| 300 |
""")
|
| 301 |
|
| 302 |
+
elif lifecycle_option == "π
Evaluation":
|
| 303 |
st.write("""
|
| 304 |
#### π
7. Evaluation
|
| 305 |
After training the model, it's important to evaluate its performance using metrics such as accuracy, precision, recall, and F1-score.
|
|
|
|
| 311 |
**Example**: Evaluating a sentiment analysis model using accuracy and F1-score on a test dataset.
|
| 312 |
""")
|
| 313 |
|
| 314 |
+
elif lifecycle_option == "πDeployment":
|
| 315 |
st.write("""
|
| 316 |
#### π 8. Deployment
|
| 317 |
Once the model is evaluated and tuned, it is deployed into production where it can be used by end users. Deployment involves:
|