From f9f0cf263178aa040842634960c22ccf133ec955 Mon Sep 17 00:00:00 2001 From: victor barbier Date: Tue, 4 Jun 2024 11:25:13 +0200 Subject: [PATCH] feat(networks): add weights topics for ia labelling --- client/src/api/networks/network/mistralai.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/api/networks/network/mistralai.ts b/client/src/api/networks/network/mistralai.ts index 62082a86..79cc9a26 100644 --- a/client/src/api/networks/network/mistralai.ts +++ b/client/src/api/networks/network/mistralai.ts @@ -11,7 +11,7 @@ async function mistralLabelsFromDomains(domains: string): Promise { role: "user", content: ` You have been tasked with naming distinct fields of study for several communities of research publications. - Below are lists of topics representing each community. + Below are lists of topics and their weights representing each community. Your goal is to provide a unique and descriptive name for each field of study that best encapsulates the essence of the topics within that community. Each name should be unique and as short as possible. Output as JSON object with the list number and the single generated name. @@ -43,7 +43,7 @@ export async function openAiLabeledClusters(clusters: NetworkCommunities): Promi const topDomains = Object.entries(cluster.domains) .sort((a: [string, number], b: [string, number]) => b[1] - a[1]) .slice(0, 10) - .map(([domain]) => `${domain}`) + .map(([domain, count]) => `${domain} (${count})`) .join(", ") acc = acc + `${prefix}${index + 1} = [${topDomains}], `