Spaces:
Sleeping
Sleeping
pdf added
Browse files
docs/pdfs/AI_Decoded__Yin_2024.pdf
ADDED
|
Binary file (633 kB). View file
|
|
|
pages/1_Main_Deck.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import base64
|
| 3 |
+
|
| 4 |
+
def get_pdf_file_content_as_base64(file_path: str):
|
| 5 |
+
"""
|
| 6 |
+
Converts a PDF file to base64 for embedding.
|
| 7 |
+
Args:
|
| 8 |
+
file_path (str): The file path to the PDF file.
|
| 9 |
+
|
| 10 |
+
Returns:
|
| 11 |
+
str: The base64 encoded string of the PDF file.
|
| 12 |
+
"""
|
| 13 |
+
with open(file_path, "rb") as pdf_file:
|
| 14 |
+
base64_encoded_data = base64.b64encode(pdf_file.read()).decode('utf-8')
|
| 15 |
+
return base64_encoded_data
|
| 16 |
+
|
| 17 |
+
def main():
|
| 18 |
+
st.title('PDF Display in Streamlit')
|
| 19 |
+
|
| 20 |
+
# Display the PDF by downloading it
|
| 21 |
+
with open("../docs/pdfs/AI_Decoded__Yin_2024.pdf", "rb") as file:
|
| 22 |
+
btn = st.download_button(
|
| 23 |
+
label="Download PDF",
|
| 24 |
+
data=file,
|
| 25 |
+
file_name="xyz.pdf",
|
| 26 |
+
mime="application/octet-stream"
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
# Display the PDF embedded in the page
|
| 30 |
+
base64_pdf = get_pdf_file_content_as_base64("xyz.pdf")
|
| 31 |
+
pdf_display = f'<iframe src="data:application/pdf;base64,{base64_pdf}" width="700" height="1000" type="application/pdf"></iframe>'
|
| 32 |
+
st.markdown(pdf_display, unsafe_allow_html=True)
|
| 33 |
+
|
| 34 |
+
if __name__ == "__main__":
|
| 35 |
+
main()
|
pages/2_Artificial_Neural_Network_Convolutional_Neural_Network.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
st.markdown(
|
| 5 |
+
"""
|
| 6 |
+
# Python Notebook Overview
|
| 7 |
+
|
| 8 |
+
## Executive Summary
|
| 9 |
+
This Python notebook contains a series of basic programming exercises that demonstrate simple Python operations including variable assignments, user input handling, arithmetic calculations, conditional statements, and basic string manipulations. The notebook serves as a primer to Python programming, focusing on various introductory concepts.
|
| 10 |
+
|
| 11 |
+
## Situation/Motivation/Question
|
| 12 |
+
The primary motivation behind this notebook is to introduce new programmers to various fundamental concepts in Python. The notebook addresses the following questions:
|
| 13 |
+
- How do you perform simple print operations in Python?
|
| 14 |
+
- How can user inputs be handled and utilized in calculations?
|
| 15 |
+
- What are the basics of Python syntax for control structures like conditional statements?
|
| 16 |
+
- How can Python be used for simple arithmetic operations to solve everyday problems, such as currency conversion?
|
| 17 |
+
|
| 18 |
+
## High Level Overview of the Code
|
| 19 |
+
The notebook executes a series of independent code blocks that illustrate basic Python functionalities:
|
| 20 |
+
1. **Printing Statements**: The notebook starts with simple print statements that output text such as "Hello World!" and other introductory phrases to the console.
|
| 21 |
+
2. **Variable Assignments and Updates**: It demonstrates how to store string and numeric data in variables and how to update these variables.
|
| 22 |
+
3. **Arithmetic Calculations**: The notebook includes an example where arithmetic mean is calculated from judges' scores, demonstrating how to perform arithmetic operations and combine them with print statements for output.
|
| 23 |
+
4. **User Input Handling**: It collects user inputs for names and dollar amounts, and uses these inputs in greeting messages and currency conversion calculations, respectively.
|
| 24 |
+
5. **Conditional Logic**: The notebook shows how to use if-else statements to handle decisions based on user inputs and predefined conditions, such as determining actions based on traffic light colors.
|
| 25 |
+
|
| 26 |
+
## Future Outlook
|
| 27 |
+
The notebook can be extended and improved in several ways:
|
| 28 |
+
- **Expanding User Interaction**: Incorporating more complex user interactions, such as looping until a user provides valid input.
|
| 29 |
+
- **Integration with External APIs**: Adding examples that fetch data from external APIs, such as weather data or real-time currency conversion rates.
|
| 30 |
+
- **Graphical User Interfaces (GUIs)**: Introducing Python libraries for creating simple GUIs, which can make the applications more interactive and user-friendly.
|
| 31 |
+
- **Data Visualization**: Demonstrating basic data visualization techniques using libraries like Matplotlib or Seaborn to graph the input data or results.
|
| 32 |
+
- **Error Handling**: Adding robust error handling to improve the reliability of user input operations and other error-prone areas.
|
| 33 |
+
- **Unit Testing**: Introducing basic unit tests to ensure that functions in the notebook work as expected under various conditions.
|
| 34 |
+
|
| 35 |
+
This extension will make the notebook more applicable to real-world scenarios and help new programmers understand not only the basics but also some intermediate aspects of Python programming.
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
"""
|
| 39 |
+
)
|