removed console.logs

This commit is contained in:
Karma Riuk
2025-05-10 22:00:32 +02:00
parent 719e127019
commit 644b560ad6

View File

@ -20,7 +20,7 @@ export const evaluate_comments = async (answers, percent_cb, finished_cb) => {
let i = 0; let i = 0;
const results = {}; const results = {};
for (const [id, generated_comment] of Object.entries(answers)) { for (const [id, generated_comment] of Object.entries(answers)) {
console.log(`Processing ${id}...`); // console.log(`Processing ${i} ${id}...`);
if (!(id in REFERENCE_MAP)) { if (!(id in REFERENCE_MAP)) {
// throw new Error(`id: "${id}" is not present in the dataset`); // throw new Error(`id: "${id}" is not present in the dataset`);
console.error(`id: "${id}" is not present in the dataset`); console.error(`id: "${id}" is not present in the dataset`);
@ -34,19 +34,14 @@ export const evaluate_comments = async (answers, percent_cb, finished_cb) => {
const score = bleu(paraphrase, generated_comment, 4); // TODO: ask prof what number show be here const score = bleu(paraphrase, generated_comment, 4); // TODO: ask prof what number show be here
scores.push(score); scores.push(score);
maxScore = Math.max(score, maxScore); maxScore = Math.max(score, maxScore);
console.log(`bleu score: ${score}`);
} }
results[id] = { results[id] = {
"max bleu score": maxScore, "max bleu score": maxScore,
"bleu scores": scores, "bleu scores": scores,
"proposed comment": generated_comment, "proposed comment": generated_comment,
}; };
console.log(`Max bleu score: ${maxScore}`);
console.log(`Done with ${id}`);
percent_cb(Math.floor((++i / total) * 100)); percent_cb(Math.floor((++i / total) * 100));
} }
console.log("Done processing comments!");
finished_cb(results); finished_cb(results);
}; };