Update pages/1_Introduction to NLP.py
Browse files- pages/1_Introduction to NLP.py +119 -0
pages/1_Introduction to NLP.py
CHANGED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Custom CSS for styling, animations, and a light background
|
| 4 |
+
st.markdown(
|
| 5 |
+
"""
|
| 6 |
+
<style>
|
| 7 |
+
body {
|
| 8 |
+
background-color: #f9f9f9; /* Light gray background */
|
| 9 |
+
font-family: 'Arial', sans-serif;
|
| 10 |
+
}
|
| 11 |
+
@keyframes fadeIn {
|
| 12 |
+
0% { opacity: 0; transform: translateY(-20px); }
|
| 13 |
+
100% { opacity: 1; transform: translateY(0); }
|
| 14 |
+
}
|
| 15 |
+
.title {
|
| 16 |
+
text-align: center;
|
| 17 |
+
color: #2c3e50; /* Deep gray-blue */
|
| 18 |
+
font-size: 3rem;
|
| 19 |
+
font-weight: bold;
|
| 20 |
+
animation: fadeIn 1s ease-in-out;
|
| 21 |
+
}
|
| 22 |
+
.caption {
|
| 23 |
+
text-align: center;
|
| 24 |
+
font-style: italic;
|
| 25 |
+
font-size: 1.2rem;
|
| 26 |
+
color: #7f8c8d; /* Soft gray */
|
| 27 |
+
animation: fadeIn 1.5s ease-in-out;
|
| 28 |
+
}
|
| 29 |
+
.section {
|
| 30 |
+
font-size: 1.1rem;
|
| 31 |
+
text-align: justify;
|
| 32 |
+
line-height: 1.8;
|
| 33 |
+
color: #34495e; /* Muted gray */
|
| 34 |
+
background: #ffffff; /* White card-style background */
|
| 35 |
+
padding: 20px;
|
| 36 |
+
border-radius: 10px;
|
| 37 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 38 |
+
animation: fadeIn 2s ease-in-out;
|
| 39 |
+
margin: 10px 0;
|
| 40 |
+
}
|
| 41 |
+
.image-container {
|
| 42 |
+
text-align: center;
|
| 43 |
+
margin: 20px 0;
|
| 44 |
+
animation: fadeIn 2.5s ease-in-out;
|
| 45 |
+
}
|
| 46 |
+
.image-container img {
|
| 47 |
+
border-radius: 15px;
|
| 48 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
| 49 |
+
transition: transform 0.3s ease-in-out;
|
| 50 |
+
}
|
| 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'>Introduction to Natural Language Processing</div>", unsafe_allow_html=True)
|
| 61 |
+
|
| 62 |
+
# Caption with animation
|
| 63 |
+
st.markdown(
|
| 64 |
+
"<div class='caption'>Empowering Machines to Understand and Communicate in Human Language!</div>",
|
| 65 |
+
unsafe_allow_html=True,
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
# Centered Image with hover effect
|
| 69 |
+
st.markdown(
|
| 70 |
+
"""
|
| 71 |
+
<div class='image-container'>
|
| 72 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/66bde9bf3c885d04498227a0/AYjss7I_gYg8OuSg5rqq3.jpeg" alt="NLP Image" width="400">
|
| 73 |
+
</div>
|
| 74 |
+
""",
|
| 75 |
+
unsafe_allow_html=True,
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
# Section 1: What is NLP?
|
| 79 |
+
st.subheader(":blue[What is NLP?]")
|
| 80 |
+
st.markdown(
|
| 81 |
+
'''
|
| 82 |
+
<div class='section'>
|
| 83 |
+
<b>Natural Language Processing (NLP)</b> is a dynamic field of Artificial Intelligence (AI) focused on enabling computers
|
| 84 |
+
to understand, interpret, and generate human language. It bridges the gap between how humans communicate and how machines process information.
|
| 85 |
+
</div>
|
| 86 |
+
''',
|
| 87 |
+
unsafe_allow_html=True,
|
| 88 |
+
)
|
| 89 |
+
st.markdown('''
|
| 90 |
+
- To represent text in numerical and tabular format it is going to use a field known as NLP.
|
| 91 |
+
- It is a sub-field in AI which guides the machine to process and analyze the natural language
|
| 92 |
+
''')
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
# Section 2: Applications of NLP
|
| 96 |
+
st.subheader(":red[Applications of NLP]")
|
| 97 |
+
st.markdown(
|
| 98 |
+
'''
|
| 99 |
+
<div class='section'>
|
| 100 |
+
NLP powers many everyday applications, including:
|
| 101 |
+
<ul>
|
| 102 |
+
<li><b>Chatbots and Virtual Assistants:</b> Enhancing customer support with intelligent responses.</li>
|
| 103 |
+
<li><b>Language Translation:</b> Breaking language barriers with tools like Google Translate.</li>
|
| 104 |
+
<li><b>Sentiment Analysis:</b> Analyzing opinions and emotions in social media and reviews.</li>
|
| 105 |
+
<li><b>Search Engines:</b> Understanding queries to deliver relevant results.</li>
|
| 106 |
+
</ul>
|
| 107 |
+
</div>
|
| 108 |
+
''',
|
| 109 |
+
unsafe_allow_html=True,
|
| 110 |
+
)
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
# Closing note with animation
|
| 114 |
+
st.markdown(
|
| 115 |
+
"""
|
| 116 |
+
<div class='caption'>***Step into the world of NLP and discover the endless possibilities of language-driven innovation!***</div>
|
| 117 |
+
""",
|
| 118 |
+
unsafe_allow_html=True,
|
| 119 |
+
)
|