NLP_Blog / app.py
Mpavan45's picture
Update app.py
41de2ac verified
raw
history blame
2.54 kB
import streamlit as st
# App title
st.title("NLP Theory Blog")
# Sidebar for navigation
st.sidebar.title("Navigation")
pages = ["Introduction to NLP", "NLP Techniques"]
page = st.sidebar.radio("Go to:", pages)
# Content for each page
if page == "Introduction to NLP":
st.header("What is Natural Language Processing (NLP)?")
st.write("""
Natural Language Processing (NLP) is a field of Artificial Intelligence that focuses on the interaction between computers and humans through natural language.
It enables machines to understand, interpret, and respond to human language in a meaningful way.
**Applications of NLP include:**
- Sentiment Analysis
- Machine Translation
- Chatbots
- Speech Recognition
NLP combines computational linguistics with machine learning and deep learning techniques to process language.
""")
elif page == "NLP Techniques":
st.header("Common NLP Techniques")
st.write("""
NLP involves several techniques for processing and analyzing text and speech data. Here are some key techniques:
1. **Tokenization:** Breaking text into smaller units like words or sentences.
2. **Stopword Removal:** Eliminating common words (e.g., 'the', 'is') that may not contribute to meaning.
3. **Stemming and Lemmatization:** Reducing words to their base or root form.
4. **Part-of-Speech (POS) Tagging:** Identifying grammatical parts of speech in a text.
5. **Named Entity Recognition (NER):** Extracting named entities like people, organizations, and locations.
6. **Sentiment Analysis:** Determining the sentiment (positive, negative, neutral) of a text.
7. **Text Summarization:** Producing a summary of a longer text.
8. **Machine Translation:** Translating text from one language to another.
These techniques are often used in combination to build sophisticated NLP applications.
""")
# Pagination buttons
if st.button("Previous Page"):
if page == "NLP Techniques":
st.experimental_set_query_params(page="Introduction to NLP")
if st.button("Next Page"):
if page == "Introduction to NLP":
st.experimental_set_query_params(page="NLP Techniques")
# Handle query params to set the active page
query_params = st.experimental_get_query_params()
if "page" in query_params and query_params["page"]:
page = query_params["page"][0]
# Footer
st.sidebar.write("---")
st.sidebar.write("Developed with ❤️ using Streamlit.")