From 91ffbc467e50403bef6b0ce44f0f9adaf547ba44 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Sun, 11 May 2025 09:26:37 +0200 Subject: [PATCH] uncommented code from main --- src/utils/bleu.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/utils/bleu.js b/src/utils/bleu.js index 7f8aa35..aa94411 100644 --- a/src/utils/bleu.js +++ b/src/utils/bleu.js @@ -98,19 +98,18 @@ export function bleu(refSentence, candSentence, maxN = 4, smooth = false) { return bp * geoMean; } -// Example usage: - +// if __name__ == "__main__" if (process.argv[1] === import.meta.filename) { const test_pairs = [ - // ["the cat is on the mat", "the cat is on the mat"], - // ["the cat is on the mat", "the the the the the the the"], - // ["the cat is on the mat", "the cat on the mat"], - // ["the cat is on the mat", "the cat is on the"], - // ["the cat is on the mat", "foo bar baz qux"], - // [ - // "The quick brown fox jumps over the lazy dog", - // "The quick brown dog jumps over the lazy fox", - // ], + ["the cat is on the mat", "the cat is on the mat"], + ["the cat is on the mat", "the the the the the the the"], + ["the cat is on the mat", "the cat on the mat"], + ["the cat is on the mat", "the cat is on the"], + ["the cat is on the mat", "foo bar baz qux"], + [ + "The quick brown fox jumps over the lazy dog", + "The quick brown dog jumps over the lazy fox", + ], [ "This could be `static` to prevent any funkiness, i.e. attempting to use class state during the constructor or similar.", "This could be `static` to prevent any funkiness, i.e. attempting to use class state during the constructor or similar.",