wilmerags commited on
Commit
2e82d12
·
1 Parent(s): 20c61de

fix: Adapt labels creation with interactive plot implementation

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -41,8 +41,6 @@ def draw_interactive_scatter_plot(
41
  texts: np.ndarray, xs: np.ndarray, ys: np.ndarray, values: np.ndarray, labels: np.ndarray, text_column: str, label_column: str
42
  ) -> Figure:
43
  # Normalize values to range between 0-255, to assign a color for each value
44
- values = np.array(values)
45
- labels = np.array(labels)
46
  max_value = values.max()
47
  min_value = values.min()
48
  if max_value - min_value == 0:
@@ -80,7 +78,7 @@ def generate_plot(
80
  with st.spinner("Reducing dimensionality..."):
81
  embeddings_2d = get_tsne_embeddings(embeddings)
82
  plot = draw_interactive_scatter_plot(
83
- df, embeddings_2d[:, 0], embeddings_2d[:, 1], encoded_labels, labels, 'text', 'label'
84
  )
85
  return plot
86
 
 
41
  texts: np.ndarray, xs: np.ndarray, ys: np.ndarray, values: np.ndarray, labels: np.ndarray, text_column: str, label_column: str
42
  ) -> Figure:
43
  # Normalize values to range between 0-255, to assign a color for each value
 
 
44
  max_value = values.max()
45
  min_value = values.min()
46
  if max_value - min_value == 0:
 
78
  with st.spinner("Reducing dimensionality..."):
79
  embeddings_2d = get_tsne_embeddings(embeddings)
80
  plot = draw_interactive_scatter_plot(
81
+ df, embeddings_2d[:, 0], embeddings_2d[:, 1], encoded_labels, encoded_labels, 'text', 'label'
82
  )
83
  return plot
84