Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from graphviz import Digraph
|
3 |
+
|
4 |
+
# The function creates a directed graph with nodes representing different parts of the brain or processes involved in decision-making. The edges denote the flow of information between these nodes.
|
5 |
+
|
6 |
+
def create_amygdala_hijacking_graph():
|
7 |
+
g = Digraph('Amygdala_Hijacking', format='png')
|
8 |
+
|
9 |
+
g.attr(rankdir='LR')
|
10 |
+
|
11 |
+
g.node('1', 'Sensory Input', shape='oval')
|
12 |
+
g.node('2', 'Thalamus', shape='oval')
|
13 |
+
g.node('3', 'Amygdala', shape='oval', color='red', style='filled')
|
14 |
+
g.node('4', 'Hippocampus', shape='oval')
|
15 |
+
g.node('5', 'Prefrontal Cortex', shape='oval')
|
16 |
+
g.node('6', 'Response', shape='oval')
|
17 |
+
|
18 |
+
g.edge('1', '2', label='Receives signals')
|
19 |
+
g.edge('2', '3', label='Quick, emotional response')
|
20 |
+
g.edge('2', '4', label='Sends signals to')
|
21 |
+
g.edge('4', '5', label='Relays information')
|
22 |
+
g.edge('5', '3', label='Rational control (if not hijacked)')
|
23 |
+
g.edge('3', '6', label='Generates response')
|
24 |
+
|
25 |
+
return g
|
26 |
+
|
27 |
+
|
28 |
+
def main():
|
29 |
+
st.title("Amygdala Hijacking Visualization")
|
30 |
+
st.text("A simple graph model to represent amygdala hijacking in the brain.")
|
31 |
+
|
32 |
+
amygdala_hijacking_graph = create_amygdala_hijacking_graph()
|
33 |
+
st.graphviz_chart(amygdala_hijacking_graph)
|
34 |
+
|
35 |
+
if __name__ == "__main__":
|
36 |
+
main()
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
st.markdown("""
|
42 |
+
|
43 |
+
Explain amygdala hijacking using a graph model in streamlit python program using graphviz to represent levels or modes of thinking
|
44 |
+
|
45 |
+
Amygdala hijacking is a phenomenon where our emotional brain (amygdala) takes control over our rational brain (prefrontal cortex), leading to impulsive and irrational behavior. In this response, I'll guide you on how to create a Streamlit app with Graphviz to visualize the concept of amygdala hijacking using a graph model.
|
46 |
+
|
47 |
+
""")
|