mahika123 commited on
Commit
d847ba5
·
verified ·
1 Parent(s): e6515f1
Files changed (1) hide show
  1. app.py +19 -352
app.py CHANGED
@@ -87,356 +87,23 @@ def show_info(topic):
87
 
88
  # Resources Page Info - UPDATED
89
  def resource_block(career):
90
- resources = {
91
- "AI/Machine Learning Engineer": {
92
- "links": [
93
- ("Neural Networks – DeepLearning.AI", "https://www.deeplearning.ai"),
94
- ("Build ML Models – Fast.ai", "https://www.fast.ai"),
95
- ("Machine Learning – Stanford CS229", "https://cs229.stanford.edu/")
96
- ],
97
- "college": {
98
- "major": "Computer Science, Data Science",
99
- "classes": [
100
- "CS50: Introduction to Computer Science (Harvard)",
101
- "Linear Algebra",
102
- "Probability and Statistics",
103
- "Machine Learning (Stanford CS229)",
104
- "Algorithms"
105
- ]
106
- }
107
- },
108
- "Data Scientist": {
109
- "links": [
110
- ("Python & Pandas – Kaggle Learn", "https://www.kaggle.com/learn"),
111
- ("R Programming – Harvard Data Science", "https://online-learning.harvard.edu/series/data-science"),
112
- ("Project Practice – DataCamp", "https://www.datacamp.com")
113
- ],
114
- "college": {
115
- "major": "Data Science, Statistics, Computer Science",
116
- "classes": [
117
- "Introduction to Data Science",
118
- "Statistics and Probability",
119
- "Data Mining",
120
- "Machine Learning",
121
- "Database Systems"
122
- ]
123
- }
124
- },
125
- "Cloud Solutions Architect": {
126
- "links": [
127
- ("AWS Skills – AWS Training", "https://aws.amazon.com/training/"),
128
- ("Azure Certifications – Microsoft Learn", "https://learn.microsoft.com/en-us/certifications/"),
129
- ("Google Cloud Labs – Google Cloud Boost", "https://cloudskillsboost.google/")
130
- ],
131
- "college": {
132
- "major": "Computer Science, Information Technology",
133
- "classes": [
134
- "Cloud Computing Fundamentals",
135
- "Computer Networks",
136
- "Systems Design",
137
- "Information Security",
138
- "Operating Systems"
139
- ]
140
- }
141
- },
142
- "Cybersecurity Analyst": {
143
- "links": [
144
- ("Network Security – Cybrary", "https://www.cybrary.it"),
145
- ("Threat Intelligence – MITRE ATT&CK", "https://attack.mitre.org/"),
146
- ("Ethical Hacking – TryHackMe", "https://tryhackme.com")
147
- ],
148
- "college": {
149
- "major": "Cybersecurity, Computer Science, Information Security",
150
- "classes": [
151
- "Network Security",
152
- "Cryptography",
153
- "Ethical Hacking",
154
- "Operating Systems",
155
- "Incident Response"
156
- ]
157
- }
158
- },
159
- "Statistician": {
160
- "links": [
161
- ("Intro to Statistics – Coursera (R)", "https://www.coursera.org/specializations/statistics"),
162
- ("Probability – Khan Academy", "https://www.khanacademy.org/math/statistics-probability"),
163
- ("Statistical Tools – OpenIntro", "https://www.openintro.org/book/os/")
164
- ],
165
- "college": {
166
- "major": "Statistics, Mathematics",
167
- "classes": [
168
- "Probability Theory",
169
- "Statistical Inference",
170
- "Regression Analysis",
171
- "Experimental Design",
172
- "Data Analysis with R"
173
- ]
174
- }
175
- },
176
- "Biomedical Engineer": {
177
- "links": [
178
- ("Biomedical Research – JHU BME", "https://www.bme.jhu.edu/"),
179
- ("Medical Devices – edX Courses", "https://www.edx.org/learn/biomedical-engineering"),
180
- ("Clinical Trials – NIH", "https://www.nih.gov/")
181
- ],
182
- "college": {
183
- "major": "Biomedical Engineering, Bioengineering",
184
- "classes": [
185
- "Biomaterials",
186
- "Human Physiology",
187
- "Medical Instrumentation",
188
- "Biomechanics",
189
- "Tissue Engineering"
190
- ]
191
- }
192
- },
193
- "Mechanical Engineer": {
194
- "links": [
195
- ("CAD Design – Coursera", "https://www.coursera.org/learn/cad-design"),
196
- ("Thermodynamics – MIT OpenCourseWare", "https://ocw.mit.edu/courses/thermodynamics"),
197
- ("Materials Science Basics – edX", "https://www.edx.org/course/material-science")
198
- ],
199
- "college": {
200
- "major": "Mechanical Engineering",
201
- "classes": [
202
- "Thermodynamics",
203
- "Fluid Mechanics",
204
- "Materials Science",
205
- "Computer-Aided Design (CAD)",
206
- "Dynamics and Control"
207
- ]
208
- }
209
- },
210
- "Environmental Scientist": {
211
- "links": [
212
- ("Environmental Science – Khan Academy", "https://www.khanacademy.org/science/biology/ecology"),
213
- ("GIS Basics – Esri Training", "https://www.esri.com/training/catalog/57630435851d31e02a43f1c5/gis-basics/"),
214
- ("Data Analysis – Coursera", "https://www.coursera.org/learn/data-analysis")
215
- ],
216
- "college": {
217
- "major": "Environmental Science, Ecology",
218
- "classes": [
219
- "Ecology",
220
- "Environmental Chemistry",
221
- "Geographic Information Systems (GIS)",
222
- "Data Analysis",
223
- "Environmental Policy"
224
- ]
225
- }
226
- },
227
- "Operations Research Analyst": {
228
- "links": [
229
- ("Linear Programming – Khan Academy", "https://www.khanacademy.org/computing/computer-science/algorithms"),
230
- ("Optimization – MIT OpenCourseWare", "https://ocw.mit.edu/courses/optimization-methods"),
231
- ("Statistics – Harvard Online", "https://online-learning.harvard.edu/course/statistics-and-r")
232
- ],
233
- "college": {
234
- "major": "Operations Research, Applied Mathematics",
235
- "classes": [
236
- "Optimization Theory",
237
- "Linear Programming",
238
- "Probability",
239
- "Statistics",
240
- "Simulation Modeling"
241
- ]
242
- }
243
- },
244
- "Mathematician": {
245
- "links": [
246
- ("Abstract Algebra – MIT OpenCourseWare", "https://ocw.mit.edu/courses/abstract-algebra"),
247
- ("Calculus – Khan Academy", "https://www.khanacademy.org/math/calculus-1"),
248
- ("Proof Techniques – Coursera", "https://www.coursera.org/learn/proofs")
249
- ],
250
- "college": {
251
- "major": "Mathematics",
252
- "classes": [
253
- "Algebra",
254
- "Calculus",
255
- "Real Analysis",
256
- "Abstract Algebra",
257
- "Proof Writing"
258
- ]
259
- }
260
- },
261
- "Chemical Engineer": {
262
- "links": [
263
- ("Chemical Process Principles – MIT OCW", "https://ocw.mit.edu/courses/chemical-engineering"),
264
- ("Organic Chemistry – Khan Academy", "https://www.khanacademy.org/science/organic-chemistry"),
265
- ("Thermodynamics – Coursera", "https://www.coursera.org/learn/thermodynamics")
266
- ],
267
- "college": {
268
- "major": "Chemical Engineering",
269
- "classes": [
270
- "Organic Chemistry",
271
- "Thermodynamics",
272
- "Process Design",
273
- "Fluid Mechanics",
274
- "Chemical Reaction Engineering"
275
- ]
276
- }
277
- },
278
- "Civil Engineer": {
279
- "links": [
280
- ("Structural Analysis – Coursera", "https://www.coursera.org/learn/structural-analysis"),
281
- ("Construction Management – edX", "https://www.edx.org/course/construction-management"),
282
- ("AutoCAD – LinkedIn Learning", "https://www.linkedin.com/learning/topics/autocad")
283
- ],
284
- "college": {
285
- "major": "Civil Engineering",
286
- "classes": [
287
- "Structural Analysis",
288
- "Construction Materials",
289
- "Soil Mechanics",
290
- "AutoCAD",
291
- "Hydraulics"
292
- ]
293
- }
294
- },
295
- "Electrical Engineer": {
296
- "links": [
297
- ("Circuits and Electronics – MIT OCW", "https://ocw.mit.edu/courses/electrical-engineering-and-computer-science"),
298
- ("Signals and Systems – Coursera", "https://www.coursera.org/learn/signals-systems"),
299
- ("Electromagnetics – Khan Academy", "https://www.khanacademy.org/science/electrical-engineering")
300
- ],
301
- "college": {
302
- "major": "Electrical Engineering",
303
- "classes": [
304
- "Circuits",
305
- "Signals and Systems",
306
- "Electromagnetics",
307
- "Control Systems",
308
- "Digital Logic Design"
309
- ]
310
- }
311
- },
312
- "Software Developer": {
313
- "links": [
314
- ("CS50 – Harvard", "https://cs50.harvard.edu"),
315
- ("Learn to Code – Codecademy", "https://www.codecademy.com/catalog/subject/all"),
316
- ("Algorithms – Coursera", "https://www.coursera.org/learn/algorithms-part1")
317
- ],
318
- "college": {
319
- "major": "Computer Science, Software Engineering",
320
- "classes": [
321
- "Introduction to Computer Science (CS50)",
322
- "Data Structures and Algorithms",
323
- "Operating Systems",
324
- "Software Engineering",
325
- "Databases"
326
- ]
327
- }
328
- },
329
- "Pharmacist": {
330
- "links": [
331
- ("Pharmacology Basics – Coursera", "https://www.coursera.org/learn/pharmacology"),
332
- ("Drug Development – edX", "https://www.edx.org/course/drug-development"),
333
- ("Pharmacy Practice – FutureLearn", "https://www.futurelearn.com/courses/pharmacy-practice")
334
- ],
335
- "college": {
336
- "major": "Pharmacy, Pharmaceutical Sciences",
337
- "classes": [
338
- "Pharmacology",
339
- "Medicinal Chemistry",
340
- "Pharmaceutical Calculations",
341
- "Pharmaceutics",
342
- "Clinical Pharmacy"
343
- ]
344
- }
345
- },
346
- "Physicist": {
347
- "links": [
348
- ("Classical Mechanics – MIT OCW", "https://ocw.mit.edu/courses/physics"),
349
- ("Quantum Mechanics – edX", "https://www.edx.org/course/quantum-mechanics"),
350
- ("Thermodynamics – Khan Academy", "https://www.khanacademy.org/science/physics/thermodynamics")
351
- ],
352
- "college": {
353
- "major": "Physics",
354
- "classes": [
355
- "Classical Mechanics",
356
- "Quantum Mechanics",
357
- "Thermodynamics",
358
- "Electromagnetism",
359
- "Mathematical Methods for Physicists"
360
- ]
361
- }
362
- },
363
- "Astronomer": {
364
- "links": [
365
- ("Introduction to Astronomy – Coursera", "https://www.coursera.org/learn/astronomy"),
366
- ("Astrophysics – edX", "https://www.edx.org/course/astrophysics"),
367
- ("Cosmology – Khan Academy", "https://www.khanacademy.org/science/cosmology-and-astronomy")
368
- ],
369
- "college": {
370
- "major": "Astronomy, Astrophysics, Physics",
371
- "classes": [
372
- "Introduction to Astronomy",
373
- "Astrophysics",
374
- "Cosmology",
375
- "Observational Astronomy",
376
- "Data Analysis in Astronomy"
377
- ]
378
- }
379
- },
380
- "Geologist": {
381
- "links": [
382
- ("Physical Geology – OpenStax", "https://openstax.org/details/books/physical-geology"),
383
- ("Geochemistry – Coursera", "https://www.coursera.org/learn/geochemistry"),
384
- ("GIS Mapping – Esri Training", "https://www.esri.com/training/catalog/57630435851d31e02a43f1c5/gis-basics/")
385
- ],
386
- "college": {
387
- "major": "Geology, Earth Science",
388
- "classes": [
389
- "Physical Geology",
390
- "Mineralogy and Petrology",
391
- "Geochemistry",
392
- "GIS and Remote Sensing",
393
- "Structural Geology"
394
- ]
395
- }
396
- },
397
- "Biochemist": {
398
- "links": [
399
- ("Biochemistry – MIT OCW", "https://ocw.mit.edu/courses/biochemistry"),
400
- ("Molecular Biology – Coursera", "https://www.coursera.org/learn/molecular-biology"),
401
- ("Enzymology – Khan Academy", "https://www.khanacademy.org/science/biology")
402
- ],
403
- "college": {
404
- "major": "Biochemistry, Molecular Biology",
405
- "classes": [
406
- "General Biochemistry",
407
- "Molecular Biology",
408
- "Enzymology",
409
- "Cell Biology",
410
- "Genetics"
411
- ]
412
- }
413
- }
414
  }
