Skip to content

Commit 9542199

Browse files
committed
fix training data to new map structure
1 parent 2c55d19 commit 9542199

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

ml/training/_samples.json

+9-11
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
"generate a transformer that double each letters in a word (example: from hello to hheelllloo)": [
33
{
44
"$$join": {
5-
"$$map": [
6-
{
7-
"$$split": "$"
8-
},
9-
{
10-
"$$join": [
11-
"##current",
12-
"##current"
13-
]
14-
}
15-
]
5+
"$$map": {
6+
"$$split": "$"
7+
},
8+
"to": {
9+
"$$join": [
10+
"##current",
11+
"##current"
12+
]
13+
}
1614
}
1715
}
1816
]

ml/training/map.json

+13-17
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,22 @@
1111
},
1212
"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)": {
1313
"$$map": [
14-
[
15-
"$.item"
16-
],
17-
{
18-
"id": "##current.id",
19-
"map_foo": "##current.foo",
20-
"idx": "##index",
21-
"value": "$.value"
22-
}
23-
]
14+
"$.item"
15+
],
16+
"to":{
17+
"id": "##current.id",
18+
"map_foo": "##current.foo",
19+
"idx": "##index",
20+
"value": "$.value"
21+
}
2422
},
2523
"creates a new list by selecting the second element from each sublist in the input list. (object form)": {
2624
"$$map": [
2725
[
28-
[
29-
"$.a",
30-
"$.b"
31-
]
32-
],
33-
"##current[1]"
34-
]
26+
"$.a",
27+
"$.b"
28+
]
29+
],
30+
"to": "##current[1]"
3531
}
3632
}

0 commit comments

Comments
 (0)