Spaces:
Sleeping
Sleeping
Update pages/Data Collection.py
Browse files- pages/Data Collection.py +81 -23
pages/Data Collection.py
CHANGED
|
@@ -11,17 +11,17 @@ st.set_page_config(
|
|
| 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)
|
|
@@ -77,8 +77,6 @@ if data_type == "Structured Data":
|
|
| 77 |
st.write("""
|
| 78 |
**Structured data** refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
|
| 79 |
It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
|
| 80 |
-
|
| 81 |
-
This type of data is often used in relational databases and spreadsheets, where relationships between data points are explicitly defined.
|
| 82 |
""")
|
| 83 |
|
| 84 |
st.write("""
|
|
@@ -93,7 +91,6 @@ if data_type == "Structured Data":
|
|
| 93 |
A database of students with fields like ID, name, age, and gender:
|
| 94 |
""")
|
| 95 |
|
| 96 |
-
# Display Structured Data Table
|
| 97 |
student_data = {
|
| 98 |
"Id": [100, 101, 102, 103],
|
| 99 |
"Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
|
|
@@ -102,10 +99,7 @@ if data_type == "Structured Data":
|
|
| 102 |
}
|
| 103 |
df = pd.DataFrame(student_data)
|
| 104 |
st.markdown(df.style.set_table_styles(
|
| 105 |
-
[{
|
| 106 |
-
'selector': 'thead th',
|
| 107 |
-
'props': 'font-weight: bold;'
|
| 108 |
-
}]
|
| 109 |
).hide(axis="index").to_html(), unsafe_allow_html=True)
|
| 110 |
|
| 111 |
st.markdown("""
|
|
@@ -133,8 +127,6 @@ elif data_type == "Unstructured Data":
|
|
| 133 |
st.write("""
|
| 134 |
**Unstructured data** refers to information that does not follow a predefined format or structure.
|
| 135 |
It is typically raw data that lacks a clear, organized schema, making it harder to store and analyze using traditional tools.
|
| 136 |
-
|
| 137 |
-
Examples include multimedia files (images, videos, audio), emails, and social media posts.
|
| 138 |
""")
|
| 139 |
|
| 140 |
st.write("""
|
|
@@ -145,8 +137,7 @@ elif data_type == "Unstructured Data":
|
|
| 145 |
""")
|
| 146 |
|
| 147 |
st.write("""
|
| 148 |
-
**
|
| 149 |
-
Examples of unstructured data include:
|
| 150 |
- **Images**: Photos, screenshots, or scanned documents.
|
| 151 |
- **Audio**: Podcasts, voice recordings, or music files.
|
| 152 |
- **Videos**: Recorded lectures, surveillance footage, or YouTube videos.
|
|
@@ -159,13 +150,80 @@ elif data_type == "Unstructured Data":
|
|
| 159 |
</div>
|
| 160 |
""", unsafe_allow_html=True)
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
st.write("""
|
| 163 |
-
**
|
| 164 |
-
|
| 165 |
-
- **Audio**: Formats like MP3, WAV, and FLAC.
|
| 166 |
-
- **Videos**: Formats like MP4, AVI, and MKV.
|
| 167 |
-
- **Text**: Formats like TXT, LOG, and DOCX.
|
| 168 |
""")
|
| 169 |
|
| 170 |
-
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|
|
|
|
| 77 |
st.write("""
|
| 78 |
**Structured data** refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
|
| 79 |
It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
|
|
|
|
|
|
|
| 80 |
""")
|
| 81 |
|
| 82 |
st.write("""
|
|
|
|
| 91 |
A database of students with fields like ID, name, age, and gender:
|
| 92 |
""")
|
| 93 |
|
|
|
|
| 94 |
student_data = {
|
| 95 |
"Id": [100, 101, 102, 103],
|
| 96 |
"Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
|
|
|
|
| 99 |
}
|
| 100 |
df = pd.DataFrame(student_data)
|
| 101 |
st.markdown(df.style.set_table_styles(
|
| 102 |
+
[{'selector': 'thead th', 'props': 'font-weight: bold;'}]
|
|
|
|
|
|
|
|
|
|
| 103 |
).hide(axis="index").to_html(), unsafe_allow_html=True)
|
| 104 |
|
| 105 |
st.markdown("""
|
|
|
|
| 127 |
st.write("""
|
| 128 |
**Unstructured data** refers to information that does not follow a predefined format or structure.
|
| 129 |
It is typically raw data that lacks a clear, organized schema, making it harder to store and analyze using traditional tools.
|
|
|
|
|
|
|
| 130 |
""")
|
| 131 |
|
| 132 |
st.write("""
|
|
|
|
| 137 |
""")
|
| 138 |
|
| 139 |
st.write("""
|
| 140 |
+
**Examples:**
|
|
|
|
| 141 |
- **Images**: Photos, screenshots, or scanned documents.
|
| 142 |
- **Audio**: Podcasts, voice recordings, or music files.
|
| 143 |
- **Videos**: Recorded lectures, surveillance footage, or YouTube videos.
|
|
|
|
| 150 |
</div>
|
| 151 |
""", unsafe_allow_html=True)
|
| 152 |
|
| 153 |
+
if st.button("Explore Unstructured Data"):
|
| 154 |
+
st.write("Select a format to explore:")
|
| 155 |
+
|
| 156 |
+
# Sub-buttons for specific formats
|
| 157 |
+
col1, col2, col3, col4 = st.columns(4)
|
| 158 |
+
|
| 159 |
+
with col1:
|
| 160 |
+
if st.button("Images"):
|
| 161 |
+
st.write("Redirecting to Images page...")
|
| 162 |
+
|
| 163 |
+
with col2:
|
| 164 |
+
if st.button("Audio"):
|
| 165 |
+
st.write("Redirecting to Audio page...")
|
| 166 |
+
|
| 167 |
+
with col3:
|
| 168 |
+
if st.button("Video"):
|
| 169 |
+
st.write("Redirecting to Video page...")
|
| 170 |
+
|
| 171 |
+
with col4:
|
| 172 |
+
if st.button("Text"):
|
| 173 |
+
st.write("Redirecting to Text page...")
|
| 174 |
+
|
| 175 |
+
# Semi-Structured Data Section
|
| 176 |
+
elif data_type == "Semi-Structured Data":
|
| 177 |
+
st.markdown("""
|
| 178 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 179 |
+
<h3 style="color: #e25822;">What is Semi-Structured Data?</h3>
|
| 180 |
+
</div>
|
| 181 |
+
""", unsafe_allow_html=True)
|
| 182 |
+
|
| 183 |
st.write("""
|
| 184 |
+
**Semi-Structured data** refers to information that does not follow a strict tabular format but contains tags or markers to separate data elements.
|
| 185 |
+
This type of data is more flexible than structured data but still organized enough to allow for easier analysis than unstructured data.
|
|
|
|
|
|
|
|
|
|
| 186 |
""")
|
| 187 |
|
| 188 |
+
st.write("""
|
| 189 |
+
**Characteristics:**
|
| 190 |
+
- Contains markers or tags (e.g., XML, JSON keys) to provide structure.
|
| 191 |
+
- More flexible than structured data, allowing for varying schemas.
|
| 192 |
+
- Easier to process than unstructured data.
|
| 193 |
+
""")
|
| 194 |
+
|
| 195 |
+
st.write("""
|
| 196 |
+
**Examples:**
|
| 197 |
+
- **CSV**: Comma-separated values in plain-text files.
|
| 198 |
+
- **JSON**: A lightweight data-interchange format used in web applications.
|
| 199 |
+
- **XML**: Extensible Markup Language for structured document encoding.
|
| 200 |
+
- **HTML**: Markup language for web pages.
|
| 201 |
+
""")
|
| 202 |
+
|
| 203 |
+
st.markdown("""
|
| 204 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 205 |
+
<h4 style="color: #5b2c6f;">Data Formats in Semi-Structured Data:</h4>
|
| 206 |
+
</div>
|
| 207 |
+
""", unsafe_allow_html=True)
|
| 208 |
+
|
| 209 |
+
if st.button("Explore Semi-Structured Data"):
|
| 210 |
+
st.write("Select a format to explore:")
|
| 211 |
+
|
| 212 |
+
# Sub-buttons for specific formats
|
| 213 |
+
col1, col2, col3, col4 = st.columns(4)
|
| 214 |
+
|
| 215 |
+
with col1:
|
| 216 |
+
if st.button("CSV"):
|
| 217 |
+
st.write("Redirecting to CSV page...")
|
| 218 |
+
|
| 219 |
+
with col2:
|
| 220 |
+
if st.button("JSON"):
|
| 221 |
+
st.write("Redirecting to JSON page...")
|
| 222 |
+
|
| 223 |
+
with col3:
|
| 224 |
+
if st.button("XML"):
|
| 225 |
+
st.write("Redirecting to XML page...")
|
| 226 |
+
|
| 227 |
+
with col4:
|
| 228 |
+
if st.button("HTML"):
|
| 229 |
+
st.write("Redirecting to HTML page...")
|