Skip to content

Commit f879518

Browse files
committed
visualization: add distribution for the filter "remove words with incorrect substrings"
1 parent cd5f548 commit f879518

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ac_dc/visualization/visualization.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,16 @@ def filtering_of_words(self):
448448
)
449449
self.parameters.append(("incorrect_substrings", incorrect_substrings))
450450

451+
checkbox = st.checkbox(
452+
"Diplay distribution", value=True, key="display_distribution_incorrect_substrings"
453+
)
454+
if checkbox:
455+
incor_sub = np.array(self.words["incorrect_substrings"]) * 1
456+
with_incor_sub = np.sum(incor_sub)
457+
without_incor_sub = len(incor_sub) - with_incor_sub
458+
st.markdown(f"Number of words with incorrect substrings: {with_incor_sub}")
459+
st.markdown(f"Number of words without incorrect substrings: {without_incor_sub}")
460+
451461
if incorrect_substrings:
452462
cond_incorrect_substrings = np.invert(self.words["incorrect_substrings"])
453463
else:

0 commit comments

Comments
 (0)