Mpavan45 commited on
Commit
67798e6
Β·
verified Β·
1 Parent(s): 6309476

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -16
app.py CHANGED
@@ -18,20 +18,23 @@ if sidebar_option != st.session_state.selected_page:
18
  st.session_state.selected_page = sidebar_option
19
 
20
  # Dynamically update the title based on the selected option
 
 
 
21
  if st.session_state.selected_page == 'What is NLP?':
22
- st.markdown("<h1 style='text-align: center; color: black;'>Natural Language Processing (NLP)</h1>", unsafe_allow_html=True)
23
 
24
  elif st.session_state.selected_page == 'NLP Lifecycle':
25
- st.markdown("<h1 style='text-align: center; color: balck;'>'πŸ”„ Natural Language Processing (NLP) Lifecycle'</h1>", unsafe_allow_html=True)
26
  if sidebar_option == 'Problem Definition':
27
  st.title('πŸ”§ Steps in the Natural Language Processing (NLP) lifecycle:')
 
28
  elif st.session_state.selected_page == 'NLP Techniques':
29
- st.markdown("<h1 style='text-align: center; color: black;'>'βš™οΈ Techniques in Natural Language Processing (NLP)'</h1>", unsafe_allow_html=True)
30
-
31
 
32
  # Content for "What is NLP?"
33
  if st.session_state.selected_page == 'What is NLP?':
34
- st.markdown("<h2 style='text-align: center; color: black;'>'Introduction'</h2>", unsafe_allow_html=True)
35
  st.write("""
36
  #### πŸ€– What is NLP?
37
  Natural Language Processing (NLP) is a subfield of artificial intelligence (AI) that focuses on the interaction between computers and human (natural) languages. The goal of NLP is to enable machines to understand, interpret, and generate human language in a way that is meaningful.
@@ -184,22 +187,20 @@ elif st.session_state.selected_page == "NLP Lifecycle":
184
  - **Precision**: The percentage of relevant instances among the retrieved instances.
185
  - **Recall**: The percentage of relevant instances that were retrieved.
186
  - **F1-score**: The harmonic mean of precision and recall.
187
-
188
- **Example**: If a sentiment analysis model predicts positive sentiment in 80 out of 100 reviews, its accuracy is 80%.
189
  """)
190
 
191
  elif lifecycle_option == "Deployment":
192
  st.write("""
193
  #### πŸš€ 7. Deployment
194
- The final step is deploying the model for real-time use. This involves integrating it into a system or application where it can process live data.
195
- - **Real-time Applications**: Chatbots, sentiment analysis for social media monitoring, text summarization for news.
196
- - **Maintenance**: Continuously monitor the model to ensure its performance remains high. Updates might be necessary if the language evolves or new data emerges.
197
-
198
- **Example**: Deploying a chatbot to answer customer inquiries based on historical support tickets.
199
- """)
200
-
201
- # Content for NLP Techniques
202
 
 
 
203
 
204
 
205
  # Content for "NLP Techniques"
@@ -221,7 +222,7 @@ elif st.session_state.selected_page == "NLP Techniques":
221
  st.write("""
222
  ### βš™οΈ Techniques in NLP
223
  NLP uses a variety of techniques to process and analyze text data. Some of the most common techniques include:
224
-
225
  1. **Tokenization**: Breaking down text into smaller units (e.g., words, sentences).
226
  2. **Part-of-Speech (POS) Tagging**: Identifying the grammatical roles of words in a sentence (e.g., noun, verb, adjective).
227
  3. **Named Entity Recognition (NER)**: Identifying entities such as names, dates, locations, etc.
 
18
  st.session_state.selected_page = sidebar_option
19
 
20
  # Dynamically update the title based on the selected option
21
+ def set_title(title, color="black"):
22
+ st.markdown(f"<h1 style='text-align: center; color: {color};'>{title}</h1>", unsafe_allow_html=True)
23
+
24
  if st.session_state.selected_page == 'What is NLP?':
25
+ set_title('Natural Language Processing (NLP)')
26
 
27
  elif st.session_state.selected_page == 'NLP Lifecycle':
28
+ set_title('πŸ”„ Natural Language Processing (NLP) Lifecycle')
29
  if sidebar_option == 'Problem Definition':
30
  st.title('πŸ”§ Steps in the Natural Language Processing (NLP) lifecycle:')
31
+
32
  elif st.session_state.selected_page == 'NLP Techniques':
33
+ set_title('βš™οΈ Techniques in Natural Language Processing (NLP)')
 
34
 
35
  # Content for "What is NLP?"
36
  if st.session_state.selected_page == 'What is NLP?':
37
+ st.markdown("<h2 style='text-align: center; color: black;'>Introduction</h2>", unsafe_allow_html=True)
38
  st.write("""
39
  #### πŸ€– What is NLP?
40
  Natural Language Processing (NLP) is a subfield of artificial intelligence (AI) that focuses on the interaction between computers and human (natural) languages. The goal of NLP is to enable machines to understand, interpret, and generate human language in a way that is meaningful.
 
187
  - **Precision**: The percentage of relevant instances among the retrieved instances.
188
  - **Recall**: The percentage of relevant instances that were retrieved.
189
  - **F1-score**: The harmonic mean of precision and recall.
190
+
191
+ **Example**: Evaluating a sentiment analysis model using accuracy and F1-score on a test dataset.
192
  """)
193
 
194
  elif lifecycle_option == "Deployment":
195
  st.write("""
196
  #### πŸš€ 7. Deployment
197
+ Once the model is evaluated and tuned, it is deployed into production where it can be used by end users. Deployment involves:
198
+ - **Integration** with web applications, chatbots, or other tools.
199
+ - **API Development**: Exposing the model through an API for real-time predictions.
200
+ - **Continuous Monitoring**: Tracking the model’s performance and retraining it as needed.
 
 
 
 
201
 
202
+ **Example**: Deploying a sentiment analysis model in a customer service chatbot that analyzes customer inquiries in real time.
203
+ """)
204
 
205
 
206
  # Content for "NLP Techniques"
 
222
  st.write("""
223
  ### βš™οΈ Techniques in NLP
224
  NLP uses a variety of techniques to process and analyze text data. Some of the most common techniques include:
225
+ ### πŸ› οΈ Common NLP Techniques
226
  1. **Tokenization**: Breaking down text into smaller units (e.g., words, sentences).
227
  2. **Part-of-Speech (POS) Tagging**: Identifying the grammatical roles of words in a sentence (e.g., noun, verb, adjective).
228
  3. **Named Entity Recognition (NER)**: Identifying entities such as names, dates, locations, etc.