@lokalise/ragnarok-api-contracts 2.0.0 → 2.1.0
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-contracts.d.ts +18 -1
- package/dist/objects.d.ts +54 -1
- package/dist/objects.js +37 -4
- package/dist/objects.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,24 @@ export declare const getEvaluation: import("@lokalise/api-contracts").GetRouteDe
|
|
|
11
11
|
completed: "completed";
|
|
12
12
|
failed: "failed";
|
|
13
13
|
}>;
|
|
14
|
-
|
|
14
|
+
resultByConfigurationName: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
15
|
+
global: z.ZodObject<{
|
|
16
|
+
referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
actualTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
}, z.core.$catchall<z.ZodObject<{
|
|
24
|
+
referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
actualTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$strip>>>>>;
|
|
31
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
15
32
|
}, z.core.$strip>, z.ZodObject<{
|
|
16
33
|
evaluationId: z.ZodUUID;
|
|
17
34
|
}, z.core.$strip>, undefined, z.ZodObject<{
|
package/dist/objects.d.ts
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const CONFIGURATION_RESULT_SCHEMA: z.ZodObject<{
|
|
3
|
+
global: z.ZodObject<{
|
|
4
|
+
referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
actualTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
}, z.core.$catchall<z.ZodObject<{
|
|
12
|
+
referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
actualTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strip>>>;
|
|
19
|
+
export type ConfigurationResult = z.infer<typeof CONFIGURATION_RESULT_SCHEMA>;
|
|
20
|
+
export declare const RESULT_BY_CONFIGURATION_NAME_SCHEMA: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
21
|
+
global: z.ZodObject<{
|
|
22
|
+
referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
actualTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
}, z.core.$catchall<z.ZodObject<{
|
|
30
|
+
referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
actualTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strip>>>>;
|
|
37
|
+
export type ResultByConfigurationName = z.infer<typeof RESULT_BY_CONFIGURATION_NAME_SCHEMA>;
|
|
2
38
|
export declare const EVALUATION_SCHEMA: z.ZodObject<{
|
|
3
39
|
id: z.ZodUUID;
|
|
4
40
|
ownerId: z.ZodString;
|
|
@@ -7,6 +43,23 @@ export declare const EVALUATION_SCHEMA: z.ZodObject<{
|
|
|
7
43
|
completed: "completed";
|
|
8
44
|
failed: "failed";
|
|
9
45
|
}>;
|
|
10
|
-
|
|
46
|
+
resultByConfigurationName: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
47
|
+
global: z.ZodObject<{
|
|
48
|
+
referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
actualTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
}, z.core.$catchall<z.ZodObject<{
|
|
56
|
+
referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
actualTranslationScore: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, z.core.$strip>>>>>;
|
|
63
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
64
|
}, z.core.$strip>;
|
|
12
65
|
export type Evaluation = z.infer<typeof EVALUATION_SCHEMA>;
|
package/dist/objects.js
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
const METRICS_SCHEMA = z.object({
|
|
3
|
+
referenceTranslationScore: z
|
|
4
|
+
.number()
|
|
5
|
+
.optional()
|
|
6
|
+
.describe('Average LQA score of reference translations'),
|
|
7
|
+
actualTranslationScore: z
|
|
8
|
+
.number()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Average LQA score of actual (generated) translations'),
|
|
11
|
+
perfectMatch: z
|
|
12
|
+
.number()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Rate of translations that exactly match the reference (0–1)'),
|
|
15
|
+
translationErrorRate: z
|
|
16
|
+
.number()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('TER score measuring post-editing effort relative to reference length'),
|
|
19
|
+
bleu: z
|
|
20
|
+
.number()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('BLEU score measuring n-gram overlap with reference translations'),
|
|
23
|
+
meteor: z.number().optional().describe('METEOR score measuring translation quality'),
|
|
24
|
+
});
|
|
25
|
+
export const CONFIGURATION_RESULT_SCHEMA = z
|
|
26
|
+
.object({
|
|
27
|
+
global: METRICS_SCHEMA.describe('Aggregated metrics across all language pairs for this configuration'),
|
|
28
|
+
})
|
|
29
|
+
.catchall(METRICS_SCHEMA)
|
|
30
|
+
.describe('Metrics keyed by language pair (e.g. "en->pl") plus a "global" aggregate');
|
|
31
|
+
export const RESULT_BY_CONFIGURATION_NAME_SCHEMA = z
|
|
32
|
+
.record(z.string(), CONFIGURATION_RESULT_SCHEMA)
|
|
33
|
+
.describe('Evaluation results grouped by configuration name');
|
|
2
34
|
export const EVALUATION_SCHEMA = z.object({
|
|
3
|
-
id: z.uuid(),
|
|
4
|
-
ownerId: z.string(),
|
|
5
|
-
status: z.enum(['pending', 'completed', 'failed']),
|
|
6
|
-
|
|
35
|
+
id: z.uuid().describe('Unique identifier of the evaluation request'),
|
|
36
|
+
ownerId: z.string().describe('Owner identifier (team ID or similar) for this evaluation'),
|
|
37
|
+
status: z.enum(['pending', 'completed', 'failed']).describe('Current status of the evaluation'),
|
|
38
|
+
resultByConfigurationName: RESULT_BY_CONFIGURATION_NAME_SCHEMA.nullable(),
|
|
39
|
+
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
7
40
|
});
|
|
8
41
|
//# sourceMappingURL=objects.js.map
|
package/dist/objects.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../src/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../src/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,yBAAyB,EAAE,CAAC;SACzB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,6CAA6C,CAAC;IAC1D,sBAAsB,EAAE,CAAC;SACtB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,sDAAsD,CAAC;IACnE,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ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