4kasha commited on
Commit
35ebeb7
1 Parent(s): 66787d8
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -95,10 +95,13 @@ def main():
95
  value=0.22,
96
  help="sparsity of alignment matrix",
97
  )
 
98
  show_assignments = st.sidebar.checkbox("show assignments", value=True)
99
  if show_assignments:
100
  n_neighbors = st.sidebar.slider(
101
- "n_neighbors", 2, 10, value=8, help="number of neighbors for umap"
 
 
102
  )
103
 
104
  # Content
@@ -141,9 +144,10 @@ def main():
141
  fig = plot_align_matrix_heatmap_plotly(align_matrix.T, sent1, sent2, threshhold, cost_matrix.T)
142
  st.plotly_chart(fig, use_container_width=True)
143
 
144
- st.write(f"**Word similarity matrix**")
145
- fig2 = plot_similarity_matrix_heatmap_plotly(similarity_matrix.T, sent1, sent2, cost_matrix.T)
146
- st.plotly_chart(fig2, use_container_width=True)
 
147
 
148
  if show_assignments:
149
  st.write(f"**Alignments after UMAP**")
 
95
  value=0.22,
96
  help="sparsity of alignment matrix",
97
  )
98
+ show_similarity = st.sidebar.checkbox("show similarity matrix", value=True)
99
  show_assignments = st.sidebar.checkbox("show assignments", value=True)
100
  if show_assignments:
101
  n_neighbors = st.sidebar.slider(
102
+ "n_neighbors (see [details](https://umap-learn.readthedocs.io/en/latest/parameters.html#n-neighbors).)",
103
+ 2, 15, value=8,
104
+ help="number of nearest neighbors for umap balancing between the preservation of local and global structures"
105
  )
106
 
107
  # Content
 
144
  fig = plot_align_matrix_heatmap_plotly(align_matrix.T, sent1, sent2, threshhold, cost_matrix.T)
145
  st.plotly_chart(fig, use_container_width=True)
146
 
147
+ if show_similarity:
148
+ st.write(f"**Word similarity matrix**")
149
+ fig2 = plot_similarity_matrix_heatmap_plotly(similarity_matrix.T, sent1, sent2, cost_matrix.T)
150
+ st.plotly_chart(fig2, use_container_width=True)
151
 
152
  if show_assignments:
153
  st.write(f"**Alignments after UMAP**")