diff --git a/src/server/src/worker/TopicWorker.ts b/src/server/src/worker/TopicWorker.ts index bbf070f9..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) => { @@ -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} `); @@ -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); }