File size: 2,308 Bytes
ef80ed5
 
ffb9bdb
 
ef80ed5
 
ffb9bdb
ef80ed5
ffb9bdb
 
 
 
 
 
ef80ed5
ffb9bdb
 
 
ef80ed5
ffb9bdb
 
 
 
 
ef80ed5
ffb9bdb
 
 
ef80ed5
 
 
 
ffb9bdb
ef80ed5
 
 
ffb9bdb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef80ed5
ffb9bdb
 
 
 
 
 
 
 
ef80ed5
ffb9bdb
ef80ed5
ffb9bdb
 
 
 
ef80ed5
 
 
 
ffb9bdb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import streamlit as st
from graphviz import Digraph
import json
import os

def create_amygdala_hijacking_graph():
    # ... (same as before) ...

def load_votes():
    if os.path.exists('votes.json'):
        with open('votes.json', 'r') as f:
            return json.load(f)
    else:
        return {'upvotes': {}, 'downvotes': {}}

def save_votes(votes):
    with open('votes.json', 'w') as f:
        json.dump(votes, f)

def display_votes():
    votes = load_votes()
    st.write("Upvotes:")
    for term, count in votes['upvotes'].items():
        st.write(f"{term}: {count}")

    st.write("Downvotes:")
    for term, count in votes['downvotes'].items():
        st.write(f"{term}: {count}")

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)

    terms = [
        'πŸ‘‚ Sensory Input',
        'πŸ“‘ Thalamus',
        'πŸ”΄ Amygdala',
        'πŸ“š Hippocampus',
        'πŸ’‘ Prefrontal Cortex',
        '🎬 Response'
    ]

    for term in terms:
        st.write(term)
        upvote_button = st.button(f"πŸ‘ Upvote {term}")
        downvote_button = st.button(f"πŸ‘Ž Downvote {term}")

        if upvote_button or downvote_button:
            votes = load_votes()

            if upvote_button:
                if term not in votes['upvotes']:
                    votes['upvotes'][term] = 0
                votes['upvotes'][term] += 1
            elif downvote_button:
                if term not in votes['downvotes']:
                    votes['downvotes'][term] = 0
                votes['downvotes'][term] += 1

            save_votes(votes)

    display_votes()

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.
""")