Last active
May 19, 2022 03:22
-
-
Save ZhangzihanGit/7966c5d24400e04ed0acedc4cb7f96cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if reduce_size: | |
# reduce embedding dimensionality | |
embeddings = UMAP(n_neighbors=15, | |
n_components=10, | |
min_dist=0.0, | |
metric='cosine', | |
random_state=42 | |
).fit_transform(embeddings) | |
# clustering, here we set 5 clusters, i.e. 5 topics | |
kmeans = KMeans(5) | |
documents = kmeans.fit(embeddings) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment