Spaces:
Sleeping
Sleeping
Nick Sorros
commited on
Commit
·
c956188
1
Parent(s):
28fedac
Move side header a bit down and reformat
Browse files
app.py
CHANGED
|
@@ -18,11 +18,13 @@ st.sidebar.write(
|
|
| 18 |
"A complete list of MeSH tags can be found here https://meshb.nlm.nih.gov/treeView"
|
| 19 |
)
|
| 20 |
st.sidebar.write("The grants data can be found https://www.threesixtygiving.org/")
|
| 21 |
-
st.sidebar.header("Parameters")
|
| 22 |
st.sidebar.write(
|
| 23 |
"The model used to tag grants is https://huggingface.co/Wellcome/WellcomeBertMesh"
|
| 24 |
)
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
if "grants" not in st.session_state:
|
| 28 |
st.session_state["grants"] = list(srsly.read_jsonl("tagged_grants.jsonl"))
|
|
@@ -48,5 +50,10 @@ if "results" in st.session_state:
|
|
| 48 |
st.button(tag, on_click=search, kwargs={"query": tag})
|
| 49 |
results = st.session_state["results"]
|
| 50 |
st.caption(f"Found {len(results)}. Displaying {nb_results}")
|
| 51 |
-
st.download_button(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
st.table(results[:nb_results])
|
|
|
|
| 18 |
"A complete list of MeSH tags can be found here https://meshb.nlm.nih.gov/treeView"
|
| 19 |
)
|
| 20 |
st.sidebar.write("The grants data can be found https://www.threesixtygiving.org/")
|
|
|
|
| 21 |
st.sidebar.write(
|
| 22 |
"The model used to tag grants is https://huggingface.co/Wellcome/WellcomeBertMesh"
|
| 23 |
)
|
| 24 |
+
st.sidebar.header("Parameters")
|
| 25 |
+
nb_results = st.sidebar.slider(
|
| 26 |
+
"Number of results to display", value=20, min_value=1, max_value=100
|
| 27 |
+
)
|
| 28 |
|
| 29 |
if "grants" not in st.session_state:
|
| 30 |
st.session_state["grants"] = list(srsly.read_jsonl("tagged_grants.jsonl"))
|
|
|
|
| 50 |
st.button(tag, on_click=search, kwargs={"query": tag})
|
| 51 |
results = st.session_state["results"]
|
| 52 |
st.caption(f"Found {len(results)}. Displaying {nb_results}")
|
| 53 |
+
st.download_button(
|
| 54 |
+
"Download results",
|
| 55 |
+
data=pd.DataFrame(results).to_csv(),
|
| 56 |
+
file_name="results.csv",
|
| 57 |
+
mime="text/csv",
|
| 58 |
+
)
|
| 59 |
st.table(results[:nb_results])
|