Spaces:
Build error
Build error
test: Lower perplexity to test number of topics created
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def embed_text(text: List[str], model: SentenceTransformer) -> np.ndarray:
|
|
32 |
return model.encode(text)
|
33 |
|
34 |
def get_tsne_embeddings(
|
35 |
-
embeddings: np.ndarray, perplexity: int =
|
36 |
) -> np.ndarray:
|
37 |
tsne = TSNE(perplexity=perplexity, n_components=n_components, init=init, n_iter=n_iter, random_state=random_state)
|
38 |
return tsne.fit_transform(embeddings)
|
|
|
32 |
return model.encode(text)
|
33 |
|
34 |
def get_tsne_embeddings(
|
35 |
+
embeddings: np.ndarray, perplexity: int = 10, n_components: int = 2, init: str = "pca", n_iter: int = 5000, random_state: int = SEED
|
36 |
) -> np.ndarray:
|
37 |
tsne = TSNE(perplexity=perplexity, n_components=n_components, init=init, n_iter=n_iter, random_state=random_state)
|
38 |
return tsne.fit_transform(embeddings)
|