415
 
416
- content = resources.get(career)
417
- if not content:
418
- return "Select a career to see resources.", ""
419
-
420
- link_html = "<ul>"
421
- for label, url in content["links"]:
422
- link_html += f'<li><strong>{label}</strong>: <a href="{url}" target="_blank">{url}</a></li>'
423
- link_html += "</ul>"
424
 
425
- college_html = ""
426
- if "college" in content:
427
- college = content["college"]
428
- college_html += "<p><strong>College & Classes</strong></p><ul>"
429
- college_html += f"<li><em>Common Major(s):</em> {college['major']}</li>"
430
- classes_list = college.get("classes", [])
431
- if isinstance(classes_list, list):
432
- classes_html = ", ".join(classes_list)
433
- else:
434
- classes_html = str(classes_list)
435
- college_html += f"<li><em>Helpful College Classes:</em> {classes_html}</li>"
436
- college_html += "</ul>"
437
 
438
- # No video iframe, just empty string for second output
439
- return link_html + college_html, ""
440
 
441
  # UI Layout
442
  with gr.Blocks(theme=theme, css=custom_css) as chatbot:
@@ -451,8 +118,7 @@ with gr.Blocks(theme=theme, css=custom_css) as chatbot:
451
  description='This tool provides information on STEM Careers. All information is sourced from [census.gov](https://www.census.gov/).'
452
  )
453
 
454
-
455
- with gr.Tab("Explore Now"): # ✅ Changed title
456
  gr.Markdown("### Explore STEM Career Categories")
457
  dropdown_explore = gr.Dropdown(
458
  choices=[
@@ -465,11 +131,9 @@ with gr.Blocks(theme=theme, css=custom_css) as chatbot:
465
  label="Choose a Category"
466
  )
467
  output_explore = gr.Markdown()
468
-
469
  dropdown_explore.change(fn=show_info, inputs=dropdown_explore, outputs=output_explore)
470
 
471
-
472
- with gr.Tab("Resources"):
473
  gr.Markdown("### Career-Specific Educational Resources")
474
  dropdown_resources = gr.Dropdown(
475
  choices=[
@@ -505,4 +169,7 @@ with gr.Blocks(theme=theme, css=custom_css) as chatbot:
505
 
506
  chatbot.launch()
507
 
508
-
 
 
 
 
87
 
88
  # Resources Page Info - UPDATED
89
  def resource_block(career):
90
+ yt_videos = {
91
+ "AI/Machine Learning Engineer": "https://www.youtube.com/embed/ukzFI9rgwfU",
92
+ "Data Scientist": "https://www.youtube.com/embed/xC-c7E5PK0Y",
93
+ "Cloud Solutions Architect": "https://www.youtube.com/embed/l1EssrLxt7E"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
 
96
+ # Reuse existing function to get resources
97
+ from app import resource_block as base_resource_block
98
+ text_html, _ = base_resource_block(career)
 
 
 
 
 
99
 
100
+ video_url = yt_videos.get(career)
101
+ if video_url:
102
+ video_html = f'<iframe width="100%" height="315" src="{video_url}" frameborder="0" allowfullscreen></iframe>'
103
+ else:
104
+ video_html = ""
 
 
 
 
 
 
 
105
 
106
+ return text_html, video_html
 
107
 
108
  # UI Layout
109
  with gr.Blocks(theme=theme, css=custom_css) as chatbot:
 
118
  description='This tool provides information on STEM Careers. All information is sourced from [census.gov](https://www.census.gov/).'
119
  )
120
 
121
+ with gr.Tab("Explore Now"):
 
122
  gr.Markdown("### Explore STEM Career Categories")
123
  dropdown_explore = gr.Dropdown(
124
  choices=[
 
131
  label="Choose a Category"
132
  )
133
  output_explore = gr.Markdown()
 
134
  dropdown_explore.change(fn=show_info, inputs=dropdown_explore, outputs=output_explore)
135
 
136
+ with gr.Tab("Resources"):
 
137
  gr.Markdown("### Career-Specific Educational Resources")
138
  dropdown_resources = gr.Dropdown(
139
  choices=[
 
169
 
170
  chatbot.launch()
171
 
172
+
173
+
174
+
175
+