Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -189,7 +189,10 @@ if file_text:
|
|
189 |
display_context_table(context_words)
|
190 |
|
191 |
with st.expander("📝 Sentence Clustering"):
|
192 |
-
sentences = [
|
|
|
|
|
|
|
193 |
|
194 |
num_clusters = st.slider("Number of Clusters", min_value=2, max_value=10, value=5)
|
195 |
clustered_sentences = cluster_sentences(sentences, num_clusters)
|
@@ -213,4 +216,11 @@ if file_text:
|
|
213 |
|
214 |
st.text_area("Clustered Sentences", value=clustered_text, height=400)
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
st.markdown("For more information and updates, visit our [help page](https://huggingface.co/awacke1).")
|
|
|
189 |
display_context_table(context_words)
|
190 |
|
191 |
with st.expander("📝 Sentence Clustering"):
|
192 |
+
sentences = [line.strip() for line in text_without_timestamps.split('\n') if len(line.strip()) > 10]
|
193 |
+
|
194 |
+
num_sentences = len(sentences)
|
195 |
+
st.write(f"Total Sentences: {num_sentences}")
|
196 |
|
197 |
num_clusters = st.slider("Number of Clusters", min_value=2, max_value=10, value=5)
|
198 |
clustered_sentences = cluster_sentences(sentences, num_clusters)
|
|
|
216 |
|
217 |
st.text_area("Clustered Sentences", value=clustered_text, height=400)
|
218 |
|
219 |
+
# Verify that all sentences are accounted for in the clustered output
|
220 |
+
clustered_sentences_flat = [sentence for cluster in clustered_sentences for sentence in cluster]
|
221 |
+
if set(sentences) == set(clustered_sentences_flat):
|
222 |
+
st.write("✅ All sentences are accounted for in the clustered output.")
|
223 |
+
else:
|
224 |
+
st.write("❌ Some sentences are missing in the clustered output.")
|
225 |
+
|
226 |
st.markdown("For more information and updates, visit our [help page](https://huggingface.co/awacke1).")
|