yash-gupta-01 commited on
Commit
c9b360a
Β·
verified Β·
1 Parent(s): 42ea9cb

Create introduction_page.py

Browse files
Files changed (1) hide show
  1. pages/introduction_page.py +153 -0
pages/introduction_page.py ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_lottie import st_lottie
3
+ import requests
4
+
5
+ # Function to load Lottie animations
6
+ def load_lottie_url(url: str):
7
+ r = requests.get(url)
8
+ if r.status_code == 200:
9
+ return r.json()
10
+ else:
11
+ return None
12
+
13
+ # Function to display the content of each page
14
+ def show_content(topic):
15
+ if topic == "Introduction":
16
+ st.title("Understanding Data Science and Artificial Intelligence 🌟")
17
+ st.subheader("Overview of AI and Data Science")
18
+ st.write("""
19
+ Artificial Intelligence (AI) and Data Science have become buzzwords in today's tech-driven world.
20
+ But what do they really mean, and why are they so significant? Let’s explore these fascinating concepts step by step!
21
+ """)
22
+
23
+ # Load the Lottie animation
24
+ lottie_url = "https://assets4.lottiefiles.com/packages/lf20_tcbkqj.json"
25
+ animation_data = load_lottie_url(lottie_url)
26
+ if animation_data:
27
+ st_lottie(animation_data, speed=1, width=600, height=400)
28
+ else:
29
+ st.write("Unable to load animation.")
30
+
31
+ elif topic == "Understanding Intelligence":
32
+ st.title("Understanding Intelligence")
33
+ st.subheader("What is Natural Intelligence? 🐾")
34
+ st.write("""
35
+ **Definition**: NI refers to the intelligence naturally present in living beings.
36
+ **Examples**:
37
+ - A dog learning a trick. πŸ•
38
+ - Humans solving puzzles or making everyday decisions. 🧠
39
+ """)
40
+ st.subheader("What is Artificial Intelligence? πŸ€–")
41
+ st.write("""
42
+ **Definition**: Artificial intelligence (AI) is man-made intelligence where machines mimic human intelligence to perform tasks.
43
+ **Real-Life Examples**:
44
+ - Netflix recommending shows you’d love. 🎬
45
+ - Google Maps finding the fastest route. πŸ—ΊοΈ
46
+ - Alexa answering your questions. πŸŽ™οΈ
47
+ """)
48
+
49
+ elif topic == "AI Tools: ML, DL, and Gen-AI":
50
+ st.title("AI Tools: ML, DL, and Gen-AI")
51
+ st.subheader("Machine Learning (ML) πŸ–₯️")
52
+ st.write("""
53
+ - **What It Does**: ML enables machines to learn from patterns in data and make decisions.
54
+ - **How It Works**: Similar to teaching a toddler to recognize fruits, ML algorithms process large datasets to "learn" and predict outcomes.
55
+ - **Real-Life Applications**: Spam email detection πŸ“§, Predicting stock prices πŸ“ˆ.
56
+ """)
57
+ st.subheader("Deep Learning (DL) 🀿")
58
+ st.write("""
59
+ - **What It Does**: DL uses neural networks to process and analyze complex data.
60
+ - **How It Works**: DL processes data in layers, enabling machines to perform sophisticated tasks like facial recognition and medical imaging.
61
+ - **Real-Life Applications**: Self-driving cars πŸš—, Virtual assistants like Siri and Alexa. πŸŽ™οΈ
62
+ """)
63
+ st.subheader("Generative AI (Gen-AI) 🎨")
64
+ st.write("""
65
+ - **What It Does**: Gen-AI enables machines to generate new content like text, images, and music.
66
+ - **How It Works**: By learning patterns from data, Gen-AI creates outputs that feel original and human-like.
67
+ - **Real-Life Applications**: ChatGPT (text generation), DALLΒ·E (image creation).
68
+ """)
69
+
70
+ elif topic == "Real-Life Analogies and Examples":
71
+ st.title("Real-Life Analogies and Examples")
72
+ st.subheader("Analogy: Tools Are Like Pens and Pencils")
73
+ st.write("""
74
+ - ML: Learns patterns (like sketching with a pencil).
75
+ - DL: Adds depth and detail (like using a pen).
76
+ - Gen-AI: Creates entirely new outputs (like turning sketches into colorful artwork).
77
+ """)
78
+ st.subheader("Learning vs. Generating: The Art Example πŸ‘©β€πŸŽ¨")
79
+ st.write("""
80
+ Think of a child learning to draw:
81
+ - First, they learn the basics of drawing.
82
+ - Then they generate their own unique artwork.
83
+
84
+ AI follows the same process:
85
+ - Learning: ML and DL handle this part.
86
+ - Generating: Gen-AI takes over to create new outputs.
87
+ """)
88
+
89
+ elif topic == "What is Data Science?":
90
+ st.title("What is Data Science? πŸ“Š")
91
+ st.write("""
92
+ Data Science is the art of extracting meaningful insights from raw data. It combines AI with statistics, computer science, and domain expertise to solve real-world problems.
93
+ **Key Components of Data Science**:
94
+ - **Data Collection**: Gathering information from various sources.
95
+ - **Data Analysis**: Using tools to find patterns and trends.
96
+ - **Data Visualization**: Presenting findings through charts and graphs.
97
+ """)
98
+
99
+ elif topic == "The Role of a Data Scientist":
100
+ st.title("The Role of a Data Scientist")
101
+ st.write("""
102
+ A Data Scientist plays a crucial role in:
103
+ - Building predictive models.
104
+ - Analyzing customer behavior.
105
+ - Designing solutions for business challenges.
106
+
107
+ **Tools Used**: Python, R, SQL, Tableau, etc.
108
+ """)
109
+
110
+ elif topic == "Why AI and Data Science Matter":
111
+ st.title("Why AI and Data Science Matter")
112
+ st.write("""
113
+ AI and Data Science are transforming industries by:
114
+ - Automating tasks.
115
+ - Enhancing decision-making.
116
+ - Unlocking creative possibilities.
117
+
118
+ **Fun Fact**: By 2030, AI is expected to add $15.7 trillion to the global economy. πŸš€
119
+ """)
120
+
121
+ elif topic == "Did You Know?":
122
+ st.title("Did You Know?")
123
+ st.write("""
124
+ **AI is already being used to**:
125
+ - Detect diseases in medical imaging.
126
+ - Automate farming for higher crop yields.
127
+ - Generate movie scripts and music albums.
128
+ """)
129
+
130
+ # Set up sidebar navigation
131
+ topics = [
132
+ "Introduction",
133
+ "Understanding Intelligence",
134
+ "AI Tools: ML, DL, and Gen-AI",
135
+ "Real-Life Analogies and Examples",
136
+ "What is Data Science?",
137
+ "The Role of a Data Scientist",
138
+ "Why AI and Data Science Matter",
139
+ "Did You Know?"
140
+ ]
141
+
142
+ st.sidebar.title("Topics")
143
+ selection = st.sidebar.radio("Go to", topics)
144
+
145
+ # Initialize session state with the first topic as the default
146
+ if "page" not in st.session_state:
147
+ st.session_state.page = topics[0]
148
+
149
+ # Update session state automatically when sidebar selection changes
150
+ st.session_state.page = selection
151
+
152
+ # Display the selected content
153
+ show_content(st.session_state.page)