Phani1008/Machine_Learning
0
1import streamlit as st2from streamlit_lottie import st_lottie3import requests4 5# Function to load Lottie animations6def load_lottieurl(url: str):7 try:8 r = requests.get(url)9 r.raise_for_status() # Will raise an exception for 4xx/5xx errors10 return r.json()11 except requests.exceptions.RequestException as e:12 # Log the error if the URL is not accessible or if there is any issue13 st.error(f"Error loading Lottie animation from {url}: {e}")14 return None15 16# Load animations17robot_animation = load_lottieurl("https://lottie.host/45619748-3867-4f57-8f50-cac297eca2da/1q98CFxp2I.json")18hero_animation = load_lottieurl("https://assets9.lottiefiles.com/packages/lf20_touohxv0.json")19data_science_animation = load_lottieurl("https://assets9.lottiefiles.com/packages/lf20_jcikwtux.json")20ml_animation = load_lottieurl("https://lottie.host/e4bb50e7-3033-4642-b51b-05b703d86236/yje0T0dWeq.json") # New URL for ML animation21 22dl_animation = load_lottieurl("https://assets10.lottiefiles.com/packages/lf20_kuhijlvx.json")23gen_ai_animation = load_lottieurl("https://assets4.lottiefiles.com/packages/lf20_x62chJ.json")24 25# Home Page26st.title("Zero to Hero in Machine Learning ๐")27if hero_animation: # Only show if the animation was successfully loaded28 st_lottie(hero_animation, height=300, key="hero")29 30st.header("About the Author ๐")31if robot_animation:32 st_lottie(robot_animation, height=300, key="robot")33 34st.write("""35Hi, I'm Phaneendra Bharadwaj, an aspiring data scientist and machine learning enthusiast. 36Here's a bit about me:37- **Skills:** Python, Exploratory Data Analysis, Machine Learning, Deep Learning, Generative AI.38- **Experience:** I'm a Fresher, working on various ML related projects.39""")40st.markdown(41 """42 <div style="position: fixed; top: 20px; right: 20px; display: flex; align-items: center;">43 <div style="font-size:30px; color:#f39c12; font-weight:bold; animation: textAnimation 2s ease-in-out infinite; margin-right: 20px;">44 Hey User! Are you Ready??45 </div>46 <div>47 <!-- Lottie animation -->48 <div style="width: 100px; height: 100px;">49 <script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.10/lottie.min.js"></script>50 <div id="lottie"></div>51 <script>52 var animation = bodymovin.loadAnimation({53 container: document.getElementById('lottie'),54 renderer: 'svg',55 loop: true,56 autoplay: true,57 path: 'https://lottie.host/45619748-3867-4f57-8f50-cac297eca2da/1q98CFxp2I.json'58 });59 </script>60 </div>61 </div>62 </div>63 <style>64 @keyframes textAnimation {65 0% { color: #f39c12; transform: scale(1.1); }66 50% { color: #e74c3c; transform: scale(1.2); }67 100% { color: #f39c12; transform: scale(1.1); }68 }69 </style>70 """,71 unsafe_allow_html=True72)73 74# Sections75st.subheader("๐ Data Science")76if data_science_animation:77 st_lottie(data_science_animation, height=200, key="data_science")78st.write("""79Data Science involves extracting insights from data using statistical techniques.80**Example:** Predicting sales based on historical data.81""")82 83st.subheader("๐ค Machine Learning")84if ml_animation:85 st_lottie(ml_animation, height=200, key="machine_learning")86st.write("""87Machine Learning is a tool used to learn the data from Natural Intelligence,it is a tool used to mimic/copy Natural Intelligence.This uses statistical concepts to mimic /copy learning ability.88**Example:** Spam email detection.89""")90 91st.subheader("๐ง Deep Learning")92if dl_animation:93 st_lottie(dl_animation, height=200, key="deep_learning")94st.write("""95Deep Learning is a subset of Machine Learning that uses neural networks.It is also a tool used to learn the data from Natural Intelligence.96**Example:** Image recognition, like identifying cats in pictures.97""")98 99st.subheader("โจ Generative AI")100if gen_ai_animation:101 st_lottie(gen_ai_animation, height=200, key="gen_ai")102st.write("""103Generative AI creates new content by learning from existing data which we've learn't by using ML,DL from Natural Intelligence.104**Example:** ChatGPT for generating human-like text responses.105""")106 107# Footer with animation108st.write("---")109st.markdown("**Let's embark and dive deep on this journey from Zero to Hero! ๐**")