Spaces:
Sleeping
Sleeping
Update pages/Data Collection.py
Browse files- pages/Data Collection.py +72 -130
pages/Data Collection.py
CHANGED
|
@@ -6,39 +6,26 @@ st.set_page_config(
|
|
| 6 |
page_icon="🚀",
|
| 7 |
layout="wide"
|
| 8 |
)
|
| 9 |
-
|
|
|
|
| 10 |
st.markdown("""
|
| 11 |
<style>
|
| 12 |
body, .stApp {
|
| 13 |
-
color: #4F4F4F;
|
| 14 |
-
background-color: #FFFFFF;
|
| 15 |
}
|
| 16 |
h1, h2, h3, h4, h5, h6 {
|
| 17 |
-
color: #BB3385;
|
| 18 |
}
|
| 19 |
p {
|
| 20 |
-
color: #4F4F4F;
|
| 21 |
}
|
| 22 |
ul li {
|
| 23 |
-
color: #4F4F4F;
|
| 24 |
}
|
| 25 |
</style>
|
| 26 |
""", unsafe_allow_html=True)
|
| 27 |
|
| 28 |
-
st.markdown(
|
| 29 |
-
"""
|
| 30 |
-
<style>
|
| 31 |
-
.stApp {
|
| 32 |
-
background-image: url("https://huggingface.co/spaces/LakshmiHarika/MachineLearning/resolve/main/DALL%C2%B7E%202024-12-03%2023.34.47%20-%20A%20simple%20and%20elegant%20background%20image%20for%20an%20AI-themed%20web%20application.%20The%20background%20should%20feature%20a%20soft%20gradient%20transitioning%20from%20white%20to%20ligh.webp");
|
| 33 |
-
background-size: cover;
|
| 34 |
-
background-repeat: no-repeat;
|
| 35 |
-
background-attachment: fixed;
|
| 36 |
-
}
|
| 37 |
-
</style>
|
| 38 |
-
""",
|
| 39 |
-
unsafe_allow_html=True
|
| 40 |
-
)
|
| 41 |
-
|
| 42 |
# Page Title
|
| 43 |
st.markdown("""
|
| 44 |
<div style="text-align: left; margin-top: 20px;">
|
|
@@ -48,8 +35,7 @@ st.markdown("""
|
|
| 48 |
|
| 49 |
# Introduction Text
|
| 50 |
st.write("""
|
| 51 |
-
**Data**
|
| 52 |
-
It refers to raw facts, figures, and observations that can be collected, stored, and processed.
|
| 53 |
It has no meaning on its own until it is organized or analyzed to derive useful information.
|
| 54 |
""")
|
| 55 |
|
|
@@ -74,39 +60,26 @@ if data_type == "Structured Data":
|
|
| 74 |
</div>
|
| 75 |
""", unsafe_allow_html=True)
|
| 76 |
|
| 77 |
-
st.markdown("""
|
| 78 |
-
<div style="text-align: left; margin-top: 20px;">
|
| 79 |
-
<h4 style="color: #5b2c6f;">Definition:</h4>
|
| 80 |
-
</div>
|
| 81 |
-
""", unsafe_allow_html=True)
|
| 82 |
st.write("""
|
| 83 |
-
Structured data refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
|
| 84 |
It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
|
| 85 |
|
| 86 |
This type of data is often used in relational databases and spreadsheets, where relationships between data points are explicitly defined.
|
| 87 |
""")
|
| 88 |
|
| 89 |
-
st.markdown("""
|
| 90 |
-
<div style="text-align: left; margin-top: 20px;">
|
| 91 |
-
<h4 style="color: #5b2c6f;">Characteristics:</h4>
|
| 92 |
-
</div>
|
| 93 |
-
""", unsafe_allow_html=True)
|
| 94 |
st.write("""
|
|
|
|
| 95 |
- Follows a fixed schema.
|
| 96 |
- Can be easily searched using query languages like SQL.
|
| 97 |
- Suitable for quantitative analysis.
|
| 98 |
""")
|
| 99 |
|
| 100 |
-
st.markdown("""
|
| 101 |
-
<div style="text-align: left; margin-top: 20px;">
|
| 102 |
-
<h4 style="color: #5b2c6f;">Example:</h4>
|
| 103 |
-
</div>
|
| 104 |
-
""", unsafe_allow_html=True)
|
| 105 |
st.write("""
|
|
|
|
| 106 |
A database of students with fields like ID, name, age, and gender:
|
| 107 |
""")
|
| 108 |
|
| 109 |
-
#
|
| 110 |
student_data = {
|
| 111 |
"Id": [100, 101, 102, 103],
|
| 112 |
"Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
|
|
@@ -114,107 +87,76 @@ if data_type == "Structured Data":
|
|
| 114 |
"Gender": ["Female", "Female", "Male", "Female"]
|
| 115 |
}
|
| 116 |
df = pd.DataFrame(student_data)
|
| 117 |
-
st.
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
st.markdown("""
|
| 126 |
<div style="text-align: left; margin-top: 20px;">
|
| 127 |
-
<
|
| 128 |
</div>
|
| 129 |
""", unsafe_allow_html=True)
|
| 130 |
-
|
| 131 |
st.write("""
|
| 132 |
-
|
| 133 |
-
|
| 134 |
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
- Does not follow a specific schema or structure.
|
| 170 |
-
- Cannot be stored in traditional tabular formats like rows and columns.
|
| 171 |
-
- Requires advanced tools like machine learning or natural language processing (NLP) for analysis.
|
| 172 |
-
""")
|
| 173 |
-
|
| 174 |
-
st.markdown("""
|
| 175 |
-
<div style="text-align: left; margin-top: 20px;">
|
| 176 |
-
<h4 style="color: #5b2c6f;">Example:</h4>
|
| 177 |
-
</div>
|
| 178 |
-
""", unsafe_allow_html=True)
|
| 179 |
-
st.write("""
|
| 180 |
-
Examples of unstructured data include:
|
| 181 |
-
- **Images**: Photos, screenshots, or scanned documents.
|
| 182 |
-
- **Audio**: Podcasts, voice recordings, or music files.
|
| 183 |
-
- **Videos**: Recorded lectures, surveillance footage, or YouTube videos.
|
| 184 |
-
- **Text**: Emails, social media posts, and blog articles.
|
| 185 |
-
""")
|
| 186 |
-
|
| 187 |
-
# Transition to Formats in Unstructured Data
|
| 188 |
-
st.markdown("""
|
| 189 |
-
<div style="text-align: left; margin-top: 20px;">
|
| 190 |
-
<h4 style="color: #5b2c6f;">Data Formats in Unstructured Data:</h4>
|
| 191 |
-
</div>
|
| 192 |
-
""", unsafe_allow_html=True)
|
| 193 |
-
|
| 194 |
-
st.write("""
|
| 195 |
-
Unstructured data can exist in various formats, often requiring specialized tools for processing. Common formats include:
|
| 196 |
-
|
| 197 |
-
- **Images**: Formats like JPEG, PNG, BMP, and TIFF.
|
| 198 |
-
- **Audio**: Formats like MP3, WAV, and FLAC.
|
| 199 |
-
- **Videos**: Formats like MP4, AVI, and MKV.
|
| 200 |
-
- **Text**: Formats like TXT, LOG, and DOCX.
|
| 201 |
-
""")
|
| 202 |
-
|
| 203 |
-
# Add a button to navigate to specific formats
|
| 204 |
-
if st.button("Explore Unstructured Data"):
|
| 205 |
-
# Display buttons for each format
|
| 206 |
-
st.write("Select a format to explore:")
|
| 207 |
-
|
| 208 |
if st.button("Images"):
|
| 209 |
-
st.write("Images are
|
| 210 |
-
|
|
|
|
| 211 |
if st.button("Audio"):
|
| 212 |
st.write("Audio files represent sound data. Common formats: MP3, WAV.")
|
| 213 |
-
|
|
|
|
| 214 |
if st.button("Video"):
|
| 215 |
st.write("Video files combine visual and audio data. Common formats: MP4, AVI.")
|
| 216 |
-
|
|
|
|
| 217 |
if st.button("Text"):
|
| 218 |
st.write("Text data includes raw documents like emails or logs. Common formats: TXT, DOCX.")
|
| 219 |
-
|
| 220 |
-
|
|
|
|
| 6 |
page_icon="🚀",
|
| 7 |
layout="wide"
|
| 8 |
)
|
| 9 |
+
|
| 10 |
+
# Global CSS for consistent styling
|
| 11 |
st.markdown("""
|
| 12 |
<style>
|
| 13 |
body, .stApp {
|
| 14 |
+
color: #4F4F4F;
|
| 15 |
+
background-color: #FFFFFF;
|
| 16 |
}
|
| 17 |
h1, h2, h3, h4, h5, h6 {
|
| 18 |
+
color: #BB3385;
|
| 19 |
}
|
| 20 |
p {
|
| 21 |
+
color: #4F4F4F;
|
| 22 |
}
|
| 23 |
ul li {
|
| 24 |
+
color: #4F4F4F;
|
| 25 |
}
|
| 26 |
</style>
|
| 27 |
""", unsafe_allow_html=True)
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# Page Title
|
| 30 |
st.markdown("""
|
| 31 |
<div style="text-align: left; margin-top: 20px;">
|
|
|
|
| 35 |
|
| 36 |
# Introduction Text
|
| 37 |
st.write("""
|
| 38 |
+
**Data** refers to raw facts, figures, and observations that can be collected, stored, and processed.
|
|
|
|
| 39 |
It has no meaning on its own until it is organized or analyzed to derive useful information.
|
| 40 |
""")
|
| 41 |
|
|
|
|
| 60 |
</div>
|
| 61 |
""", unsafe_allow_html=True)
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
st.write("""
|
| 64 |
+
**Structured data** refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
|
| 65 |
It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
|
| 66 |
|
| 67 |
This type of data is often used in relational databases and spreadsheets, where relationships between data points are explicitly defined.
|
| 68 |
""")
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
st.write("""
|
| 71 |
+
**Characteristics:**
|
| 72 |
- Follows a fixed schema.
|
| 73 |
- Can be easily searched using query languages like SQL.
|
| 74 |
- Suitable for quantitative analysis.
|
| 75 |
""")
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
st.write("""
|
| 78 |
+
**Example:**
|
| 79 |
A database of students with fields like ID, name, age, and gender:
|
| 80 |
""")
|
| 81 |
|
| 82 |
+
# Display Structured Data Table
|
| 83 |
student_data = {
|
| 84 |
"Id": [100, 101, 102, 103],
|
| 85 |
"Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
|
|
|
|
| 87 |
"Gender": ["Female", "Female", "Male", "Female"]
|
| 88 |
}
|
| 89 |
df = pd.DataFrame(student_data)
|
| 90 |
+
st.dataframe(df)
|
| 91 |
+
|
| 92 |
+
# Data Formats in Structured Data
|
| 93 |
+
st.write("""
|
| 94 |
+
**Data Formats in Structured Data:**
|
| 95 |
+
- **Excel**: Widely used for tabular data, calculations, and data visualization.
|
| 96 |
+
""")
|
| 97 |
+
|
| 98 |
+
# Button to Explore Excel
|
| 99 |
+
if st.button("Explore Excel"):
|
| 100 |
+
st.write("Redirecting to Excel page...")
|
| 101 |
+
# Add functionality to redirect or display additional details here
|
| 102 |
+
|
| 103 |
+
# Unstructured Data Section
|
| 104 |
+
elif data_type == "Unstructured Data":
|
| 105 |
st.markdown("""
|
| 106 |
<div style="text-align: left; margin-top: 20px;">
|
| 107 |
+
<h3 style="color: #e25822;">What is Unstructured Data?</h3>
|
| 108 |
</div>
|
| 109 |
""", unsafe_allow_html=True)
|
| 110 |
+
|
| 111 |
st.write("""
|
| 112 |
+
**Unstructured data** refers to information that does not follow a predefined format or structure.
|
| 113 |
+
It is typically raw data that lacks a clear, organized schema, making it harder to store and analyze using traditional tools.
|
| 114 |
|
| 115 |
+
Examples include multimedia files (images, videos, audio), emails, and social media posts.
|
| 116 |
+
""")
|
| 117 |
+
|
| 118 |
+
st.write("""
|
| 119 |
+
**Characteristics:**
|
| 120 |
+
- Does not follow a specific schema or structure.
|
| 121 |
+
- Cannot be stored in traditional tabular formats like rows and columns.
|
| 122 |
+
- Requires advanced tools like machine learning or natural language processing (NLP) for analysis.
|
| 123 |
+
""")
|
| 124 |
+
|
| 125 |
+
st.write("""
|
| 126 |
+
**Example:**
|
| 127 |
+
Examples of unstructured data include:
|
| 128 |
+
- **Images**: Photos, screenshots, or scanned documents.
|
| 129 |
+
- **Audio**: Podcasts, voice recordings, or music files.
|
| 130 |
+
- **Videos**: Recorded lectures, surveillance footage, or YouTube videos.
|
| 131 |
+
- **Text**: Emails, social media posts, and blog articles.
|
| 132 |
+
""")
|
| 133 |
+
|
| 134 |
+
# Data Formats in Unstructured Data
|
| 135 |
+
st.write("""
|
| 136 |
+
**Data Formats in Unstructured Data:**
|
| 137 |
+
- **Images**: Formats like JPEG, PNG, BMP, and TIFF.
|
| 138 |
+
- **Audio**: Formats like MP3, WAV, and FLAC.
|
| 139 |
+
- **Videos**: Formats like MP4, AVI, and MKV.
|
| 140 |
+
- **Text**: Formats like TXT, LOG, and DOCX.
|
| 141 |
+
""")
|
| 142 |
+
|
| 143 |
+
# Explore Formats
|
| 144 |
+
if st.button("Explore Unstructured Data"):
|
| 145 |
+
st.write("Select a format to explore:")
|
| 146 |
+
col1, col2, col3, col4 = st.columns(4)
|
| 147 |
+
|
| 148 |
+
with col1:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
if st.button("Images"):
|
| 150 |
+
st.write("Images are often used in computer vision tasks. Common formats: JPEG, PNG.")
|
| 151 |
+
|
| 152 |
+
with col2:
|
| 153 |
if st.button("Audio"):
|
| 154 |
st.write("Audio files represent sound data. Common formats: MP3, WAV.")
|
| 155 |
+
|
| 156 |
+
with col3:
|
| 157 |
if st.button("Video"):
|
| 158 |
st.write("Video files combine visual and audio data. Common formats: MP4, AVI.")
|
| 159 |
+
|
| 160 |
+
with col4:
|
| 161 |
if st.button("Text"):
|
| 162 |
st.write("Text data includes raw documents like emails or logs. Common formats: TXT, DOCX.")
|
|
|
|
|
|