You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Name a cluster using the default prompt. Calls the Cohere generate end-point to assign a name to the cluster.
19
+
20
+
Parameters
21
+
----------
22
+
co: Python cohere SDK object
23
+
prompt: str
24
+
The text prompt the generative model uses to name a cluster
25
+
num_generations: int
26
+
The number of candidate generations to get for each cluster. Multiple generations can enhance the quality of cluster names.
27
+
temperature: float
28
+
Typically between 0-1, the temperature value used to control the randomness of the generation model. Lower values lead to more predictable, less "creative" names.
29
+
30
+
"""
17
31
self.co=co
18
32
self.prompt=prompt
19
33
self.num_generations=num_generations
20
34
self.temperature=temperature
21
35
22
36
defmake_prompt(self, cluster_example_texts):
37
+
"""
38
+
Prepare the naming prompt by adding examples from a single cluster to the prompt.
39
+
40
+
Parameters
41
+
----------
42
+
cluster_example_texts: array-like of strings
43
+
A collection of texts belonging to a single cluster/topic. They are added to the naming prompt
44
+
45
+
Returns
46
+
-------
47
+
prompt: str
48
+
The naming prompt including the examples from this cluster
49
+
50
+
"""
23
51
# Add the data of the current cluster we want to label
0 commit comments