Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,44 @@ DATA_FILE = "data/gwf_2017-2021_specter2_base.json"
|
|
10 |
THEMES = {"cluster": "fall", "year": "mint", "source": "phase"}
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
def to_string_authors(list_of_authors):
|
14 |
if len(list_of_authors) > 6:
|
15 |
return ", ".join(list_of_authors[:6]) + ", et al."
|
@@ -115,4 +153,4 @@ fig.update_layout(
|
|
115 |
fig.update_xaxes(title="")
|
116 |
fig.update_yaxes(title="")
|
117 |
|
118 |
-
st.plotly_chart(fig, use_container_width=True)
|
|
|
10 |
THEMES = {"cluster": "fall", "year": "mint", "source": "phase"}
|
11 |
|
12 |
|
13 |
+
st.markdown(
|
14 |
+
"""
|
15 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-DF7Zhf293AJxJNTmh5zhoYYIMs2oXitRfBjY+9L//AY=" crossorigin="anonymous">
|
16 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
17 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
18 |
+
<link href="https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap" rel="stylesheet">
|
19 |
+
|
20 |
+
<style>
|
21 |
+
.title {
|
22 |
+
font-family: 'Permanent Marker', cursive;
|
23 |
+
font-size: 2.0rem;
|
24 |
+
}
|
25 |
+
</style>""",
|
26 |
+
unsafe_allow_html=True,
|
27 |
+
)
|
28 |
+
|
29 |
+
st.sidebar.write(
|
30 |
+
"""<center><p class="title">
|
31 |
+
gwf-spectrum
|
32 |
+
</p></center>""",
|
33 |
+
unsafe_allow_html=True,
|
34 |
+
)
|
35 |
+
st.sidebar.write(
|
36 |
+
"""<p class="text-justify">
|
37 |
+
An interactive t-SNE visualization featuring over 1K papers (titles and abstracts), sourced from the
|
38 |
+
<a href="https://gwf-uwaterloo.github.io/gwf-publications/">Global Water Futures</a> program,
|
39 |
+
embedded via
|
40 |
+
<a href="https://huggingface.co/allenai/specter2_base">spectre2</a>.
|
41 |
+
For more information, check out our step-by-step guide: <a href="https://huggingface.co/spaces/gwf-uwaterloo/acl-spectrum/blob/main/scipapers_scatter.ipynb">here</a>.
|
42 |
+
</p>""",
|
43 |
+
unsafe_allow_html=True,
|
44 |
+
)
|
45 |
+
|
46 |
+
st.sidebar.markdown(
|
47 |
+
"Happy exploring! :rocket::rocket:"
|
48 |
+
)
|
49 |
+
|
50 |
+
|
51 |
def to_string_authors(list_of_authors):
|
52 |
if len(list_of_authors) > 6:
|
53 |
return ", ".join(list_of_authors[:6]) + ", et al."
|
|
|
153 |
fig.update_xaxes(title="")
|
154 |
fig.update_yaxes(title="")
|
155 |
|
156 |
+
st.plotly_chart(fig, use_container_width=True)
|