@vertana/core 0.1.0-dev.8 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evaluation.cjs +4 -3
- package/dist/evaluation.js +4 -3
- package/package.json +1 -1
package/dist/evaluation.cjs
CHANGED
|
@@ -24,7 +24,7 @@ const issueSchema = zod.z.object({
|
|
|
24
24
|
}).optional()
|
|
25
25
|
});
|
|
26
26
|
const evaluationResultSchema = zod.z.object({
|
|
27
|
-
score: zod.z.number()
|
|
27
|
+
score: zod.z.number(),
|
|
28
28
|
issues: zod.z.array(issueSchema)
|
|
29
29
|
});
|
|
30
30
|
/**
|
|
@@ -106,12 +106,13 @@ async function evaluate(model, original, translated, options) {
|
|
|
106
106
|
description: issue.description,
|
|
107
107
|
location: issue.location
|
|
108
108
|
}));
|
|
109
|
+
const score = Math.max(0, Math.min(1, result.object.score));
|
|
109
110
|
logger.debug("Evaluation result: score {score}, {issueCount} issue(s).", {
|
|
110
|
-
score
|
|
111
|
+
score,
|
|
111
112
|
issueCount: issues.length
|
|
112
113
|
});
|
|
113
114
|
return {
|
|
114
|
-
score
|
|
115
|
+
score,
|
|
115
116
|
issues
|
|
116
117
|
};
|
|
117
118
|
}
|
package/dist/evaluation.js
CHANGED
|
@@ -23,7 +23,7 @@ const issueSchema = z.object({
|
|
|
23
23
|
}).optional()
|
|
24
24
|
});
|
|
25
25
|
const evaluationResultSchema = z.object({
|
|
26
|
-
score: z.number()
|
|
26
|
+
score: z.number(),
|
|
27
27
|
issues: z.array(issueSchema)
|
|
28
28
|
});
|
|
29
29
|
/**
|
|
@@ -105,12 +105,13 @@ async function evaluate(model, original, translated, options) {
|
|
|
105
105
|
description: issue.description,
|
|
106
106
|
location: issue.location
|
|
107
107
|
}));
|
|
108
|
+
const score = Math.max(0, Math.min(1, result.object.score));
|
|
108
109
|
logger.debug("Evaluation result: score {score}, {issueCount} issue(s).", {
|
|
109
|
-
score
|
|
110
|
+
score,
|
|
110
111
|
issueCount: issues.length
|
|
111
112
|
});
|
|
112
113
|
return {
|
|
113
|
-
score
|
|
114
|
+
score,
|
|
114
115
|
issues
|
|
115
116
|
};
|
|
116
117
|
}
|