From 1a4a51e958e156987183e9f839ca3387c8ec6c80 Mon Sep 17 00:00:00 2001 From: noodleofdeath Date: Wed, 11 Oct 2023 08:14:24 -0400 Subject: [PATCH 1/2] topics --- src/server/src/worker/TopicWorker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/src/worker/TopicWorker.ts b/src/server/src/worker/TopicWorker.ts index bbf070f9..32df61d1 100644 --- a/src/server/src/worker/TopicWorker.ts +++ b/src/server/src/worker/TopicWorker.ts @@ -58,7 +58,7 @@ export async function doWork() { console.log(); const chatService = new OpenAIService(); const yesOrNo = await chatService.send(` - Are the following articles about the same specific topic? Please respond only with YES or NO: + Are the following articles about the same exact topic? Please respond only with YES or NO: [Article 1] ${summary.title}: ${summary.shortSummary} [Article 2] ${possibleSibling.title}: ${possibleSibling.shortSummary} `); From 0a478f0e11b95b629e8b195aacbe88af818f49fc Mon Sep 17 00:00:00 2001 From: NoodleOfDeath Date: Wed, 11 Oct 2023 08:18:48 -0400 Subject: [PATCH 2/2] topics --- src/server/src/worker/TopicWorker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/src/worker/TopicWorker.ts b/src/server/src/worker/TopicWorker.ts index 32df61d1..f65325d4 100644 --- a/src/server/src/worker/TopicWorker.ts +++ b/src/server/src/worker/TopicWorker.ts @@ -30,12 +30,12 @@ export async function doWork() { where: { originalDate: { [Op.gt]: new Date(Date.now() - ms(DUPLICATE_LOOKBACK_INTERVAL)) } }, }); for (const summary of summaries) { - console.log('checking', summary.id); + console.log('finding siblings for', summary.id); const siblings: Summary[] = []; const words = summary.title.replace(/[ \W]+/g, ' ').split(' ').map((w) => w); const existingSiblings = await summary.getSiblings(); const filteredSummaries = summaries.filter((s) => s.id !== summary.id && !existingSiblings.includes(s.id)); - console.log('filters summaries', filteredSummaries.length); + console.log('filtered summaries', filteredSummaries.length); for (const possibleSibling of filteredSummaries) { const siblingWords = possibleSibling.title.replace(/[ \W]+/g, ' ').split(' ').map((w) => w); const score = words.map((a) => { @@ -67,7 +67,7 @@ export async function doWork() { } } } - console.log('linking for', summary.id); + console.log('making associations for', summary.id); for (const sibling of siblings) { await summary.associateWith(sibling); }