Spaces:
Sleeping
Sleeping
orionweller
commited on
Commit
•
a480b5c
1
Parent(s):
0bc0c39
bug fix
Browse files- app.py +5 -3
- requirements.txt +1 -1
app.py
CHANGED
@@ -56,6 +56,7 @@ def escape_markdown(text):
|
|
56 |
# List of characters to escape
|
57 |
# Adding backslash to the list of special characters to escape itself as well
|
58 |
text = text.replace("``", "\"")
|
|
|
59 |
special_chars = ['\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '#', '+', '-', '.', '!', '|', "$"]
|
60 |
|
61 |
# Escaping each special character
|
@@ -128,7 +129,7 @@ with st.sidebar:
|
|
128 |
|
129 |
z = st.header("Analysis Options")
|
130 |
# sliderbar of how many Top N to choose
|
131 |
-
n_relevant_docs = st.slider("Number of relevant docs", 1, 999,
|
132 |
|
133 |
|
134 |
col1, col2 = st.columns([1, 3], gap="large")
|
@@ -139,7 +140,8 @@ if corpus is not None and queries is not None and qrels is not None:
|
|
139 |
|
140 |
with col1:
|
141 |
# breakpoint()
|
142 |
-
|
|
|
143 |
container_for_nav = st.container()
|
144 |
name_of_columns = sorted([item for item in set_of_cols])
|
145 |
instances_to_use = name_of_columns
|
@@ -175,7 +177,7 @@ if corpus is not None and queries is not None and qrels is not None:
|
|
175 |
# now show the number with relevant docs less than `n_relevant_docs`
|
176 |
st.header("Relevant Docs Less Than {}:".format(n_relevant_docs))
|
177 |
st.subheader(f'{relevant_df[relevant_df["relevant_docs"] < n_relevant_docs].shape[0]} Queries')
|
178 |
-
st.
|
179 |
|
180 |
|
181 |
with col2:
|
|
|
56 |
# List of characters to escape
|
57 |
# Adding backslash to the list of special characters to escape itself as well
|
58 |
text = text.replace("``", "\"")
|
59 |
+
text = text.replace("$", "\$")
|
60 |
special_chars = ['\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '#', '+', '-', '.', '!', '|', "$"]
|
61 |
|
62 |
# Escaping each special character
|
|
|
129 |
|
130 |
z = st.header("Analysis Options")
|
131 |
# sliderbar of how many Top N to choose
|
132 |
+
n_relevant_docs = st.slider("Number of relevant docs", 1, 999, 100)
|
133 |
|
134 |
|
135 |
col1, col2 = st.columns([1, 3], gap="large")
|
|
|
140 |
|
141 |
with col1:
|
142 |
# breakpoint()
|
143 |
+
qids_with_less = relevant_df[relevant_df["relevant_docs"] < n_relevant_docs].qid.tolist()
|
144 |
+
set_of_cols = set(qrels.keys()).intersection(set(qids_with_less))
|
145 |
container_for_nav = st.container()
|
146 |
name_of_columns = sorted([item for item in set_of_cols])
|
147 |
instances_to_use = name_of_columns
|
|
|
177 |
# now show the number with relevant docs less than `n_relevant_docs`
|
178 |
st.header("Relevant Docs Less Than {}:".format(n_relevant_docs))
|
179 |
st.subheader(f'{relevant_df[relevant_df["relevant_docs"] < n_relevant_docs].shape[0]} Queries')
|
180 |
+
st.markdown(",".join(relevant_df[relevant_df["relevant_docs"] < n_relevant_docs].qid.tolist()))
|
181 |
|
182 |
|
183 |
with col2:
|
requirements.txt
CHANGED
@@ -4,4 +4,4 @@ plotly==5.15.0
|
|
4 |
protobuf==3.20.0
|
5 |
beautifulsoup4==4.12.2
|
6 |
nltk==3.7
|
7 |
-
tqdm
|
|
|
4 |
protobuf==3.20.0
|
5 |
beautifulsoup4==4.12.2
|
6 |
nltk==3.7
|
7 |
+
tqdm==4.66.2
|