Spaces:
Build error
Build error
feat: Ignore non-topic detected tweets and words
Browse files
app.py
CHANGED
@@ -105,7 +105,7 @@ def draw_interactive_scatter_plot(
|
|
105 |
Palette = AuxPallete
|
106 |
p = figure(plot_width=800, plot_height=800, tools=[hover], title='2D visualization of tweets', background_fill_color="#fafafa")
|
107 |
colors = factor_cmap("label", palette=[Pallete[n_colors][int(id_) + 1] for id_ in values_set], factors=values_set)
|
108 |
-
p.circle("x", "y", size=12, source=source, fill_alpha=0.4, line_color=colors, fill_color=colors, legend_group="
|
109 |
p.axis.visible = False
|
110 |
p.xgrid.grid_line_dash = "dashed"
|
111 |
p.ygrid.grid_line_dash = "dashed"
|
@@ -141,6 +141,9 @@ def generate_plot(
|
|
141 |
cluster_keyword = {}
|
142 |
with st.spinner("Now trying to express them with my own words... 💬"):
|
143 |
for label in set(encoded_labels):
|
|
|
|
|
|
|
144 |
cluster_keyword[label] = []
|
145 |
cluster_tws = []
|
146 |
for ix, obs in enumerate(encoded_labels):
|
|
|
105 |
Palette = AuxPallete
|
106 |
p = figure(plot_width=800, plot_height=800, tools=[hover], title='2D visualization of tweets', background_fill_color="#fafafa")
|
107 |
colors = factor_cmap("label", palette=[Pallete[n_colors][int(id_) + 1] for id_ in values_set], factors=values_set)
|
108 |
+
p.circle("x", "y", size=12, source=source, fill_alpha=0.4, line_color=colors, fill_color=colors, legend_group="original_label")
|
109 |
p.axis.visible = False
|
110 |
p.xgrid.grid_line_dash = "dashed"
|
111 |
p.ygrid.grid_line_dash = "dashed"
|
|
|
141 |
cluster_keyword = {}
|
142 |
with st.spinner("Now trying to express them with my own words... 💬"):
|
143 |
for label in set(encoded_labels):
|
144 |
+
if label == '-1':
|
145 |
+
cluster_keyword[label] = '-1'
|
146 |
+
continue
|
147 |
cluster_keyword[label] = []
|
148 |
cluster_tws = []
|
149 |
for ix, obs in enumerate(encoded_labels):
|