Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- app.py +52 -0
- emotions_report.pkl +3 -0
- goals_report.pkl +3 -0
app.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pickle
|
| 3 |
+
|
| 4 |
+
st.title("Contact List Analysis")
|
| 5 |
+
|
| 6 |
+
with open('emotions_report.pkl', 'rb') as file:
|
| 7 |
+
emotions_report = pickle.load(file)
|
| 8 |
+
|
| 9 |
+
with open('goals_report.pkl', 'rb') as file:
|
| 10 |
+
goals_report = pickle.load(file)
|
| 11 |
+
|
| 12 |
+
emotions_tab, goals_tab = st.tabs(["Emotions", "Goals"])
|
| 13 |
+
|
| 14 |
+
with emotions_tab:
|
| 15 |
+
for name in emotions_report.keys():
|
| 16 |
+
container = st.container(border=True)
|
| 17 |
+
|
| 18 |
+
with container:
|
| 19 |
+
st.header(name)
|
| 20 |
+
|
| 21 |
+
for emotion in emotions_report[name].keys():
|
| 22 |
+
score = len(emotions_report[name][emotion])
|
| 23 |
+
expander = st.expander(f"Emotion: {emotion} - {score}")
|
| 24 |
+
|
| 25 |
+
with expander:
|
| 26 |
+
for r in emotions_report[name][emotion]:
|
| 27 |
+
st.write(r["explanation"])
|
| 28 |
+
|
| 29 |
+
for ref in r["reference"]:
|
| 30 |
+
st.markdown(f"> {ref}")
|
| 31 |
+
|
| 32 |
+
st.write("\n")
|
| 33 |
+
|
| 34 |
+
with goals_tab:
|
| 35 |
+
for name in goals_report.keys():
|
| 36 |
+
container = st.container(border=True)
|
| 37 |
+
|
| 38 |
+
with container:
|
| 39 |
+
st.header(name)
|
| 40 |
+
|
| 41 |
+
for goal in goals_report[name].keys():
|
| 42 |
+
score = len(goals_report[name][goal])
|
| 43 |
+
expander = st.expander(f"Goal: {goal} - {score}")
|
| 44 |
+
|
| 45 |
+
with expander:
|
| 46 |
+
for r in goals_report[name][goal]:
|
| 47 |
+
st.write(r["explanation"])
|
| 48 |
+
|
| 49 |
+
for ref in r["reference"]:
|
| 50 |
+
st.markdown(f"> {ref}")
|
| 51 |
+
|
| 52 |
+
st.write("\n")
|
emotions_report.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef507591c9aa1537580f1a6c43737908015545bdc89cbbb0b257a54013ae7b65
|
| 3 |
+
size 31238
|
goals_report.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5b398b4eb2cf2ce075cec6e052cff27741a7a75782d309c20705f70f9adb1cb8
|
| 3 |
+
size 30752
|