From 9542199b0fdec2e7ba3e75d4f3798d36a0becedf Mon Sep 17 00:00:00 2001 From: Eli Sherer Date: Tue, 21 Jan 2025 15:44:56 +0200 Subject: [PATCH] fix training data to new map structure --- ml/training/_samples.json | 20 +++++++++----------- ml/training/map.json | 30 +++++++++++++----------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/ml/training/_samples.json b/ml/training/_samples.json index f38755b..884a6ce 100644 --- a/ml/training/_samples.json +++ b/ml/training/_samples.json @@ -2,17 +2,15 @@ "generate a transformer that double each letters in a word (example: from hello to hheelllloo)": [ { "$$join": { - "$$map": [ - { - "$$split": "$" - }, - { - "$$join": [ - "##current", - "##current" - ] - } - ] + "$$map": { + "$$split": "$" + }, + "to": { + "$$join": [ + "##current", + "##current" + ] + } } } ] diff --git a/ml/training/map.json b/ml/training/map.json index aaaeee8..d697f16 100644 --- a/ml/training/map.json +++ b/ml/training/map.json @@ -11,26 +11,22 @@ }, "maps the elements of the field \\\"item\\\" to an object with the following properties: * \\\"id\\\" is set to the value of the \\\"id\\\" property of the corresponding item. * \\\"map_foo\\\" is set to the value of the \\\"foo\\\" property of the corresponding item. * \\\"idx\\\" is set to the index of the corresponding item in the \\\"items\\\" array. * \\\"value\\\" is set to the value of the \\\"value\\\" property of the input object. (object form)": { "$$map": [ - [ - "$.item" - ], - { - "id": "##current.id", - "map_foo": "##current.foo", - "idx": "##index", - "value": "$.value" - } - ] + "$.item" + ], + "to":{ + "id": "##current.id", + "map_foo": "##current.foo", + "idx": "##index", + "value": "$.value" + } }, "creates a new list by selecting the second element from each sublist in the input list. (object form)": { "$$map": [ [ - [ - "$.a", - "$.b" - ] - ], - "##current[1]" - ] + "$.a", + "$.b" + ] + ], + "to": "##current[1]" } } \ No newline at end of file