Spaces:
Build error
Build error
feat: Add emojis to comm text to improve expressiveness
Browse files
app.py
CHANGED
@@ -68,7 +68,7 @@ def generate_plot(
|
|
68 |
model: SentenceTransformer,
|
69 |
tw_user: str
|
70 |
) -> Figure:
|
71 |
-
with st.spinner(text=f"Trying to understand '{tw_user}' tweets..."):
|
72 |
embeddings = embed_text(tws, model)
|
73 |
# encoded_labels = encode_labels(labels)
|
74 |
cluster = hdbscan.HDBSCAN(
|
@@ -77,7 +77,7 @@ def generate_plot(
|
|
77 |
cluster_selection_method='eom'
|
78 |
).fit(embeddings)
|
79 |
encoded_labels = cluster.labels_
|
80 |
-
with st.spinner("Now trying to express them with my own words..."):
|
81 |
embeddings_2d = get_tsne_embeddings(embeddings)
|
82 |
plot = draw_interactive_scatter_plot(
|
83 |
tws, embeddings_2d[:, 0], embeddings_2d[:, 1], encoded_labels, encoded_labels, 'text', 'label'
|
@@ -105,13 +105,13 @@ with col1:
|
|
105 |
with col2:
|
106 |
go_btn = st.button('Visualize')
|
107 |
|
108 |
-
with st.spinner(text="
|
109 |
model = load_model(model_to_use[expected_lang])
|
110 |
|
111 |
if go_btn and tw_user != '':
|
112 |
usr = client.get_user(username=tw_user)
|
113 |
tw_user = tw_user.replace(' ', '')
|
114 |
-
with st.spinner(f"Getting to know the '{tw_user}'..."):
|
115 |
tweets_objs = []
|
116 |
while tw_sample >= 100:
|
117 |
current_sample = min(100, tw_sample)
|
|
|
68 |
model: SentenceTransformer,
|
69 |
tw_user: str
|
70 |
) -> Figure:
|
71 |
+
with st.spinner(text=f"Trying to understand '{tw_user}' tweets... π€"):
|
72 |
embeddings = embed_text(tws, model)
|
73 |
# encoded_labels = encode_labels(labels)
|
74 |
cluster = hdbscan.HDBSCAN(
|
|
|
77 |
cluster_selection_method='eom'
|
78 |
).fit(embeddings)
|
79 |
encoded_labels = cluster.labels_
|
80 |
+
with st.spinner("Now trying to express them with my own words... π¬"):
|
81 |
embeddings_2d = get_tsne_embeddings(embeddings)
|
82 |
plot = draw_interactive_scatter_plot(
|
83 |
tws, embeddings_2d[:, 0], embeddings_2d[:, 1], encoded_labels, encoded_labels, 'text', 'label'
|
|
|
105 |
with col2:
|
106 |
go_btn = st.button('Visualize')
|
107 |
|
108 |
+
with st.spinner(text="Loading brain... π§ "):
|
109 |
model = load_model(model_to_use[expected_lang])
|
110 |
|
111 |
if go_btn and tw_user != '':
|
112 |
usr = client.get_user(username=tw_user)
|
113 |
tw_user = tw_user.replace(' ', '')
|
114 |
+
with st.spinner(f"Getting to know the '{tw_user}'... π"):
|
115 |
tweets_objs = []
|
116 |
while tw_sample >= 100:
|
117 |
current_sample = min(100, tw_sample)
|