nearest neighbours count now starts at 1 instead of 0
Browse files
app.py
CHANGED
|
@@ -20,7 +20,10 @@ if active_tab == "Nearest neighbours":
|
|
| 20 |
with col2:
|
| 21 |
time_slice = st.selectbox("Time slice", ["Archaic", "Classical", "Hellenistic", "Early Roman", "Late Roman"])
|
| 22 |
|
| 23 |
-
models = st.multiselect(
|
|
|
|
|
|
|
|
|
|
| 24 |
n = st.slider("Number of neighbours", 1, 50, 15)
|
| 25 |
|
| 26 |
nearest_neighbours_button = st.button("Find nearest neighbours")
|
|
@@ -49,7 +52,11 @@ if active_tab == "Nearest neighbours":
|
|
| 49 |
|
| 50 |
nearest_neighbours = get_nearest_neighbours(word, time_slice, n, models)
|
| 51 |
|
| 52 |
-
df = pd.DataFrame(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
st.table(df)
|
| 54 |
|
| 55 |
|
|
|
|
| 20 |
with col2:
|
| 21 |
time_slice = st.selectbox("Time slice", ["Archaic", "Classical", "Hellenistic", "Early Roman", "Late Roman"])
|
| 22 |
|
| 23 |
+
models = st.multiselect(
|
| 24 |
+
"Select models to search for neighbours",
|
| 25 |
+
["Archaic", "Classical", "Hellenistic", "Early Roman", "Late Roman"]
|
| 26 |
+
)
|
| 27 |
n = st.slider("Number of neighbours", 1, 50, 15)
|
| 28 |
|
| 29 |
nearest_neighbours_button = st.button("Find nearest neighbours")
|
|
|
|
| 52 |
|
| 53 |
nearest_neighbours = get_nearest_neighbours(word, time_slice, n, models)
|
| 54 |
|
| 55 |
+
df = pd.DataFrame(
|
| 56 |
+
nearest_neighbours,
|
| 57 |
+
columns=["Word", "Time slice", "Similarity"],
|
| 58 |
+
index = range(1, len(nearest_neighbours) + 1)
|
| 59 |
+
)
|
| 60 |
st.table(df)
|
| 61 |
|
| 62 |
|