Skip to content

Instantly share code, notes, and snippets.

@gonz
Created February 3, 2015 15:20
Show Gist options
  • Save gonz/ceb549e495c7f4d1d74b to your computer and use it in GitHub Desktop.
Save gonz/ceb549e495c7f4d1d74b to your computer and use it in GitHub Desktop.
Pipeline JSON
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