Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -229,8 +229,8 @@ def extract_problem_domains(df,
|
|
| 229 |
text_column='Problem_Description',
|
| 230 |
cluster_range=(10, 50),
|
| 231 |
top_words=17,
|
| 232 |
-
method='sentence_transformers'
|
| 233 |
-
|
| 234 |
):
|
| 235 |
|
| 236 |
|
|
@@ -264,7 +264,7 @@ def extract_problem_domains(df,
|
|
| 264 |
# Perform K-Means clustering with Silhouette Analysis
|
| 265 |
silhouette_scores = []
|
| 266 |
for n_clusters in range(cluster_range[0], cluster_range[1] + 1):
|
| 267 |
-
|
| 268 |
cluster_labels = kmeans.fit_predict(X)
|
| 269 |
silhouette_avg = silhouette_score(X, cluster_labels)
|
| 270 |
silhouette_scores.append(silhouette_avg)
|
|
|
|
| 229 |
text_column='Problem_Description',
|
| 230 |
cluster_range=(10, 50),
|
| 231 |
top_words=17,
|
| 232 |
+
# method='sentence_transformers'
|
| 233 |
+
method='tfidf_kmeans'
|
| 234 |
):
|
| 235 |
|
| 236 |
|
|
|
|
| 264 |
# Perform K-Means clustering with Silhouette Analysis
|
| 265 |
silhouette_scores = []
|
| 266 |
for n_clusters in range(cluster_range[0], cluster_range[1] + 1):
|
| 267 |
+
kmeans = KMeans(n_clusters=n_clusters)#, random_state=42)
|
| 268 |
cluster_labels = kmeans.fit_predict(X)
|
| 269 |
silhouette_avg = silhouette_score(X, cluster_labels)
|
| 270 |
silhouette_scores.append(silhouette_avg)
|