jsonschema_bench_easy.yaml 11.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
tag:
  - jsonschema_bench
task: jsonschema_bench_easy
dataset_path: epfl-dlab/JSONSchemaBench
dataset_name: Github_easy
training_split: train
validation_split: valid
test_split: test
description: "Generate a JSON object that matches the following JSON schema."
doc_to_text: 'JSON schema: {{json_schema}}\n\nJSON object: '
doc_to_target: '{{json_object if json_object is defined else json_schema}}' # here we use the json_schema as the target at test time for evaluation
output_type: generate_until
metric_list:
  - metric: !function metrics.json_validity
    aggregation: mean
    higher_is_better: True
  - metric: !function metrics.schema_compliance
    aggregation: mean
    higher_is_better: True
metadata:
  version: 0.1
fewshot_split: null
num_fewshot: 2
fewshot_config:
  sampler: first_n
  samples:
  - json_schema: "{
      \"$schema\": \"http://json-schema.org/draft-04/schema#\",
      \"definitions\": {
          \"address1\": {
              \"type\": \"string\"
          },
          \"address2\": {
              \"type\": \"string\"
          },
          \"city\": {
              \"type\": \"string\"
          },
          \"country\": {
              \"type\": \"string\"
          },
          \"postalCode\": {
              \"type\": \"string\"
          },
          \"state\": {
              \"type\": \"string\"
          }
      },
      \"description\": \"A simple address schema\",
      \"properties\": {
          \"address1\": {
              \"$ref\": \"#/definitions/address1\"
          },
          \"address2\": {
              \"$ref\": \"#/definitions/address2\"
          },
          \"city\": {
              \"$ref\": \"#/definitions/city\"
          },
          \"country\": {
              \"$ref\": \"#/definitions/country\"
          },
          \"postalCode\": {
              \"$ref\": \"#/definitions/postalCode\"
          },
          \"state\": {
              \"$ref\": \"#/definitions/state\"
          }
      },
      \"type\": \"object\"
    }"
    json_object: "{
      \"address1\": \"123 Main Street\",
      \"address2\": \"Apt 4B\",
      \"city\": \"Seattle\",
      \"country\": \"USA\",
      \"postalCode\": \"98101\",
      \"state\": \"WA\"
    }"
  - json_schema: "{
      \"$schema\": \"http://json-schema.org/draft-06/schema#\",
      \"definitions\": {
          \"ElementType\": {
              \"enum\": [
                  \"component\",
                  \"directive\"
              ],
              \"type\": \"string\"
          },
          \"SelectorChange\": {
              \"properties\": {
                  \"remove\": {
                      \"description\": \"Remove directive/component\",
                      \"type\": \"boolean\"
                  },
                  \"replaceWith\": {
                      \"description\": \"Replace original selector with new one\",
                      \"type\": \"string\"
                  },
                  \"selector\": {
                      \"description\": \"Original selector to apply change to\",
                      \"type\": \"string\"
                  },
                  \"type\": {
                      \"$ref\": \"#/definitions/ElementType\",
                      \"description\": \"Type of selector the change applies to - either component or directive\"
                  }
              },
              \"required\": [
                  \"selector\",
                  \"type\"
              ],
              \"type\": \"object\"
          }
      },
      \"properties\": {
          \"changes\": {
              \"description\": \"An array of changes to component/directive selectors\",
              \"items\": {
                  \"$ref\": \"#/definitions/SelectorChange\"
              },
              \"type\": \"array\"
          }
      },
      \"required\": [
          \"changes\"
      ],
      \"type\": \"object\"
    }"
    json_object: "{
      \"changes\": [
          {
              \"selector\": \"app-root\",
              \"type\": \"component\",
              \"remove\": false,
              \"replaceWith\": \"new-root\"
          },
          {
              \"selector\": \"my-directive\",
              \"type\": \"directive\",
              \"remove\": true,
              \"replaceWith\": \"new-directive\"
          }
      ]
    }"
  - json_schema: "{
      \"additionalProperties\": false,
      \"description\": \"Schema for tracking e-commerce transaction details and metadata.\",
      \"properties\": {
        \"store\": {
          \"description\": \"The store or seller associated with the transaction.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"discountCode\": {
          \"description\": \"Promotional code applied to the transaction.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"currencyCode\": {
          \"description\": \"ISO 4217 currency code for the transaction.\",
          \"maxLength\": 3,
          \"minLength\": 3,
          \"type\": \"string\"
        },
        \"transactionId\": {
          \"description\": \"Unique identifier for the transaction.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"productList\": {
          \"description\": \"Identifier for the product list from which the purchase was made.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"purchaseOption\": {
          \"description\": \"Additional purchase options or preferences.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"totalAmount\": {
          \"description\": \"Total revenue generated from the transaction.\",
          \"multipleOf\": 0.01,
          \"type\": \"number\"
        },
        \"deliveryCharge\": {
          \"description\": \"Shipping cost associated with the order.\",
          \"multipleOf\": 0.01,
          \"type\": \"number\"
        },
        \"processStep\": {
          \"description\": \"Current step in the purchase or checkout process.\",
          \"maximum\": 2147483647,
          \"minimum\": 0,
          \"type\": \"integer\"
        },
        \"taxAmount\": {
          \"description\": \"Total tax applied to the transaction.\",
          \"multipleOf\": 0.01,
          \"type\": \"number\"
        }
      },
      \"self\": {
        \"format\": \"jsonschema\",
        \"name\": \"transactionDataObject\",
        \"vendor\": \"com.ecommerce.analytics.tracking\",
        \"version\": \"1-0-0\"
      },
      \"type\": \"object\"
    }"
    json_object: "{
      \"asset_id\": \"minecraft:trim_pattern\",
      \"description\": {
          \"color\": \"#FFAA00\",
          \"translate\": \"trim_pattern.description\"
      },
      \"template_item\": \"minecraft:template_item\"
    }"
  - json_schema: "{
      \"$comment\": \"https://minecraft.fandom.com/wiki/Data_Pack\",
      \"$id\": \"https://json.schemastore.org/minecraft-damage-type.json\",
      \"$schema\": \"http://json-schema.org/draft-07/schema#\",
      \"description\": \"A damage type's for a Minecraft data pack config schema\",
      \"properties\": {
          \"death_message_type\": {
              \"enum\": [
                  \"default\",
                  \"fall_variants\",
                  \"intentional_game_design\"
              ],
              \"type\": \"string\"
          },
          \"effects\": {
              \"enum\": [
                  \"hurt\",
                  \"thorns\",
                  \"drowning\",
                  \"burning\",
                  \"poking\",
                  \"freezing\"
              ],
              \"type\": \"string\"
          },
          \"exhaustion\": {
              \"type\": \"number\"
          },
          \"message_id\": {
              \"type\": \"string\"
          },
          \"scaling\": {
              \"enum\": [
                  \"never\",
                  \"always\",
                  \"when_caused_by_living_non_player\"
              ],
              \"type\": \"string\"
          }
      },
      \"required\": [
          \"message_id\",
          \"scaling\",
          \"exhaustion\"
      ],
      \"title\": \"Minecraft Data Pack Damage Type\",
      \"type\": \"object\"
    }"
    json_object: "{
      \"message_id\": \"minecraft:damage.message\",
      \"scaling\": \"always\",
      \"exhaustion\": 0.3,
      \"death_message_type\": \"default\",
      \"effects\": \"hurt\"
    }"
  - json_schema: "{
      \"additionalProperties\": false,
      \"description\": \"Schema for tracking e-commerce transaction details and metadata.\",
      \"properties\": {
        \"store\": {
          \"description\": \"The store or seller associated with the transaction.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"discountCode\": {
          \"description\": \"Promotional code applied to the transaction.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"currencyCode\": {
          \"description\": \"ISO 4217 currency code for the transaction.\",
          \"maxLength\": 3,
          \"minLength\": 3,
          \"type\": \"string\"
        },
        \"transactionId\": {
          \"description\": \"Unique identifier for the transaction.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"productList\": {
          \"description\": \"Identifier for the product list from which the purchase was made.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"purchaseOption\": {
          \"description\": \"Additional purchase options or preferences.\",
          \"maxLength\": 500,
          \"type\": \"string\"
        },
        \"totalAmount\": {
          \"description\": \"Total revenue generated from the transaction.\",
          \"multipleOf\": 0.01,
          \"type\": \"number\"
        },
        \"deliveryCharge\": {
          \"description\": \"Shipping cost associated with the order.\",
          \"multipleOf\": 0.01,
          \"type\": \"number\"
        },
        \"processStep\": {
          \"description\": \"Current step in the purchase or checkout process.\",
          \"maximum\": 2147483647,
          \"minimum\": 0,
          \"type\": \"integer\"
        },
        \"taxAmount\": {
          \"description\": \"Total tax applied to the transaction.\",
          \"multipleOf\": 0.01,
          \"type\": \"number\"
        }
      },
      \"self\": {
        \"format\": \"jsonschema\",
        \"name\": \"transactionDataObject\",
        \"vendor\": \"com.ecommerce.analytics.tracking\",
        \"version\": \"1-0-0\"
      },
      \"type\": \"object\"
    }"
    json_object: "{
      \"store\": \"TechGadgets Online\",
      \"discountCode\": \"SUMMER20\",
      \"currencyCode\": \"USD\",
      \"transactionId\": \"TXN123456789\",
      \"productList\": \"Best Sellers\",
      \"purchaseOption\": \"Express Shipping\",
      \"totalAmount\": 299.99,
      \"deliveryCharge\": 5.99,
      \"processStep\": 3,
      \"taxAmount\": 20.50
    }"
  - json_schema: "{
      \"properties\": {
          \"date\": {
              \"description\": \"The date of the meeting\",
              \"type\": \"string\"
          },
          \"time\": {
              \"description\": \"The time of the meeting\",
              \"type\": \"string\"
          },
          \"participants\": {
              \"description\": \"List of participants' emails\",
              \"type\": \"array\",
              \"items\": {
                  \"type\": \"string\"
              }
          }
      },
      \"required\": [
          \"date\",
          \"time\"
      ],
      \"type\": \"object\"
    }"
    json_object: "{
      \"date\": \"2024-09-30\",
      \"time\": \"10:00 AM\",
      \"participants\": [
          \"alice@example.com\",
          \"bob@example.com\"
      ]
    }"