Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(fontname="Helvetica,Arial,sans-serif")
|
10 |
+
g.attr('node', fontname="Helvetica,Arial,sans-serif")
|
11 |
+
g.attr('edge', fontname="Helvetica,Arial,sans-serif")
|
12 |
+
g.attr('graph', newrank='true', nodesep='0.3', ranksep='0.2', overlap='true', splines='false')
|
13 |
+
g.attr('node', fixedsize='false', fontsize='24', height='1', shape='box', style='filled,setlinewidth(5)', width='2.2', penwidth='3')
|
14 |
+
g.attr('edge', arrowhead='none', arrowsize='0.5', labelfontname="Ubuntu", weight='10', style='filled,setlinewidth(5)')
|
15 |
+
|
16 |
+
g.node('1', 'π Sensory Input', fillcolor='lightblue')
|
17 |
+
g.node('2', 'π‘ Thalamus', fillcolor='palegreen')
|
18 |
+
g.node('3', 'π΄ Amygdala', color='red', fillcolor='red', fontcolor='white')
|
19 |
+
g.node('4', 'π Hippocampus', fillcolor='lightyellow')
|
20 |
+
g.node('5', 'π‘ Prefrontal Cortex', fillcolor='lightpink')
|
21 |
+
g.node('6', 'π¬ Response', fillcolor='lightgray')
|
22 |
+
|
23 |
+
g.edge('1', '2', label='π Receives Signals')
|
24 |
+
g.edge('2', '3', label='β‘ Quick, Emotional Response')
|
25 |
+
g.edge('2', '4', label='π Sends Signals To')
|
26 |
+
g.edge('4', '5', label='π Relays Information')
|
27 |
+
g.edge('5', '3', label='π§ Rational Control (If Not Hijacked)')
|
28 |
+
g.edge('3', '6', label='π Generates Response')
|
29 |
+
|
30 |
+
return g
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
def main():
|
36 |
+
st.title("Amygdala Hijacking Visualization")
|
37 |
+
st.text("A simple graph model to represent amygdala hijacking in the brain.")
|
38 |
+
|
39 |
+
amygdala_hijacking_graph = create_amygdala_hijacking_graph()
|
40 |
+
st.graphviz_chart(amygdala_hijacking_graph)
|
41 |
+
|
42 |
+
if __name__ == "__main__":
|
43 |
+
main()
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
st.markdown("""
|
49 |
+
Explain amygdala hijacking using a graph model in streamlit python program using graphviz to represent levels or modes of thinking
|
50 |
+
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.
|
51 |
+
""")
|