jfataphd commited on
Commit
40d4151
·
1 Parent(s): 6ea76b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -258,17 +258,17 @@ if query:
258
  # Add circles for the top 50 similar words
259
  fig.add_trace(go.Scatter(x=X_top[:, 0], y=X_top[:, 1], mode='markers',
260
  marker=dict(size=2, color=sims_query_top, colorscale='RdYlGn', symbol='circle'),
261
- text=words, customdata=sims, name='', layer='below'))
262
 
263
  # Represent query as a large red diamond
264
  fig.add_trace(go.Scatter(x=[model.wv[query][0]], y=[model.wv[query][1]], mode='markers',
265
  marker=dict(size=12, color='black', symbol='diamond'), name=query, hovertext=query,
266
- showlegend=False, layer='above'))
267
 
268
  # Add label for the query above the diamond
269
  fig.add_trace(go.Scatter(x=[model.wv[query][0]], y=[model.wv[query][1]], mode='text', text=[query],
270
  textposition='top right', textfont=dict(color='blue', size=10), hoverinfo='none',
271
- showlegend=False))
272
 
273
  fig.update(layout_coloraxis_showscale=True)
274
  fig.update_layout(autosize=True, paper_bgcolor="#CCFFFF", margin=dict(t=0, b=0, l=0, r=0))
@@ -276,7 +276,6 @@ if query:
276
 
277
  st.plotly_chart(fig, use_container_width=True)
278
 
279
-
280
  st.markdown(
281
  f"<b><p style='font-family: Arial; font-size: 20px; font-style: Bold;'>Top <span style='color:red; font-style: italic;'>{value_word} "
282
  f"</span>words contextually and semantically similar to "
 
258
  # Add circles for the top 50 similar words
259
  fig.add_trace(go.Scatter(x=X_top[:, 0], y=X_top[:, 1], mode='markers',
260
  marker=dict(size=2, color=sims_query_top, colorscale='RdYlGn', symbol='circle'),
261
+ text=words, customdata=sims, name='', z=1))
262
 
263
  # Represent query as a large red diamond
264
  fig.add_trace(go.Scatter(x=[model.wv[query][0]], y=[model.wv[query][1]], mode='markers',
265
  marker=dict(size=12, color='black', symbol='diamond'), name=query, hovertext=query,
266
+ showlegend=False, z=2))
267
 
268
  # Add label for the query above the diamond
269
  fig.add_trace(go.Scatter(x=[model.wv[query][0]], y=[model.wv[query][1]], mode='text', text=[query],
270
  textposition='top right', textfont=dict(color='blue', size=10), hoverinfo='none',
271
+ showlegend=False, z=3))
272
 
273
  fig.update(layout_coloraxis_showscale=True)
274
  fig.update_layout(autosize=True, paper_bgcolor="#CCFFFF", margin=dict(t=0, b=0, l=0, r=0))
 
276
 
277
  st.plotly_chart(fig, use_container_width=True)
278
 
 
279
  st.markdown(
280
  f"<b><p style='font-family: Arial; font-size: 20px; font-style: Bold;'>Top <span style='color:red; font-style: italic;'>{value_word} "
281
  f"</span>words contextually and semantically similar to "