Created
February 3, 2015 15:20
-
-
Save gonz/ceb549e495c7f4d1d74b to your computer and use it in GitHub Desktop.
Pipeline JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var prototype1 = { | |
"version": "0.1", | |
"return": "result", | |
"steps": [{ | |
"for_each": { | |
"items": "std", // FIXME | |
"for_each_item": [{ | |
"classify": { | |
"module_id": "cl_8naYeRdA", | |
"text": "item", | |
"register": "lang_classify" | |
}, | |
}, { | |
"case": { | |
"var": "registry.lang_classify[-1].label", | |
"cases": [ | |
{ | |
"'es'": [{ | |
"classify": { | |
"module_id": "cl_83nk3hd", | |
"text": "item", | |
"register": "sentiment" | |
} | |
}] | |
}, { | |
"'en'": [{ | |
"classify": { | |
"module_id": "cl_83nk3hd", | |
"text": "item", | |
"register": "sentiment" | |
} | |
}] | |
}, { | |
"else": [{ // else | |
"classify": { | |
"module_id": "cl_83nk3hd", | |
"text": "item", | |
"register": "sentiment" | |
} | |
}] | |
} | |
] | |
}, | |
}, { | |
"assign": { | |
"var": "result[item_index]['lang']", | |
"value": "registry.lang_classify[-1].label" | |
} | |
}, { | |
"assign": { | |
"var": "result[item_index]['sent']", | |
"value": "registry.sentiment[-1].label" | |
} | |
} | |
] | |
} | |
}] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment