Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +7 -47
src/streamlit_app.py
CHANGED
|
@@ -21,51 +21,11 @@ def get_stable_color(s):
|
|
| 21 |
# Use the first 6 hex digits for RGB color
|
| 22 |
return f'#{hex_digest[:6]}'
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
background-color: #F3E5F5; /* A very light purple */
|
| 30 |
-
color: #1A0A26; /* Dark purple for the text */
|
| 31 |
-
}
|
| 32 |
-
/* Sidebar background color */
|
| 33 |
-
.css-1d36184 {
|
| 34 |
-
background-color: #D1C4E9; /* A medium light purple */
|
| 35 |
-
secondary-background-color: #D1C4E9;
|
| 36 |
-
}
|
| 37 |
-
/* Expander background color and header */
|
| 38 |
-
.streamlit-expanderContent, .streamlit-expanderHeader {
|
| 39 |
-
background-color: #F3E5F5;
|
| 40 |
-
}
|
| 41 |
-
/* Text Area background and text color */
|
| 42 |
-
.stTextArea textarea {
|
| 43 |
-
background-color: #B39DDB; /* A slightly darker medium purple */
|
| 44 |
-
color: #1A0A26; /* Dark purple for text */
|
| 45 |
-
}
|
| 46 |
-
/* Text Input background and text color */
|
| 47 |
-
.stTextInput input {
|
| 48 |
-
background-color: #B39DDB; /* Same as the text area for consistency */
|
| 49 |
-
color: #1A0A26;
|
| 50 |
-
}
|
| 51 |
-
/* Button background and text color */
|
| 52 |
-
.stButton > button {
|
| 53 |
-
background-color: #B39DDB;
|
| 54 |
-
color: #1A0A26;
|
| 55 |
-
}
|
| 56 |
-
/* Warning box background and text color */
|
| 57 |
-
.stAlert.st-warning {
|
| 58 |
-
background-color: #9575CD; /* A medium-dark purple for the warning box */
|
| 59 |
-
color: #1A0A26;
|
| 60 |
-
}
|
| 61 |
-
/* Success box background and text color */
|
| 62 |
-
.stAlert.st-success {
|
| 63 |
-
background-color: #9575CD; /* A medium-dark purple for the success box */
|
| 64 |
-
color: #1A0A26;
|
| 65 |
-
}
|
| 66 |
-
</style>
|
| 67 |
-
""",
|
| 68 |
-
unsafe_allow_html=True)
|
| 69 |
# --- Page Configuration and UI Elements
|
| 70 |
st.set_page_config(layout="wide", page_title="Named Entity Recognition App")
|
| 71 |
st.subheader("InfoFinder", divider="violet")
|
|
@@ -130,7 +90,7 @@ if st.button("Add Question"):
|
|
| 130 |
else:
|
| 131 |
st.warning("Please enter a question.")
|
| 132 |
st.markdown("---")
|
| 133 |
-
st.subheader("Record of Questions", divider="
|
| 134 |
if st.session_state.user_labels:
|
| 135 |
for i, label in enumerate(st.session_state.user_labels):
|
| 136 |
col_list, col_delete = st.columns([0.9, 0.1])
|
|
@@ -166,7 +126,7 @@ if st.button("Extract Answers"):
|
|
| 166 |
df2 = df1[['label', 'text', 'score']]
|
| 167 |
df = df2.rename(columns={'label': 'question', 'text': 'answer'})
|
| 168 |
|
| 169 |
-
st.subheader("Extracted Answers", divider="
|
| 170 |
st.dataframe(df, use_container_width=True)
|
| 171 |
st.subheader("Tree map", divider="green")
|
| 172 |
all_labels = df['question'].unique()
|
|
|
|
| 21 |
# Use the first 6 hex digits for RGB color
|
| 22 |
return f'#{hex_digest[:6]}'
|
| 23 |
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# --- Page Configuration and UI Elements
|
| 30 |
st.set_page_config(layout="wide", page_title="Named Entity Recognition App")
|
| 31 |
st.subheader("InfoFinder", divider="violet")
|
|
|
|
| 90 |
else:
|
| 91 |
st.warning("Please enter a question.")
|
| 92 |
st.markdown("---")
|
| 93 |
+
st.subheader("Record of Questions", divider="violet")
|
| 94 |
if st.session_state.user_labels:
|
| 95 |
for i, label in enumerate(st.session_state.user_labels):
|
| 96 |
col_list, col_delete = st.columns([0.9, 0.1])
|
|
|
|
| 126 |
df2 = df1[['label', 'text', 'score']]
|
| 127 |
df = df2.rename(columns={'label': 'question', 'text': 'answer'})
|
| 128 |
|
| 129 |
+
st.subheader("Extracted Answers", divider="violet")
|
| 130 |
st.dataframe(df, use_container_width=True)
|
| 131 |
st.subheader("Tree map", divider="green")
|
| 132 |
all_labels = df['question'].unique()
|