awacke1's picture
Create app.py
ef80ed5
raw
history blame
No virus
2.39 kB
import streamlit as st
from graphviz import Digraph
# 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.
def create_amygdala_hijacking_graph():
g = Digraph('Amygdala_Hijacking', format='png')
g.attr(fontname="Helvetica,Arial,sans-serif")
g.attr('node', fontname="Helvetica,Arial,sans-serif")
g.attr('edge', fontname="Helvetica,Arial,sans-serif")
g.attr('graph', newrank='true', nodesep='0.3', ranksep='0.2', overlap='true', splines='false')
g.attr('node', fixedsize='false', fontsize='24', height='1', shape='box', style='filled,setlinewidth(5)', width='2.2', penwidth='3')
g.attr('edge', arrowhead='none', arrowsize='0.5', labelfontname="Ubuntu", weight='10', style='filled,setlinewidth(5)')
g.node('1', 'πŸ‘‚ Sensory Input', fillcolor='lightblue')
g.node('2', 'πŸ“‘ Thalamus', fillcolor='palegreen')
g.node('3', 'πŸ”΄ Amygdala', color='red', fillcolor='red', fontcolor='white')
g.node('4', 'πŸ“š Hippocampus', fillcolor='lightyellow')
g.node('5', 'πŸ’‘ Prefrontal Cortex', fillcolor='lightpink')
g.node('6', '🎬 Response', fillcolor='lightgray')
g.edge('1', '2', label='🌐 Receives Signals')
g.edge('2', '3', label='⚑ Quick, Emotional Response')
g.edge('2', '4', label='πŸ”€ Sends Signals To')
g.edge('4', '5', label='πŸ”„ Relays Information')
g.edge('5', '3', label='🧠 Rational Control (If Not Hijacked)')
g.edge('3', '6', label='πŸƒ Generates Response')
return g
def main():
st.title("Amygdala Hijacking Visualization")
st.text("A simple graph model to represent amygdala hijacking in the brain.")
amygdala_hijacking_graph = create_amygdala_hijacking_graph()
st.graphviz_chart(amygdala_hijacking_graph)
if __name__ == "__main__":
main()
st.markdown("""
Explain amygdala hijacking using a graph model in streamlit python program using graphviz to represent levels or modes of thinking
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.
""")