Skip to content

Commit

Permalink
fix training data to new map structure
Browse files Browse the repository at this point in the history
  • Loading branch information
elisherer committed Jan 21, 2025
1 parent 2c55d19 commit 9542199
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
20 changes: 9 additions & 11 deletions ml/training/_samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
}
]
Expand Down
30 changes: 13 additions & 17 deletions ml/training/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
}
}

0 comments on commit 9542199

Please sign in to comment.